Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jan 2003
Posts: 250
Member
Member
Offline
Joined: Jan 2003
Posts: 250
You can easily sort a forum alphabetically by subject by clicking the SUBJECT link in the topic page (postlist).

Here is the URL to sort this forum alpha, ascending:

Code
<br />https://ubbdev.com/forum/postlist.php?Cat=&Board=php&page=0&view=collapsed&sb=2&o=<br />


So you could just append the extra "&page=0&view=collapsed&sb=2&o=" to the URL for those forums you want sorted in this fashion in to your UBBTHREADS.TMPL file.

In UBBTHREADS.TMPL find:
Code
<br /><a href="{$config['phpurl']}/postlist.php?Cat=$Cat&amp;Board={$forum[$c][$f]['Keyword']}"><br />


Change it to:
Code
<br /><a href="{$config['phpurl']}/postlist.php?Cat=$Cat&amp;Board={$forum[$c][$f]['Keyword']}{$forum[$c][$f]['SortBy']}"><br />


$forum is an multi-dimensional array that holds display and organization info about each forum. We are going to add an entry in that array called "SortBy" and stick our sort info in it, and then append it to the URL on the forums page.

Then open UBBTHREADS.PHP and find:
Code
<br />$forum[$x][$y]['Keyword'] = $Keyword;<br />


After that add:
Code
<br />if ($Keyword == "XXXX") {<br />    $forum[$x][$y]['SortBy'] = "&page=0&view=collapsed&sb=2&o=";<br />}<br />else {<br />    $forum[$x][$y]['SortBy'] = "";<br />}<br />


Replace XXXX with the Keyword of the forum you want to sort. If you want to sort more than one forum alphabetically by subject, the just change the "if" statement to:
Code
<br />if (($Keyword == "XXXX") || ($Keyword == "YYYY")) {<br />


That will make is so that the forums identified by the keywords you specify will be sorted alpha, ascending when the user clicks on the link to open the forum.

Hope that helps!





"Some dream of doing great things, while others stay awake and get on with it."
      -- Anonymous
Sponsored Links
Entire Thread
Subject Posted By Posted
Forcing unique topic view order per forum JasonStixBuckley 05/03/2003 8:08 PM
Re: Forcing unique topic view order per forum JoshPet 05/04/2003 4:57 AM
Re: Forcing unique topic view order per forum Raconteur_dup1 05/04/2003 5:44 AM
Re: Forcing unique topic view order per forum JasonStixBuckley 05/04/2003 8:31 PM
Re: Forcing unique topic view order per forum Raconteur_dup1 05/05/2003 4:34 PM
Re: Forcing unique topic view order per forum JasonStixBuckley 06/12/2004 9:14 PM
Re: Forcing unique topic view order per forum JoshPet 06/13/2004 1:19 AM
Re: Forcing unique topic view order per forum JasonStixBuckley 06/13/2004 1:33 AM
Re: Forcing unique topic view order per forum JoshPet 06/13/2004 1:39 AM
Re: Forcing unique topic view order per forum JasonStixBuckley 06/13/2004 1:53 AM
Re: Forcing unique topic view order per forum JoshPet 06/13/2004 4:25 AM
Re: Forcing unique topic view order per forum JasonStixBuckley 06/13/2004 4:33 AM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)