vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Clone GLOBAL.PHP (https://vborg.vbsupport.ru/showthread.php?t=42747)

tHE DSS 08-25-2002 10:37 PM

Clone GLOBAL.PHP
 
I would like to make a copy of vB's 'global.php' script, cut it down a little, and also do the same to the scripts called from within it.

It's for another section of a website - i'll be leaving the forums scripts 100% in-tact (apart from hacks, of course).

Mainly, i'd like to supress errors with this modified script, so that if there is a database failure/error on the forums, this other section of the site can continue, and output it's own messages.

Has anyone done anything like this without problems? Or does anyone know of any problems that might occur?

My main concern is the 'DB_Site->' name - would I be causing any problem conflicts by using a 2nd global.php?

NTLDR 08-25-2002 10:41 PM

Quote:

Originally posted by tHE DSS
My main concern is the 'DB_Site->' name - would I be causing any problem conflicts by using a 2nd global.php?
Should't cause any conflicts, this is just the string used by vB to perform queries and can probably be easily changed if you wanted to.

g-force2k2 08-25-2002 11:04 PM

DSS just don't include two files that are requiring similiar globals or it could cause some issues... makes sure that you keep them seperate ;)

g-force2k2

tHE DSS 08-25-2002 11:43 PM

If I was to change the bit in my cloned and modified scripts where the instance of the database "and all that jazz" class is created, like this, for example :

change this :

$DB_site=new DB_Sql_vb;

to this :

$DB_clone=new DB_Sql_vb;

.... then I could use the $DB_clone, without much hassle?

There be no conflicts with database connections, or anything of the sort?

NTLDR 08-26-2002 12:13 AM

Quote:

Originally posted by tHE DSS
.... then I could use the $DB_clone, without much hassle? There be no conflicts with database connections, or anything of the sort?
That seems to be the only changed thats required, so you just use $DB_clone in the files that require the clone (and the clone itself!) as oposed to using $DB_site.

**** NOTE ****

That files that are inluded within this one (if required) ie admin/functions.php would also need to be changed to use $DB_clone

tHE DSS 08-26-2002 12:18 AM

Seems pretty safe then.

Nice one.... I'll get working on it tomorrow, now my fears are cleared up.

Thanks again. ;)


All times are GMT. The time now is 03:47 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.00993 seconds
  • Memory Usage 1,720KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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