Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 08-12-2005, 10:05 PM
Thug Thug is offline
 
Join Date: Feb 2004
Location: Sheffield : uk
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 08-13-2005, 10:21 AM
all-the-vb's Avatar
all-the-vb all-the-vb is offline
 
Join Date: Apr 2003
Location: Norwich,Uk
Posts: 174
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #3  
Old 08-13-2005, 12:27 PM
Thug Thug is offline
 
Join Date: Feb 2004
Location: Sheffield : uk
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 08-14-2005, 05:28 PM
Thug Thug is offline
 
Join Date: Feb 2004
Location: Sheffield : uk
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone help me more
Reply With Quote
  #5  
Old 08-14-2005, 10:43 PM
AN-net's Avatar
AN-net AN-net is offline
 
Join Date: Dec 2003
Location: AnimationTalk.com
Posts: 2,367
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 08-15-2005, 08:59 AM
Thug Thug is offline
 
Join Date: Feb 2004
Location: Sheffield : uk
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 08-15-2005, 01:04 PM
AN-net's Avatar
AN-net AN-net is offline
 
Join Date: Dec 2003
Location: AnimationTalk.com
Posts: 2,367
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 08-15-2005, 10:32 PM
Thug Thug is offline
 
Join Date: Feb 2004
Location: Sheffield : uk
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #9  
Old 04-16-2006, 07:00 PM
Bryan Ex's Avatar
Bryan Ex Bryan Ex is offline
 
Join Date: Feb 2004
Location: Canada
Posts: 233
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 11-29-2007, 10:39 PM
ludachris ludachris is offline
 
Join Date: Feb 2002
Posts: 287
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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."
Reply With Quote
Reply

Thread Tools
Display Modes

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 01:27 AM.


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.04275 seconds
  • Memory Usage 2,276KB
  • 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
  • (11)bbcode_php
  • (1)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
  • (1)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