The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
want to have duplicate forumhome page
Hi,
I know this may sound strange, but I was trying to make a duplicate of ForumHome page/template so that I can use Forumhome to show specific forums on forum.php and Forumhome2 (for exampe) to show specific forums on say my custom page forum22.php. I tried to use Tab forums mod here :https://vborg.vbsupport.ru/showthread.php?t=233135, but found it is not good for SEO. now I want to know if there a way to have forumhome on many pages, not like having the same forumhome under different forum.php... Meaning I want for example to show specific forums on forum.php and then have another page say forum22.php with different forums. so the idea is similar to forum tabs as shown in the mod above, but without using mods!! I'm wondering is that possible?? any idea?? Thanks, |
#2
|
|||
|
|||
Well, I'm not sure if I completely understand. But I don't see why you couldn't copy forum.php to another name, then modify it do display only certain forums. It looks like it uses $vbulletin->forumcache, so maybe near the beginning you could delete the forums you don't want to display from $vbulletin->forumcache. You said you don't want to use mods, but it might be possible to do that in a plugin using hook forumhome_start. You could check for a parameter and adjust forumcache accordingly.
But I haven't actually tried this and sometimes you run in to things that don't work like you hoped, as I'm sure you know. |
Благодарность от: | ||
MarkFL |
#3
|
|||
|
|||
It happens I'm working on an update to a mod that ignores a list of forums. Here's a little code snippet for not listing selected forums:
Code:
$ignore_array = array(11,12,23,24); //example of forum id's you don't want to show $cache = array(); foreach($vbulletin->forumcache AS $forumcache) { $i = $forumcache['forumid']; if(!in_array($i, $ignore_array)) { $cache[$i] = $forumcache; } } $vbulletin->forumcache = $cache; |
3 благодарности(ей) от: | ||
fxdigi-cash, kh99, MarkFL |
#4
|
|||
|
|||
Thanks nerbert for sharing the code.
I will give it a try and see if it works. Cheers P.s: where and how do I use this code?? as a plugin? if yes, then what hook should I use with?? Quote:
Quote:
I wanted to make each forum in an independent page because my forums are a lot and each has many sub-forums. so if I made each set of forums in one page, it will be easier for readers and visitors to understand what's going easily. ok, if copying forum.php is a lot easier, then what code do I have to change in the new .php file... is it this code: PHP Code:
any idea?? |
#5
|
|||
|
|||
Well, you could try this:
Code:
// ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### $show_array = array(11,12,23,24); //example of forum id's you want to show $cache = array(); foreach($vbulletin->forumcache AS $forumcache) { $i = $forumcache['forumid']; if(in_array($i, $show_array)) { $cache[$i] = $forumcache; } } $vbulletin->forumcache = $cache; I have no idea how this is going to work. You could be in for a big complicated job. For starters every link has a base path like "http://www.my_forum.com/forum", I don't know how to get the correct path for the threads or forums in the new file/page. |
#6
|
|||
|
|||
I tried that, but didn't work...
The previous code however worked as plugin using forumhome_start hook as suggested by kh99. PHP Code:
is there a way how to do that?? |
#7
|
|||
|
|||
Edit the THIS_SCRIPT value on the new page and enclose the code in
Code:
if(THIS_SCRIPT == 'index22') { } |
#8
|
|||
|
|||
Thanks, mate
I tried all that, but nothing worked...!! I'm pretty sure to some level that it should work, yet no idea how |
#9
|
|||
|
|||
Never mind the stuff above.
First divide your forums up into categories in the forum manager (you probably already have). Forget the forum home page and use copies of forumdisplay.php to display each category separately. So make copies of forumdisplay.php with names like forum1.php, forum2.php or whatever. In each one edit in $_REQUEST['forumid'] = 10; $_REQUEST['forumid'] = 20;, etc, whatever your category forumid's are, right under the big START MAIN SCRIPT comment block (EDITED: should be forumid's NOT threadid's) Now go to them and see if it's all working as planned. If all that works all you need to do is duplicate the other stuff on forum home into these new files. So copy the FORUMDISPLAY template and call it CATEGORY and at the bottom of each new file, line 1210 change Code:
$templater = vB_Template::create('FORUMDISPLAY'); Code:
$templater = vB_Template::create('CATEGORY'); |
#10
|
|||
|
|||
ok, great start, but quick question where to find this line as it is not shown in forumdisplay.php
PHP Code:
PHP Code:
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|