Hi, all when I was doing a forum recommendation function recently, I don't know how to implement it. The requirement administrator can edit the post in the background. The post can be pushed to the homepage's recommendation position, which is the recommendation position of the Forum itself, there is also a global recommendation space (that is, the recommendation space of each forum should appear here... hi, all
I recently did not know how to implement the recommendation function of a forum.
-- Common_top_recommend table id -- auto-incrementing idpost_id -- Post idtop_recommned_position_id -- publish location id, associate it with another location table, such as the home page, Forum, Global type_id -- category id, associate another type table, for example, category_id -- Forum id -- common_top_recommend_position table id -- auto-increment idname -- display name codename -- name used for matching, such as index, category, global -- common_top_recommend_type table id -- auto-increment idname -- display name codename -- used for matching name, such as top/digest/announce
For example, find the top posts of a Forum:
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 way, you can find the top posts of the current forum.
However, I think there may be some problems with this implementation. I have referred to the discuz and phpwind code. It seems that they all use the display_order field to complete location operations, but the specific implementation details are not very clear.
I wonder if there is any better and lighter solution?
Reply content:
Hi, all
I recently did not know how to implement the recommendation function of a forum.
-- Common_top_recommend table id -- auto-incrementing idpost_id -- Post idtop_recommned_position_id -- publish location id, associate it with another location table, such as the home page, Forum, Global type_id -- category id, associate another type table, for example, category_id -- Forum id -- common_top_recommend_position table id -- auto-increment idname -- display name codename -- name used for matching, such as index, category, global -- common_top_recommend_type table id -- auto-increment idname -- display name codename -- used for matching name, such as top/digest/announce
For example, find the top posts of a Forum:
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 way, you can find the top posts of the current forum.
However, I think there may be some problems with this implementation. I have referred to the discuz and phpwind code. It seems that they all use the display_order field to complete location operations, but the specific implementation details are not very clear.
I wonder if there is any better and lighter solution?