Forum Post Top-of-the-shelf design issues

Source: Internet
Author: User
Hi,all

I'm not sure how to do it better when I'm doing a forum recommendation.

    • Demand

      • Administrators can edit posts in the background, posts can be pushed to the home page of the recommended bit, the recommendation of the section itself, as well as the overall recommendation bit (that is, each section of the recommended bit to appear this post).
      • The recommended posts have multiple attribute categories, such as sticky posts, essence posts, and so on.
    • The initial implementation plan
      I used three tables (common_top_recommend) to allow administrators to edit in the background. The fields are as follows:


-- 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.

    • Demand

      • Administrators can edit posts in the background, posts can be pushed to the home page of the recommended bit, the recommendation of the section itself, as well as the overall recommendation bit (that is, each section of the recommended bit to appear this post).
      • The recommended posts have multiple attribute categories, such as sticky posts, essence posts, and so on.
    • The initial implementation plan
      I used three tables (common_top_recommend) to allow administrators to edit in the background. The fields are as follows:


-- 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?

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.