Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > General Articles
Using vbHome to create "static" pages
2root4u
Join Date: Feb 2003
Posts: 20

 

Show Printable Version Email this Page Subscription
2root4u 2root4u is offline 04-04-2003, 10:00 PM

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.
Reply With Quote
  #2  
Old 04-05-2003, 01:35 PM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can also read this tutorial:
http://www.teckwizards.com/forum/sho...p?threadid=714

Reply With Quote
  #3  
Old 04-05-2003, 01:41 PM
2root4u 2root4u is offline
 
Join Date: Feb 2003
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 03:35 PM TECK said this in Post #2
You can also read this tutorial:
http://www.teckwizards.com/forum/sho...p?threadid=714

Yes, but I don't want a php file for EVERY static page I want. I had been using that tutorial prior to make my setup more flexible.

Another thought...If we added another field to the thread row (articleview), then there could be a flag set in the edit forum and setting up article views would be even easier.
Reply With Quote
  #4  
Old 04-05-2003, 02:08 PM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Feel free to use also the support forums, you can get many tips in there...
http://www.teckwizards.com/
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:39 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07379 seconds
  • Memory Usage 2,228KB
  • Queries Executed 17 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (8)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete