View Full Version : add vb navbar on non vb page
how do i add my header and navbar from www.oh-twadi.com/forum
to www.oh-twadi.com/hotornot
all-the-vb
08-13-2005, 10:21 AM
add this code in hotornot/index2.php file
find:
<?
after that add:
chdir(/home/***/public_html/forum');
require_once('./global.php');
eval('$headinclude = "' . fetch_template('headinclude') . '";');
eval('$header = "' . fetch_template('header') . '";');
eval('$footer = "' . fetch_template('footer') . '";');
eval('$navbar = "' . fetch_template('navbar') . '";');
don't forget edit *** to your username in site...
Example...
<html>
<head>
<title></title>
</head>
<body>
<?php
chdir(/home/***/public_html/forum');
require_once("./global.php");
eval('$headinclude = "' . fetch_template('headinclude') . '";');
eval('$header = "' . fetch_template('header') . '";');
eval('$navbar = "' . fetch_template('navbar') . '";');
echo $headinclude;
echo $header; echo $navbar; ?>
</body>
</html>
didnt seem to work :S
i dont no weather to edit the template index file or the php index2.php file
because i put it on the template one but didnt work
AN-net
08-14-2005, 10:43 PM
add this code in hotornot/index2.php file
find:
<?
after that add:
chdir(/home/***/public_html/forum');
require_once('./global.php');
eval('$headinclude = "' . fetch_template('headinclude') . '";');
eval('$header = "' . fetch_template('header') . '";');
eval('$footer = "' . fetch_template('footer') . '";');
eval('$navbar = "' . fetch_template('navbar') . '";');
don't forget edit *** to your username in site...
Example...
<html>
<head>
<title></title>
</head>
<body>
<?php
chdir(/home/***/public_html/forum');
require_once("./global.php");
eval('$headinclude = "' . fetch_template('headinclude') . '";');
eval('$header = "' . fetch_template('header') . '";');
eval('$navbar = "' . fetch_template('navbar') . '";');
echo $headinclude;
echo $header; echo $navbar; ?>
</body>
</html>
close
but it should be:
add this to your hotornot file, preferably at the top of the file after <?PHP
chdir('/username/public_html/forumroot/');
require_once('./global.php');
remeber to replace username with the login name you use to access your hosting cpanel and replace forumroot with the directory your forum is in.
then where you echo/print each page, place this before it:
eval('$navbar = "' . fetch_template('navbar') . '";');
you now have the variables $header, $headerinclude, $footer, and $navbar available to use.
i must be realy dumb seriously
ok i kinda get it but do i make a new file to add
chdir('/username/public_html/forumroot/');
require_once('./global.php');
or just add to index2.php
and where do i add
eval('$navbar = "' . fetch_template('navbar') . '";');
sorry im dumb
AN-net
08-15-2005, 01:04 PM
you add the chdir etc. to the top of index2.php after the <? or <?PHP.
the navbar thing you add where ever you print/echo a page, i.e. where you are finished compiling and now print/echo the index page of your hotornot.
i dont get the echo bit sorry mate
ok so i put the code at top of index2.php and then the 2nd code where
Bryan Ex
04-16-2006, 07:00 PM
Thanks to all-the-vb and AN-net for the info above as I'm trying to integrate another script with vB myself. I realize most have moved on to vB 3.5+ so I'm hoping that someone may still see this post perhaps point me in the right direction regardless.
I have the navbar working fine on the new script however, the navbar portion
(only) seems to be aligned to the right... tight against the browser window creating a side scroll bar and I can't figure out why. I have completely removed the script and uploaded a test file with just the header and footer in it and the problem is the same. I have also noticed alignment is fine in Firefox... it's just IE that is not rendering the navbar centered.
The test file can be viewed at http://www.asocommunity.com/forum/magic8ball/test.php?
... and the code I've used to create it is;
<?php
chdir('/path/to/forum/directory/');
require_once('./global.php');
eval('$navbar = "' . fetch_template('navbar') . '";');
print $headinclude;
print $header;
print $navbar;
chdir('/path/to/script/directory/');
?>
<p align="center">script goes here</p>
<?php
eval('$footer = "' . fetch_template('footer') . '";');
print $footer;
?>
What am I missing because I just don't get it?
EDIT: For what it's worth... I think I have the problem tracked down to a missing or misplaced <head> tag and should be able to sort it out from there.
ludachris
11-29-2007, 10:39 PM
Would these instructions apply to 3.6.8? Or has the code base changed? I'm trying to add my vB header, headinclude, navbar, and footer to some pages in another script outside the forums directory.
I tried the suggestions in the posts above with no luck. I keep getting this error:
"Unable to add cookies, header already sent."
Opserty
11-30-2007, 03:00 PM
Would these instructions apply to 3.6.8? Or has the code base changed?...
This may be better suited to your needs: How to create your own vBulletin-powered page! (uses vB templates) (https://vborg.vbsupport.ru/showthread.php?t=62164)
Except in test.php you have to find:
require_once('./global.php');
And replace it with:
$cwd = getcwd();
chdir('path/to/forum/');
require_once('./global.php');
chdir($cwd);
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.