vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   global.php issues (https://vborg.vbsupport.ru/showthread.php?t=33359)

bigmattyh 12-19-2001 03:36 PM

I'm a relatively experienced PHP-programmer, and I'm just now figuring out how the whole template system can be used on pages that are non-vB. But I've come up against a complication...

Every time I try to move a custom-made file that uses global.php out of the root vB directory, I get problems. Even after going through global.php, sessions.php, functions.php, and config.php -- which are the other required files that come along for the ride -- and changing all the relative filepaths to absolute ones, I just get a blank page.

It makes it rather difficult to add new files outside of the directory, say, in a home page. If you leave the file in the root directory and then use it as an include on another php page, you still get the same problems. Ideally, I'd like to set up a subdirectory called "modules" under the forums directory, and just include the files I need as the occasion arises.

I've searched this board for an answer to this -- what am I missing?

Admin 12-19-2001 04:11 PM

Use chdir(), like this:
PHP Code:

chdir('/home/sites/yoursite/htdocs/full/path/to/forum/');
require(
'global.php'); 

Changing the path of course to your own. :)

bigmattyh 12-19-2001 04:40 PM

You are the man, Firefly. I spent 2 hours on this problem last night, and here you solve it 30 minutes after I post.

Thanks!

TheCaver 02-06-2002 08:33 PM

I upgraded to PHP 4.1.1 and the above no longer works........

Cost me $300 to upgrade and now revert back to 4.0.6

I've looked for hours with no solution......... :(

Sucks badly........

Everytime I hit another DB with a page that has global.php in it, vB tries to update the session table. Unfortunately, it tries to update it in whatever DB im using at the moment......

WTF?

Here's the error:

Database error in vBulletin 2.2.2:

Invalid SQL: UPDATE session SET lastactivity=1013035241,location='/registry_jc.php' WHERE sessionhash='21f3a3a4a165b93cd85e8b1fdfef8922'
mysql error: Table 'jc_z06vette_com.session' doesn't exist


My forums DB is jc_forums. and I cannot figure out why the hell it's trying to access my other DB.....

JC

Admin 02-07-2002 11:49 AM

OT: Why the heck did you pay $300 to upgrade PHP?! It takes no more than 5 minutes, and 4 minutes of it is downloading the package.

Anyhow... in your script, select the forums database before requirng global.php, then select the second database (using mysql_select_db()).

Lionel 02-10-2002 02:41 PM

[QUOTE]Originally posted by FireFly
OT: Why the heck did you pay $300 to upgrade PHP?! It takes no more than 5 minutes, and 4 minutes of it is downloading the package.

TheCaver 02-20-2002 01:51 AM

Just got back from Florida, will try the above.

And yea, it was $175 to install, and $175 to remove. But they left me an install script for later :)

I don't do anything to my production server myself. Kinda like buying a new car.....I want the warranty :)

Thanks Chen,


JC


All times are GMT. The time now is 07:10 AM.

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.01212 seconds
  • Memory Usage 1,726KB
  • 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_php_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