PDA

View Full Version : Emulate a Forum as a Link



filburt1
Fri 20th Sep '02, 11:21pm
Mod, please move to Hints and Tips if you feel it's appropriate :)

Okay, let's say you want to make one of your forums escentially a link to another forum or somewhere else altogether. But you don't want to hack (there's a hack to do it at vB.org (http://www.vbulletin.org/)). And since nobody knows a release date for vB3 we can just assume that vB3, which has this feature, is really a big conspiracy. So here's how to do it.

1. Create a new forum; set it to not act as a forum (i.e., act as a category). This is simply to hide the new post icon which will not work accurately if you're linking to another forum).
2. Find out the newly created forum's id; to do this, go to your forum's home page and hover your mouse over the name of the forum and look at your browser's status bar. The very last number in the URL should be the forum id.
3. Edit your phpinclude template; add this to whatever you have in there already:


if ($forumid == #)
{
header('Location: url');
exit;
}

Replace the blue text with the forum id from step 2.

If you are linking to a completely external page, replace the red text with the URL you want that forum to act as a link to.
If you're linking to another forum, replace the entire "header(..." line with this:


header('Location: forumdisplay.php?s=' . $session[sessionhash] . '&forumid=#');

Replace the green # with the id of the forum to which you want to link.
4. Save the template and enjoy.

Questions?

You can see this in action at my forums (http://www.turtletips.com/forums/). The very last category ("All Other Forums") links to a different set of forums. Notice how the linked forum's id is 90 but the forum you get when you click the link is 19.

Wayne Luke
Sat 21st Sep '02, 1:42am
Here is a method that doesn't require changing any php files.

http://www.vbulletin.com/forum/showthread.php?s=&threadid=53153

filburt1
Sat 21st Sep '02, 1:06pm
IMHO this is cleaner just because the forum truly does act as a link and isn't cheated Jake's cheap way ;)

But whatever. :)

plattopus
Sat 21st Sep '02, 1:23pm
I was about to suggest using the way wluke brought up, because it's far easier than setting up some PHP to do it.

filburt1
Sat 21st Sep '02, 1:25pm
Right. But let's say you try visiting the forum via the dropdown or just guessing a forum id, even. This way will work regardless of the situation; Jake's way only works if you click a link to the forum (yes, that's most of the hits for entry, but mine's all inclusive). :)

Edit: BTW Wayne this is only editing the phpinclude template, no actual file changes.

Blazze
Wed 28th May '03, 11:30am
Edit: BTW Wayne this is only editing the phpinclude template, no actual file changes.
I was just woundering how todo this very thing, i just added it into my phpinclude template and it works fine, thanks to who ever made this addition. :)

Blazze