The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Reorganize Subscribed Forums by Numerical Order Instead Of Alphabetical Order Details »» | |||||||||||||||||||||||||||
Reorganize Subscribed Forums by Numerical Order Instead Of Alphabetical Order
Developer Last Online: Jun 2011
Ive been toying around tonight with creating a new page called favorites.php that will allow me to display just the forums that Ive maked as the ones I want to suscribe to with a little bit of other basic information. Basically I reworked the usercp page, the only problem Im running into is that the forums are showing up in alphabetical format and thats not what i want, I want them to show up in the order they are displayed on the index.php file.. What do I have to change to do this? Here is the code for it
Code:
// ############################### start subscribed forums ############################### $forums=$DB_site->query("SELECT * FROM forum,subscribeforum WHERE subscribeforum.forumid=forum.forumid AND userid=$bbuserinfo[userid] ORDER BY title"); $totalforums=$DB_site->num_rows($forums); $forumbits = ''; if ($totalforums>0) { while ($forum=$DB_site->fetch_array($forums)) { $forumperms=getpermissions($forum[forumid]); if (!$hideprivateforums) { $forumperms[canview]=1; } if ($forumperms[canview]) { $forumshown=1; // do light bulb if ($bbuserinfo[lastvisitdate]=="Never") { $forum[onoff]="on"; } else { if (isset($bbforumview[$forum['forumid']]) and $bbforumview[$forum['forumid']]>$bbuserinfo['lastvisit']) { $userlastvisit=$bbforumview[$forum['forumid']]; } else { $userlastvisit=$bbuserinfo['lastvisit']; } if ($userlastvisit<$forum['lastpost']) { $forum[onoff]="on"; } else { $forum[onoff]="off"; } } if ((!$forumperms['canpostnew'] and $showlocks) or $forum['allowposting']==0) { $forum[onoff].="lock"; } // prepare template vars if (!$showforumdescription) { $forum[description]=""; } // dates if ($forum[lastpost]>0) { $forum[lastpostdate]=vbdate($dateformat,$forum[lastpost]); $forum[lastposttime]=vbdate($timeformat,$forum[lastpost]); eval("\$forum[lastpostinfo] = \"".gettemplate("forumhome_lastpostby")."\";"); } else { $forum[lastpostinfo]="Never"; } eval("\$forumbits .= \"".gettemplate("favorites_forumbit")."\";"); } // if can view } // while forums eval("\$forumlist = \"".gettemplate("usercp_forums")."\";"); } else { eval("\$forumlist = \"".gettemplate("usercp_noforums")."\";"); } http://www.newcelica.org/forums/favorites.php?s= Im still gonna change a few other things but the biggest thing I want to change is the display order of the forums from alphabetical to numercial.. thanks in advance guys.. Show Your Support
|
Comments |
#2
|
|||
|
|||
Change this >> ORDER BY title << to what you need....could be id etc....
|
#3
|
|||
|
|||
but what is the column name if its not title.. im not familair with the dbase setup
|
#4
|
||||
|
||||
<font face="Courier">ORDER BY forum.forumid</font>
|
#5
|
|||
|
|||
close but now i got a nother issue.. that did arrange them by forum id, but thats not the way there displayed on the main page, on the main page there displayed by Forum Order which is specified in the forum control panel.. can i do the same here?
|
#6
|
||||
|
||||
That would be more complicated I'm afraid.
|
#7
|
|||
|
|||
yeah i figured as much, I dont understand why it has to be so complex.. I mean I can figure out the logic
go through the forums the same way the main page does and display them in display order and only show them if its marked as a favorite.. this would be a nice hack if I could figure out this one last thing |
#8
|
|||
|
|||
Why not ORDER BY forum.displayorder
|
#9
|
|||
|
|||
wow.. that was simple.. that worked.. I just didnt know the right identifier.. AWESOME.. thanks everyone I might compile this whole mess up nicer and release it as a hack
|
#10
|
||||
|
||||
Quote:
See the screenshot if you don't understand. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|