Back to General Articles

Using vbHome to create "static" pages
by 2root4u 05 Apr 2003

Just a note on another neat way that vbHome can be used. Before even seeing logician's WEBTEMPLATES hack, I wanted the ability to show static-looking pages based on threads. Having already installed vbHome, I figured it would be nice to use its functionality for each static page. So here's what I did (official hack walk-through not created yet):

1) Copied the vbHome (not vBulletin) index.php to articleview.php still in your root directory not the vb directory.

2) Edited articleview.php to require "../global.php" instead of "global.php" (because articleview.php will be included from the vb directory), thus:

REPLACE:
PHP Code:
require_once( 'global.php' ); 
WITH:
PHP Code:
require_once( '../global.php' ); 
3) Edited articleview.php to use the forum id passed in through the $forumid variable, thus:

BEFORE:
PHP Code:
$allowedforums '0' allowedforums(); 
INSERT:
PHP Code:
$articleforum "$forumid"
4) edited the vbHome global.php to set the admin path based on if $articleview is set, thus:

REPLACE:
PHP Code:
  $adminpath 'vb/admin'
WITH:
PHP Code:
  if($articleview == "yes")
     
$adminpath 'admin';
  else
     
$adminpath 'vb/admin'
5) Edited forumdisplay.php (in the vb directory) to use articleview.php instead of the typical forumdisplay code when articleview = yes, thus:

AFTER:
PHP Code:
error_reporting); 
INSERT:
PHP Code:
if($articleview=="yes") {
include(
'../articleview.php');
exit;

6) Make sure all the forums that you want to be able to display "static" are in the Article Forums list in the Front Page section of vBulletin Options. Note that any threads created before a forum is added to Article Forums list will only show the thread titles and not the text of the first post. This little issue has nothing to do with my setup, just the way vbHome was designed. Definitely not a "problem", just something that might make you think you setup something wrong...I know it messed me up for a while until I figured out what was happening.

7) Make all the links you want to your static page by simply adding "&articleview=yes" to any forumdisplay url. For example:
Make: http://www.your-site.ex/vb/forumdisplay.php?forumid=12
Into: http://www.your-site.ex/vb/forumdisplay.php?forumid=12&articleview=yes

8) (optional) For my site, I wanted to make the static pages REALLY look static. Thus all the nifty article buttons and such, I wanted gone. So I edited all the Home templates to get rid of the vb buttons from the header, all buttons from articlebit, remove all boxes on the left except quicklinks, and made quicklinks contains all my "static" pages and a link to my forums. If you want to retain the default article view for your main vbHome page, but still have other pages with the plain-version I described, just create a copy of your Default template set, modify the new set of Home templates, and set all your static forums to that new style.

I just wanted to put this out there for anyone who wants to manage their static content by just using forums and threads without requiring the full WEBTEMPLATES hack. Until I write a real hack walk-through and test it, I suggest you only try this if you understand what its doing.

vblts.ru supports vBulletin®, 2022-2024