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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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