vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Chdir/$vbulletin->options['homeurl'] trouble. (https://vborg.vbsupport.ru/showthread.php?t=189817)

NickyDee 09-02-2008 01:47 PM

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.

Marco van Herwaarden 09-02-2008 02:15 PM

Does your script require you the chdir() back to the original directory? If not try leaving the script with the forumhome as current directory.

Lynne 09-02-2008 02:19 PM

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.

NickyDee 09-02-2008 03:25 PM

Quote:

Originally Posted by Marco van Herwaarden (Post 1612807)
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.

Marco van Herwaarden 09-02-2008 03:39 PM

Then you will need to ensure your templates use absolute URLs.

NickyDee 09-02-2008 03:47 PM

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.

Dismounted 09-03-2008 06:25 AM

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


All times are GMT. The time now is 01:00 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.01769 seconds
  • Memory Usage 1,727KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete