Version: , by Admin (Coder)
Developer Last Online: Nov 2024
Version: 2.0.x
Rating:
Released: 09-16-2001
Last Update: Never
Installs: 22
No support by the author.
This hack adds a yes/no option for forums, to select whether you want to display that forum (or category) on the main page.
I added a "sanity check", so you can't hide forums that have no parent (because then you won't be able to access any of its sub-forums).
I'll get a demo in a few minutes.
// SANITY CHECK (prevent invalid nesting)
if ($parentid==$forumid) {
echo "<b>ERROR:</b> You can't parent a forum to itself!<br><br>".makelinkcode("Go back","javascript:history.back(1)");
exit;
}
$foruminfo = $DB_site->query_first("SELECT forumid,title,parentlist FROM forum WHERE forumid='$parentid'");
$parents = explode(",", $foruminfo[parentlist]);
while (list(,$val) = each($parents)) {
if ($val==$forumid) {
echo "<b>ERROR:</b> You can't parent a forum to one of its own children!<br><br>".makelinkcode("Go back","javascript:history.back(1)");
exit;
}
}
// end Sanity check
with
PHP Code:
// SANITY CHECK (prevent invalid nesting)
if ($parentid==$forumid) {
echo "<b>ERROR:</b> You can't parent a forum to itself!<br><br>".makelinkcode("Go back","javascript:history.back(1)");
exit;
}
$foruminfo = $DB_site->query_first("SELECT forumid,title,parentlist FROM forum WHERE forumid='$parentid'");
$parents = explode(",", $foruminfo[parentlist]);
while (list(,$val) = each($parents)) {
if ($val==$forumid) {
echo "<b>ERROR:</b> You can't parent a forum to one of its own children!<br><br>".makelinkcode("Go back","javascript:history.back(1)");
exit;
}
}
if ($parentid==-1 and $showonhome==0) {
echo "<b>ERROR:</b> You can't hide a forum with no parent!<br><br>".makelinkcode("Go back","javascript:history.back(1)");
exit;
}
// end Sanity check
We don'e with forum.php, save and upload.
In index.php (main folder) replace
PHP Code:
$forums=$DB_site->query('SELECT * FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');
with
PHP Code:
$forums=$DB_site->query('SELECT * FROM forum WHERE displayorder<>0 AND showonhome=1 AND active=1 ORDER BY parentid,displayorder');
We don'e with index.php, save and upload.
That's it!
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
I'm not sure exactly what this does? Here's my idea of it:
You have the forum depth set at 2, so forums 4 deep aren't shown. But if you want one of those shown, you use this and select to have it shown, then its on the forum homepage?
I'm not really sure about this...
squawell: Enter your license info in your profile. To do that go to [url=http://www.vbulletin.com/forum/member.php?s=&action=editprofile]this[url] page and scroll down. Then enter your license and password.
Say you have the depth at 3 and have a category with three forums in it:
cat-->forum1
forum2
forum3
Now all forums are shown on forumhome under the category
turn of the show on forumhome switch and they are not shown on main page but if you click the category they're there.