Log in

View Full Version : Listing Sub-Forums in alphabetical order..


Tweaksta
09-03-2008, 05:45 AM
Greetings...

After much hunting I have discovered that vBulletin doesn't have the ability to list all of my Sub-Forums alphabetically out of the box....it can be done by inserting the right bit of code into the right .php file.

Can any of you vBulletin Modders give me a push in the right direction here?

I was just reminiscing how easy it was to write a BASIC program 25 years ago which could sort lists alphabetically. Isn't it funny how with today's powerful computers and software I've had to submit multiple posts to multiple forums in the hope that I've caught the attention of someone who can answer this?

Oh, and manually doing it isn't an option - several thousand subforums and daily additions/removals. It needs to be 100% automatic.

Thanks in advance!!

Dismounted
09-03-2008, 06:38 AM
You could probably create a script to sort the forums using sort().

Lynne
09-03-2008, 04:45 PM
I posted this on your thread at vb.com:

Go to the file /includes/adminfunctions.php around line 3077. There is a query called $newforumcache and it is ORDER BY displayorder. Change that line to ORDER BY title. Save. Upload file. You may have to go to Forum Manager and hit Save Display Order to get the datastore cache rebuilt. See if that works. Warning though!!! That will put it all in alphabetical order including the Main Categories. You would have to tweak that area in the code to do it differently.

Tweaksta
09-03-2008, 11:11 PM
Thank you!!

It worked!!

This is exactly what I was after....

Special thanks to Lynne!

sundarmobiles
11-22-2008, 02:04 AM
is this possible to make this one only forum subforum? i dont want main forum is this possible

Killhunter
01-04-2012, 10:23 AM
is this possible to make this one only forum subforum? i dont want main forum is this possible

same problem here

insidegames
02-07-2013, 12:50 PM
same problem here..

--------------- Added 1360267704 at 1360267704 ---------------

is this possible to make this only one forum subforum? i dont want all my main forum are listed in alphabetical order.

i want only listed this sub-forums:

http://forum.insidegames.ch/xbox-live-arcade-games-f173
http://forum.insidegames.ch/windows-phone-7-games-f218
http://forum.insidegames.ch/playstation-vita-games-f838
http://forum.insidegames.ch/xbox-360-ps3-retail-games-f96

and all subforums in their subforums

insidegames
02-11-2013, 08:59 AM
Nobody?

Lynne
02-11-2013, 06:06 PM
Did you try just putting a condition around it based on the forumid?

insidegames
02-15-2013, 10:25 AM
Hi, thank you very much for your kind response. Actually we tried to solve the problem by adding a field in the order by part of the Query (actually i do not remember which one but the idea was to order by Forum an then by title if I remember well). But this didn't change anything (maybe it was the wrong field). Is that what you asked or do you mean an approach on the forum structure itself ?

Lynne
02-15-2013, 03:53 PM
It's hard to know if you did it correctly if you don't post the exact code you used and then let us see the results.

insidegames
02-19-2013, 07:59 AM
It was:

There is a query called $newforumcache and it is ORDER BY displayorder. Change that line to ORDER BY title

ORDER BY parentid, title

christleo
02-21-2013, 05:20 PM
Can i sort sub forum by lastest thread/post reply?

zhono
11-25-2013, 01:58 AM
Anyone that's still looking for this, follow Lynne's instructions, but use this:

ORDER BY displayorder, title

Now what will happen is the display order will work normally. But if you want some subforums to be listed/displayed alphabetically, just give them the same display number. For your existing forums to get this, just go to maintencance and rebuild forum information. All new forums added will get placed alphabetically right from the start IF you use the same display number. If you use a different number, it'll will be listed where it normally would. But if you later decide to change the number to the same as the rest and hit save, it'll pop right in line with the alphabetical stuff. So far I haven't seen any issues with this method and it's incredibly simple and easy to manage my 400+ subforums. Some are alpha, some are not, and it doesn't take me ANY time to mess around with display order numbers.:D

*EDIT* A little clarification. Just because some items have the same number, doesn't mean they will be sorted alphabetically. They have to have the same number AND be subforums of the SAME forum or category.

Ghostt
04-24-2014, 11:43 PM
big Thanks to zhono and lynne . this helped me and safed a lot of work!