Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-12-2004, 07:34 PM
Jakeman's Avatar
Jakeman Jakeman is offline
 
Join Date: Nov 2001
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default template driven pages

Re: http://www.vbulletin.com/forum/showthread.php?t=101325

Create a PHP file with this code. Change the red code appropriately. This will display a page within your forum layout where the page contents are the contents of the template you specify.

Code:
<?php

// GO TO FORUM DIR
chdir('/full/path/to/forum/directory');

// STANDARD VBULLETIN STUFF
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'script_name');
require_once('./global.php');

// GENERIC_SHELL VARS
$pagetitle = "Title of Page";
$HTML = ""; // PIECED TOGETHER IN SCRIPT

eval('$HTML = "' . fetch_template('name of template') . '";');

eval('print_output("' . fetch_template('GENERIC_SHELL') . '");');

?>
Reply With Quote
  #2  
Old 04-12-2004, 08:08 PM
fonzerelli_79's Avatar
fonzerelli_79 fonzerelli_79 is offline
 
Join Date: Nov 2001
Posts: 259
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks jake

for some reason the $navbar variable wont work - is there something i have to include in the php code to be able to include the navbar template
Reply With Quote
  #3  
Old 04-12-2004, 11:34 PM
Jakeman's Avatar
Jakeman Jakeman is offline
 
Join Date: Nov 2001
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try adding this code before the last eval line:

PHP Code:
eval('$navbar = "' fetch_template('navbar') . '";'); 
This will at least call the template. I'm not sure how the nav location will be reported since it's an external script.
Reply With Quote
  #4  
Old 04-12-2004, 11:38 PM
fonzerelli_79's Avatar
fonzerelli_79 fonzerelli_79 is offline
 
Join Date: Nov 2001
Posts: 259
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeah that worked - thanks
Reply With Quote
  #5  
Old 04-13-2004, 12:40 AM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jakeman
Try adding this code before the last eval line:

PHP Code:
eval('$navbar = "' fetch_template('navbar') . '";'); 
This will at least call the template. I'm not sure how the nav location will be reported since it's an external script.
PHP Code:
$navbits = array("" => "The Foo Page"); 
Reply With Quote
  #6  
Old 04-19-2004, 02:27 AM
blairwarlock's Avatar
blairwarlock blairwarlock is offline
 
Join Date: Nov 2003
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by filburt1
PHP Code:
$navbits = array("" => "The Foo Page"); 
When inserting this variable, I get a nested link with the main home page at the top. However, the open folder icon below it shows no text next to it. Shouldn't it read "The Foo Page" (or whatever text you use)?
Reply With Quote
  #7  
Old 04-22-2004, 05:02 AM
lazserus's Avatar
lazserus lazserus is offline
 
Join Date: Mar 2004
Location: Planet Earth
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please pardon my ignorance, but what I'm getting from this is that this creates the option to stick any current (or custom) template into an entirely new page with a vBulletin theme. This is all well and good (from my retarded little standpoint), but I'm not too keen on custom making a template w/o guidance. My webmaster and myself are testing this hack and the setup is simple enough but we're having problems adding content. :ermm: It's just that we don't quite understand vB3 yet. Any guidence?
Reply With Quote
  #8  
Old 04-22-2004, 09:07 AM
fonzerelli_79's Avatar
fonzerelli_79 fonzerelli_79 is offline
 
Join Date: Nov 2001
Posts: 259
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by blairwarlock
When inserting this variable, I get a nested link with the main home page at the top. However, the open folder icon below it shows no text next to it. Shouldn't it read "The Foo Page" (or whatever text you use)?
use this instead

PHP Code:
$navbits[lastelement] = "The Foo Page"
Reply With Quote
  #9  
Old 05-01-2004, 09:58 AM
hollyboy's Avatar
hollyboy hollyboy is offline
 
Join Date: Mar 2004
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://www.interfans.org/forum/rules.php" target="_blank">http://www.interfans.org/forum/rules.php</a>

I get this error:
Warning: chdir(): No such file or directory (errno 2) in /home/interfan/public_html/forum/rules.php on line 4

And what do I have to add in the new template?
Reply With Quote
  #10  
Old 05-01-2004, 01:41 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hollyboy
http://www.interfans.org/forum/rules.php

I get this error:
Warning: chdir(): No such file or directory (errno 2) in /home/interfan/public_html/forum/rules.php on line 4


And what do I have to add in the new template?
Try this:

PHP Code:
$navbits = array();
$navbits[$parent] = 'Forum Rules';

$navbits construct_navbits($navbits);
eval(
'$navbar = "' fetch_template('navbar') . '";'); 
Chnage Forum Rules to what you want the navtitle to say.
Reply With Quote
Reply


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:45 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04054 seconds
  • Memory Usage 2,265KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (6)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete