March 28, 2024, 10:41:02 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to Revolution X, where Coding meets Graphics.
 
  Home Help Search Arcade Affiliates Staff List Calendar Members Login Register  

Automatically sort topics by name

Pages: [1]   Go Down
  Print  
Author Topic: Automatically sort topics by name  (Read 626 times)
0 Members and 1 Guest are viewing this topic.
Exilis
Optimistic & Creative
Global Moderator
Global Moderator
Offline Offline

Posts: 929


View Profile
Badges: (View All)
Tenth year Anniversary Linux User Combination
« on: June 13, 2009, 09:09:46 am »

This code automatically sorts topics by name in a certain board. I'll update it later to allow multiple boards if you want me to.
Code:
<script>
BOARD="1";
if(location.href.match("board," + BOARD + ".0.html")) {
location.href=smf_scripturl + "/board," + BOARD + ".0/sort,subject.html";
}
</script>
Change the BOARD="1" to the board number. You can find the board number by looking at the URL for the board and looking for "board,n.0" where n is the board number.

Basically what this code does is it automatically changes the URL from http://forum.smfforfreex.com/index.php/board,1.0.html
to
http://forum.smfforfreex.com/index.php/board,1.0/sort,subject.html
That makes the board's topics sorted.
Report Spam   Logged

Global Mod, (sort of) at your service.

http://twitter.com/timothyaveni

Share on Facebook Share on Twitter

Agent Moose
Administrator
Adminitrator
Offline Offline

Gender: Male
Posts: 1,470



View Profile WWW
Badges: (View All)
Tenth year Anniversary Nineth year Anniversary Search
« Reply #1 on: June 13, 2009, 12:06:23 pm »

Pretty cool code Wink  I see you saw one of andrews posts Tongue

I have an easier way to do this, but I shall just leave this code to you Tongue
Report Spam   Logged


Mojobojo82
MVP
MVP
Offline Offline

Gender: Male
Posts: 838


View Profile
Badges: (View All)
« Reply #2 on: June 14, 2009, 01:54:27 am »

Nice Code! I'm using it now and it works fine... Thanks for this code
Report Spam   Logged






Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy