![]() |
An Idea for Thread Display Order
Would it be possible to create a hack that would allow the default thread display order for certain forums to be set to Alphabetical? I am thinking for book lists and FAQs this would be a nice feature.
Obviously the user can click the THREAD button to reorder the posts alphabetically or reverse alpha, but certain information-only forums really would benefit from a default presentation like this, plus very few new users know they can reorder the display of threads by thread/starter/replies/views/rating or Last Post. Maybe what I am actually suggesting is that the admin could be able to select any of these options: thread title/starter/replies/views/rating/lastpost could be configurable as the Thread sort order, able to override "last post" order, which would remain the default. Regards, Matt |
Very nice idea, actually.
|
in your forumdisplay.php you can find this:
PHP Code:
|
But, that would change all the forums to the new order (alphabetic or views, etc) wouldn't it? I was really hoping to just affect one or two - the faq sorted by alpha; the booklist sorted by rating, and so forth.
Regards, Matt |
replace it with an if-clause:
PHP Code:
|
Thanks Xenon!
|
This is great, Thanks!
|
Xenon, I can't find the string of characters:
$sortfield ='lastpost' in the template forumdisplay. What is the exact name of the template I need to look for. I am only interested for the time being by having the Thread display in the order: first created, first in the list. I totally agree with Memobug. We should have the choice of orders'criterias in the Admin options. Thanks for your help! |
Catherine you should read more carefully:
i said forumdisplay.php not the forumdisplay template |
Xenon,
Sorry for my stupid question but I am not a Java script specialist and am just trying to hack some of my templates based on my knowledge of other programming languages. So where can I find forumdisplay.php? Thank you to let me know. |
Catherine, forumdisplay.php is written in the PHP scripting language, not in JavaScript. You will find forumdisplay.php in the root directory of your vBulletin installation.
|
Thank you!
|
hi there, thanks very much for this tip its something that i have needed on my board for a while and didnt know it existed hat off 2 ya :)
only thing is could someone tell me how to change it so that the forum i am displaying by thread title so that it is sorted in ascending order aswel? heres what i have at the moment in my forumdisplay.php file PHP Code:
many thanks in advance |
just change it to:
PHP Code:
|
hi there mate thanks very much for your help. Ive changed it but it doesnt seem to have taken effect - heres what my forumdisplay.php looks like
PHP Code:
many thanks :) |
hmm, it should work, be sure it's below this block:
if ($sortorder!='asc') { $sqlsortorder='DESC'; $order['desc']='selected'; } else { $sqlsortorder=''; $order['asc']='selected'; } have you uploaded the correct file? |
yeah definetly mate triple checked that and its underneath that block heres what more if it looks like..........
PHP Code:
|
looool, damn sorry was my fault
change $sortorder=''; into $sqlsortorder=''; |
Would it be possible to get a hack, which allows the user to set the thread order (forward or reverse) from the user control panel?
No matter what way I set it, half the group always wants it the other way. Thanks! |
^bump
|
Hello, all of this seems really helpful, and gets me close to what I'd like, which is:
Choose certain forums (not all) to be displayed by the time/date of initial post of each thread. In other words, once threads are posted, there isn't a way to bump them to the top. They just stay in the order they are posted. Could anyone help with the coding for this? Needed for about 5 forums out of the total (though it seems easy to add or subtract addl. forums as needed). |
This is almost perfect for what we need...
My question...how to make if($foruminfo[forumid]==1) apply to a range of forum id's? So that a few different sections can be sorted alphabetically. Gary |
if(in_array($foruminfo['forumid'], array(a,x,y,...,z)))
|
Ok, this is really messed up. I thought I had it until someone tried going to page 2. I have thread started for each state and want them to appear in alphabetical order. This is what I have, which (I think) should be right...
Quote:
Any ideas? |
Anyone? :)
|
Quote:
|
Nice mod. Thank you, I found it very useful for a new section I am opening on my forum!
Chris |
Hi again, a follow up question if anyone is checking this...
I used this but ran into the problem that if the threads flowed over to a 2nd page, the order would start over again, repeating the threads from the 1st page. Anyway I tried Chens version (http://www.vbulletin.com/forum/showt...015#post621015) and got that working but I was wondering if it is possible to change the "Last Thread - Next Thread" links to go the next/last thread alphabetically rather than by post ID? I am using vB 2.3.2 and the forums that I have the alpha sort applied to are using a seperate style template so if its a template change it wont impact the rest of my forum. Or should I create a new request rather than adding to this thread? Thanks! Chris |
Ok guys, i beleive i have this one sorted..
What happens is with your present setup the sort order is passed onto the next page link.. With Xenons hack it overides the default. Here is my "hack" which should make it work. However, it doesnt fix an issue with teh sort arrow being rendered useless on the first click (you need to click it twice for the order to change) Heres my code: PHP Code:
Fixed the sorting arrow issues - find: PHP Code:
PHP Code:
|
I'm now running VB 3.5.
I tried the following which does not change the display. What am I doing wrong? default: $handled = false; ($hook = vBulletinHook::fetch_hook('forumdisplay_sort')) ? eval($hook) : false; if (!$handled) { $sqlsortfield = 'lastpost'; $sortfield='title'; Thanks Bernie |
May you have an idea, too, how to sort different on forum home?
Say we have two style-ids; with it we could make a decision, with style-id 1 we would have sort as usual, with style-id we have another one. The problem with this, i dont have a sort criteria. I only want to set up to forums to the top, that be at the end normaly (without changing the other ones). |
All times are GMT. The time now is 09:11 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|