vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   template driven pages (https://vborg.vbsupport.ru/showthread.php?t=63792)

Jakeman 04-12-2004 07:34 PM

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') . '");');

?>


fonzerelli_79 04-12-2004 08:08 PM

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

Jakeman 04-12-2004 11:34 PM

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.

fonzerelli_79 04-12-2004 11:38 PM

yeah that worked - thanks

filburt1 04-13-2004 12:40 AM

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"); 


blairwarlock 04-19-2004 02:27 AM

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)?

lazserus 04-22-2004 05:02 AM

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?

fonzerelli_79 04-22-2004 09:07 AM

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"

:)

hollyboy 05-01-2004 09:58 AM

<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?

Boofo 05-01-2004 01:41 PM

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.


All times are GMT. The time now is 05:53 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.01190 seconds
  • Memory Usage 1,747KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (6)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete