PDA

View Full Version : How To Sort On A Custom Field?


mashby
07-15-2002, 04:08 AM
I'm trying to use vB as a task list for a particular client and I've almost got it working like I would like. However, because vB sorts on the most recent post, it throws a kink into everything.

Is there anyway to add a field to forumdisplay.php that can act as a sort field? In other words, replace the "Rating" column with "Priority" and allow the poster to enter a number "1, 2, 3, etc." in the post. From there the forum would sort on that field instead of the last post date.

I've found the Search/Sort/Order in thread view (https://vborg.vbsupport.ru/showthread.php?postid=262372) hack, which looks like a killer hack, but without the new column in which to sort on, I don't think it will work.

If anyone has any ideas, or thoughts to share, that'd be great. If you feel like writing this hack - all the better! :bunny:

mashby
07-22-2002, 04:30 PM
Ok, what about this, any way to sort the topic list by title, instead of by date, by default? I know you can do it if you click the header, but can this be set by default?

mashby
07-22-2002, 05:04 PM
Ok, I found my answer to some extent. If you edit your "forumdisplay_forumbit" templates you can change the following code from <a href="forumdisplay.php?s=$session[sessionhash]&forumid=$forum[forumid]"> to <a href="forumdisplay.php?s=$session[sessionhash]&forumid=$forum[forumid]&sortorder=asc&sortfield=title"> this will then make the forum list by thread title.

======================
Why Do I Want This?
======================
I'm putting together a forum to act as a task/project list. Since vB, by default, sorts by date, this means that posts can get "out of wack."

By starting each post with a "#" I can in effect create a prioritized task list.

========================
What's Missing
========================
The only thing missing is that I can see using this template mod in forums where I don't want this effect in ALL forums.

Is there a hack out there that will allow you to have separate forumdisplay_forumbits for different parts of vB? In other words, have forumid #1 have one set of forumdisplay_forumbits and forumid #2 have a different set?

mashby
07-22-2002, 05:17 PM
Well, this must be the sound of one hand clapping! LOL :p

I found a hack that does what I'm looking for [link (https://vborg.vbsupport.ru/showthread.php?s=&threadid=34556)]