Jump to content

[SOLVED] Lock and sticky posts


jrws

Recommended Posts

Hey there,

I have made a custom forum and so far so good, I was wondering how I can make the topics become 'stickyed' and stay at the top of the page? Would I need a new row on the topic table? What about locking, I am thinking only access levels can post. Or something like that.

Any help is appreciated,

Thanks,

James.

Link to comment
https://forums.phpfreaks.com/topic/164183-solved-lock-and-sticky-posts/
Share on other sites

Create extra columns on the topic table, like is_locked and is_sticky.

 

Then just do something like:

SELECT id, subject FROM topics WHERE forum_id = 5 ORDER BY is_sticky DESC, last_post_date DESC;

The ordering by is_sticky being the most important part here of course.

 

When people try to reply you would just check if it's locked and if they have the appropriate permissions for posting in a locked topic.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.