Jump to content

[SOLVED] working on a forum and need some "sticky" help.


zhTonic

Recommended Posts

Hey guys,

 

What i'm trying to do is when i select all of the threads to be displayed, i have some flagged as stickies and i want them to always be at the top no matter what.

 

I'm not sure if this is achieved via mysql or php, any help would be appreciated.

 

Thanks.

Link to comment
Share on other sites

How are they being marked as stickied threads? Generally, the approach is to have some field in your topics table called sticky (or, perhaps, status if you wish to have different levels of thread importance). You would then set the field to 1 for any stickied threads and 0 for those which are not. When you select the topics, you order by sticky (or status) first and date second.

Link to comment
Share on other sites

How are they being marked as stickied threads? Generally, the approach is to have some field in your topics table called sticky (or, perhaps, status if you wish to have different levels of thread importance). You would then set the field to 1 for any stickied threads and 0 for those which are not. When you select the topics, you order by sticky (or status) first and date second.

 

That's how i have it in the database right now, there is a sticky field in the row... Also thanks for reminding me about ORDER BY i totally forgot about it.

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.