Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 07-06-2008, 09:32 AM
testboard testboard is offline
 
Join Date: Nov 2007
Location: Hampshire, United Kingdom
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Can't make navbar links point to correct location

I'm working on a vBulletin site that is located in a folder called "forum" & I have created a test page like this:
www.domain.com/forum/test/test.php

test.php works as expected when located in the forum folder.
However, I want to make it work from the forum/test/ folder.
I have the following code:

Code:
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'test'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('user', 'timezone', 'posting', 'cprofilefield', 'cppermission');

// pre-cache templates used by all actions
$globaltemplates = array(
	'GENERIC_SHELL',
	'navbar',
);

// ######################### REQUIRE BACK-END ############################
chdir('../');
require_once('./global.php');
require_once(DIR . '/includes/functions_user.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$out = 'Test.';

// Output page:
$navbits = array(); 
$navbits[$parent] = 'Test';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

eval('$HTML = "' . fetch_template('test') . '";');
eval('print_output("' . fetch_template('GENERIC_SHELL') . '");');
The test template is:

Code:
<h3>$out</h3>
My problem is that the navbar does not display graphics correctly & attempts to link to the test folder. E.g. "UserCP" links to "http://www.domain.com/forum/test/usercp.php".

I've tried all sorts of things in the code.
I've checked against other php files & 3rd party applications but I'm now stumped as to what to try next.

Does anyone have any ideas on how I can make the navbar work correctly?
TIA for any advice / ideas?
Reply With Quote
  #2  
Old 07-06-2008, 03:24 PM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use a HTML base element (at the top of headinclude).
HTML Code:
<base href="http://www.domain.com/forum/" />
Reply With Quote
  #3  
Old 07-06-2008, 08:19 PM
testboard testboard is offline
 
Join Date: Nov 2007
Location: Hampshire, United Kingdom
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, it worked but made all the buttons in the navbar disappear!

Something in your wording made me add a full-stop:
$headinclude .= '<base href="http://www.domain.com/forum/" />';

I guess headinclude is set in global.php or userfunctions.php.

Anyway, I'm blathering - it's all working now - Thanks very much for your help yet again :-)
Reply With Quote
  #4  
Old 07-07-2008, 06:36 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just edit the template "headinclude". You need to add it to the top, because there is Javascript in there that have relative references.
Reply With Quote
  #5  
Old 07-12-2008, 12:55 PM
testboard testboard is offline
 
Join Date: Nov 2007
Location: Hampshire, United Kingdom
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, I see - thanks for that.
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 05:46 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.03835 seconds
  • Memory Usage 2,198KB
  • 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
  • (2)bbcode_code
  • (1)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete