Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-02-2008, 01:47 PM
NickyDee NickyDee is offline
 
Join Date: Aug 2008
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Chdir/$vbulletin->options['homeurl'] trouble.

Im trying to make a frontpage for my website that uses elements like the navbar, header, headerinclude and footer. The file layout is

/index.php
-- /forum

I've got it sort of working but the problem is my navbar links are going to /root when they should be redirected to /forum/... Heres the page that I'm talking about: http://www.study-medicine.co.uk/index.php

I'm using this code in my php to change directory:

Code:
$cwd = getcwd();
chdir('/kunden/homepages/44/d254237426/htdocs/forum'); 
require_once('global.php');
chdir($cwd);
And I've put the code below in front of the relative links for the FAQ to test it:

Code:
$vbulletin->options['homeurl']
But when it generates the page I get the link "http://www.study-medicine.co.uk/Array['homeurl']/faq.php"

So its not converting that homeurl into the homeurl. Its probably quite apparent my knowledge of php is on the slim side, really struggling to see what the next step is here.

Thanks for your help, much appreciated. Been working on this for the last 12 hours solid.

--------------- Added [DATE]1220367731[/DATE] at [TIME]1220367731[/TIME] ---------------

I notice the page is also showing the "Loaded but with errors" icon in the bottom left of IE7.
Reply With Quote
  #2  
Old 09-02-2008, 02:15 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does your script require you the chdir() back to the original directory? If not try leaving the script with the forumhome as current directory.
Reply With Quote
  #3  
Old 09-02-2008, 02:19 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have a similar setup - an index.php page and then a forum directory. Unfortunatley, my way of dealing with this was to modify the navbar and add "$vboptions[bburl]/" in front of every link. I also had to modify the headerinclude in a similar way. I also made a new footer template without the $cron image just to use on that index.php page. I'm sure there must be a better way, but that's how I did it way back on 3.0 and I haven't changed my basic method.
Reply With Quote
  #4  
Old 09-02-2008, 03:25 PM
NickyDee NickyDee is offline
 
Join Date: Aug 2008
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
Does your script require you the chdir() back to the original directory? If not try leaving the script with the forumhome as current directory.
Yeah, it requires it.
Reply With Quote
  #5  
Old 09-02-2008, 03:39 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Then you will need to ensure your templates use absolute URLs.
Reply With Quote
  #6  
Old 09-02-2008, 03:47 PM
NickyDee NickyDee is offline
 
Join Date: Aug 2008
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've changed them now to include the /forum/ prefix which seems to be working. Thanks for your help. Its a shame really there isn't a more inbuilt function for this as its a very common setup.
Reply With Quote
  #7  
Old 09-03-2008, 06:25 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can just add a base element to the top of headinclude, no need to do all that link editing.
HTML Code:
<base href="http://www.yoursite.com/forum/" />
Reply With Quote
Reply


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 09:42 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.10695 seconds
  • Memory Usage 2,216KB
  • Queries Executed 11 (?)
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)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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_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