![]() |
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. |
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? |
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?
|
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>"; } ?> |
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?
|
Actually, here's another question: Can we exclude forums that are either really Archives, or else are just closed?
|
Yeah I am sure you can do those things.
|
Umm... I meant could somebody show me how?
|
Here is what I wrote up. It is a little more complicated but is more customizable....
Code:
<?php 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"); |
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.) |
You dont have to edit the database at all to run something like this.
|
how do I add this custom field with php code?
can you please include better instructions on how to install it, and what to edit? [Edited by Scaramanga_gold on 01-01-2001 at 12:49 PM] |
Quote:
We currently have 19 public forums and 6 private forums for community Management. There are also 9 categories. If I add more (I have two forums that could be broke up right now) then I would have to change the code, however with my method, I don't. This also makes it easy for the other Administrator who doesn't touch the code to know that things are kept up to date and allows our Network Administrator to know that the listing is correct as we want it. p.s. The other field I added allows you to turn post counting on and off per forum. |
Quote:
I would suggest making the column using phpMySQLAdmin as it is easiest this way. |
Quote:
$query = "SELECT * FROM forum WHERE Active=1 ORDER BY title ASC"; add the WHERE Active=1 and it will only show the active forums... |
All times are GMT. The time now is 12:12 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|