vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   add vb navbar on non vb page (https://vborg.vbsupport.ru/showthread.php?t=94181)

Thug 08-12-2005 10:05 PM

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:
PHP Code:

<?

after that add:
PHP Code:

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...
PHP Code:

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


Thug 08-13-2005 12:27 PM

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

Thug 08-14-2005 05:28 PM

anyone help me more

AN-net 08-14-2005 10:43 PM

Quote:

Originally Posted by all-the-vb
add this code in hotornot/index2.php file

find:
PHP Code:

<?

after that add:
PHP Code:

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...
PHP Code:

<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

PHP Code:

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:
PHP Code:

eval('$navbar = "' fetch_template('navbar') . '";'); 

you now have the variables $header, $headerinclude, $footer, and $navbar available to use.

Thug 08-15-2005 08:59 AM

i must be realy dumb seriously
ok i kinda get it but do i make a new file to add
PHP Code:

 chdir('/username/public_html/forumroot/');
require_once(
'./global.php'); 

or just add to index2.php


and where do i add
PHP Code:

 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.

Thug 08-15-2005 10:32 PM

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 Code:

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


All times are GMT. The time now is 01:11 PM.

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.01481 seconds
  • Memory Usage 1,765KB
  • 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
  • (11)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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