The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Details »» | |||||||||||||||||||||||||
I asked this a while back, but got no replies. So, I'll ask again...
Can someone please write for me a simple little script that will list (echo or print) a list of all the forums in the message board? Each forum should be listed as a hyperlink to that forum. For why I need this, please look at my message board: http://www.jjr512.com/bbs/index.php Notice that at the top of the message board, and on the top of every message board page (forum list, thread list, thread view, etc.) there are hyperlinks into each forum. Many users like to use these, because they can hop around the forums quicker with these than with anything else. I manually created these links, and I'd just like something that will do it automatically, in case my forums change. Show Your Support
|
Comments |
#2
|
|||
|
|||
There is an hack for that already!
But it displays a small bullet list with all forums in order like A, B, C, D.etc? |
#3
|
|||
|
|||
That's fine, I can work out the formatting myself, I just need the actual working part to start with. Can you point me in the right direction?
|
#4
|
|||
|
|||
Here it is:
<?php require("/full/path/to/admin/config.php"); $db=mysql_connect($servername,$dbusername,$dbpassw ord); mysql_select_db($dbname); $query = "SELECT * FROM forum ORDER BY title ASC"; $resultlatest = mysql_query($query,$db); while ($latest_array = mysql_fetch_array($resultlatest)) { echo "<FONT SIZE=\"1\" FACE=\"Verdana, Arial, Helvetica, sans-serif\"> ° <A HREF=\"http://www.extremeforums.com/forums/forumdisplay.php?forumid=$latest_array[forumid]\">$latest_array[title]</A></FONT><BR>"; } ?> |
#5
|
|||
|
|||
OK, that works. Now, one last question: Can you modify it so that it sorts the forums in the same order that they appear in the message board?
|
#6
|
|||
|
|||
Actually, here's another question: Can we exclude forums that are either really Archives, or else are just closed?
|
#7
|
|||
|
|||
Yeah I am sure you can do those things.
|
#8
|
|||
|
|||
Umm... I meant could somebody show me how?
|
#9
|
|||
|
|||
Here is what I wrote up. It is a little more complicated but is more customizable....
Code:
<?php require("config.php"); //Changing these flags to Zero will change the output. $showcat=1; // Show Categories $showdesc=1; // Show Forum Descriptions $db=mysql_connect($servername,$dbusername,$dbpassword); mysql_select_db($dbname); $catquery=("SELECT categoryid,title FROM category WHERE displayorder <> 0 and categoryid<>5 and categoryid<>9 ORDER BY displayorder"); $catresult=mysql_query($catquery,$db); if ($showcat==1){ while ($cat = mysql_fetch_array($catresult)) { echo ("<font face=\"Arial, Helvetica, sans-serif\" size=\"-1\"><a href=\"http://sitepointforums.com/index.php?categoryid=".$cat[categoryid]."\">".$cat[title]."</a></font><br>"); $forumquery=("SELECT forumid,title,description FROM forum WHERE showactive=1 and categoryid=$cat[categoryid] ORDER BY displayorder"); $forumresult=mysql_query($forumquery,$db); while ($forum = mysql_fetch_array($forumresult)) { if ($showdesc==1) { echo ("<font face=\"Arial, Helvetica, sans-serif\" size=\"-3\"><a href=\"http://sitepointforums.com/forumdisplay.php?forum=".$forum[forumid]."\">".$forum[title]."</a><br>".$forum[description]."</font><br>"); } else { echo ("<font face=\"Arial, Helvetica, sans-serif\" size=\"-3\"><a href=\"http://sitepointforums.com/forumdisplay.php?forum=".$forum[forumid]."\">".$forum[title]."</a></font><br>"); } } } } else { $forumquery=("SELECT forumid,title,description FROM forum WHERE showactive=1 ORDER BY displayorder"); $forumresult=mysql_query($forumquery,$db); while ($forum = mysql_fetch_array($forumresult)) { if ($showdesc==1) { echo ("<font face=\"Arial, Helvetica, sans-serif\" size=\"-3\"><a href=\"http://sitepointforums.com/forumdisplay.php?forum=".$forum[forumid]."\">".$forum[title]."</a><br>".$forum[description]."</font><br>"); } else { echo ("<font face=\"Arial, Helvetica, sans-serif\" size=\"-3\"><a href=\"http://sitepointforums.com/forumdisplay.php?forum=".$forum[forumid]."\">".$forum[title]."</a></font><br>"); } } } ?> showactive smallint(6) default 1 setting that column to zero will prevent particular forums from showing. Also if you want to exclude different categories then you can change the line: Code:
$catquery=("SELECT categoryid,title FROM category WHERE displayorder <> 0 and categoryid<>5 and categoryid<>9 ORDER BY displayorder"); |
#10
|
|||
|
|||
Hmm... I thought the solution would involve something similar to this piece of code:
Code:
$querylatest="SELECT * FROM thread WHERE forumid='1' OR forumid='2' OR forumid='3' OR forumid='4' OR forumid='5' OR forumid='6' OR forumid='8' OR forumid='11' OR forumid='12' OR forumid='13' ORDER BY lastpost DESC LIMIT $num_active"; (I'm trying to avoid modifying the database, I haven't even backed it up yet and don't know how, and I'm uncomfortable messing with it. Besides, I think there must be a more elegant solution.) |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|