vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Custom Pages Running from subfolder? (https://vborg.vbsupport.ru/showthread.php?t=178233)

John3971 05-05-2008 08:16 PM

Custom Pages Running from subfolder?
 
How can i have my custom modification php file run from another folder? i can´t get it to show anything if i have it in another subfolder in my forum root.

GameWizard 05-05-2008 09:37 PM

Inside the php file, you must point to the global.php file which should show up as ../global.php rather than ./global.php or just global.php. You must point to it seeing as how its not in the main dir.

Also, you may need to correct the chdir aswell, although that should be accurate already.

Dismounted 05-06-2008 11:55 AM

Do not use links to other folders in including global.php. Always change the directory to the folder with global.php before including it, not doing so will break the includes.

John3971 05-07-2008 01:51 PM

Quote:

Originally Posted by Dismounted (Post 1510332)
Do not use links to other folders in including global.php. Always change the directory to the folder with global.php before including it, not doing so will break the includes.

don?t understand what you mean?

Lynne 05-07-2008 03:29 PM

Quote:

Originally Posted by John3971 (Post 1511643)
don?t understand what you mean?

He means change the directory (chdir) and then include the global.php file. Like this:

Code:

chdir('/home/yoursite/public_html/forums');
require_once('./global.php');

Not like this:
Code:

require_once('../global.php');

John3971 05-07-2008 03:32 PM

ah ok will try that

John3971 05-11-2008 06:09 PM

how do i fix so i fill in the path in the vbsettings and it get it from there?

Dismounted 05-12-2008 06:27 AM

Fix what?

John3971 05-12-2008 06:43 AM

This: chdir('/home/yoursite/public_html/forums'); i don´t wanna have to edit it in the php file so how can i fix so i put the path in vboption and then it writes there.

Dismounted 05-12-2008 06:48 AM

To access vBulletin options, you need to include global.php, to include global.php, you need to set a proper directory.

John3971 05-12-2008 07:28 PM

im not good in this but is it possible to add a field in the product settings were i put the path so i don´t have to edit the php file if i changes host or have it on other host?

Dismounted 05-13-2008 07:15 AM

Please read my post again.

John3971 05-13-2008 06:09 PM

if i understand you right i must changes the path "chdir('/home/yoursite/public_html/forums');" in the php file but i want it to be ansetting were i can changes the path in the acp. and also the style doesn´t work like it should when i go to the file in the subfolder.

Lynne 05-13-2008 06:19 PM

Quote:

Originally Posted by John3971 (Post 1518551)
if i understand you right i must changes the path "chdir('/home/yoursite/public_html/forums');" in the php file but i want it to be ansetting were i can changes the path in the acp. and also the style doesn?t work like it should when i go to the file in the subfolder.

And you can't have it as a setting because in order to use settings, you must include the global.php file. And, in order to include the global.php file, you need to have the path correct. And if the path is set in a setting, which needs global.php to be called in order to use it.... round and round and round you go.

John3971 05-13-2008 08:25 PM

ok but how do i get the style to show correct? and the images?

Dismounted 05-14-2008 07:01 AM

Add <base href="http://yourdomain.com/" /> to the top of your headinclude template.

John3971 05-14-2008 11:02 AM

that worked. thanks. but why does it have to be in the top? i tested at the bottom and that didn´t work.

EDIT:

is it possible to have a plugin that automatic edit the template and add this in the top of header include? if so how?

Dismounted 05-14-2008 11:43 AM

[QUOTE=John3971;1519238]that worked. thanks. but why does it have to be in the top? i tested at the bottom and that didn´t work.
Because code is executed (not really "executed" in the programming sense, though) in the order it appears. You will find that there are Javascript links in the template.


All times are GMT. The time now is 04:54 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.01116 seconds
  • Memory Usage 1,743KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (18)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