vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Question about products and directories (https://vborg.vbsupport.ru/showthread.php?t=193301)

Chris11987 10-10-2008 09:07 PM

Question about products and directories
 
Since this is more of a general product question, rather than a specific one, I figured I should ask it here.

If I take a file for a product and change the code to add my forums directory, will I be able to use it outside of the vbulletin directory?

example:
Quote:

require_once('./global.php');

change to:

require_once('.forums/global.php');
Will I then be able to stick the file inside my root directory instead of my forums directory?

Dismounted 10-11-2008 04:25 AM

No, global.php uses relative includes, and the files that global.php includes will include other files relatively, and so on. It will cause errors when you call global.php like that. Instead, use the chdir() function.
PHP Code:

$cwd getcwd();
chdir('./forums/');
require_once(
'./global.php');
chdir($cwd); 


Chris11987 10-11-2008 06:13 AM

That got the page to display and everything, but the css of the style isn't showing up at all. What else do I need to do to get the style showing up properly?

Dismounted 10-11-2008 10:44 AM

Add a base element to the start of the headinclude template.
HTML Code:

<base href="http://www.yoursite.com/forum/" />

Chris11987 10-11-2008 11:00 AM

Awesome, seems to work now. Thanks a lot for the help, Dismounted.

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

I have another problem. When adding the base href tag, it seems that some members have to keep loging in multiple time or get logged out. Any idea what the solution to that is?


All times are GMT. The time now is 05:04 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.00940 seconds
  • Memory Usage 1,721KB
  • 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
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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