Hi,all
I'm not sure how to do it better when I'm doing a forum recommendation.
-- common_top_recommend表id -- 自增idpost_id -- 帖子idtop_recommned_position_id --发布的位置id,关联另外一张位置表,比如首页、版块、全局等type_id --类别id,关联另外一张类型表,比如是精华、置顶、公告等category_id --版块id --common_top_recommend_position表id -- 自增idname -- 显示的名字codename -- 用来匹配的名字,比如index,category,global这样 --common_top_recommend_type表id -- 自增idname -- 显示的名字codename -- 用来匹配的名字,比如top/digest/announce等
For example, to find a particular section of the top posts:
select r.post_id from common_top_recommend as r left join common_top_recommend_position as p on r.top_recommned_position_id=p.id where r.category_id=1 or p.codename="global" ;
In this case, you can find out the current section of the sticky sticker.
But I think this implementation may have some problems, I refer to the next Discuz and Phpwind code, as if all through a display_order field to complete the operation of the location, but the implementation details are not very clear.
I wonder if there is a better and lighter solution?
Reply content:
Hi,all
I'm not sure how to do it better when I'm doing a forum recommendation.
-- common_top_recommend表id -- 自增idpost_id -- 帖子idtop_recommned_position_id --发布的位置id,关联另外一张位置表,比如首页、版块、全局等type_id --类别id,关联另外一张类型表,比如是精华、置顶、公告等category_id --版块id --common_top_recommend_position表id -- 自增idname -- 显示的名字codename -- 用来匹配的名字,比如index,category,global这样 --common_top_recommend_type表id -- 自增idname -- 显示的名字codename -- 用来匹配的名字,比如top/digest/announce等
For example, to find a particular section of the top posts:
select r.post_id from common_top_recommend as r left join common_top_recommend_position as p on r.top_recommned_position_id=p.id where r.category_id=1 or p.codename="global" ;
In this case, you can find out the current section of the sticky sticker.
But I think this implementation may have some problems, I refer to the next Discuz and Phpwind code, as if all through a display_order field to complete the operation of the location, but the implementation details are not very clear.
I wonder if there is a better and lighter solution?