PDA

View Full Version : Cannot redeclare class db_sql_vb...


Pyro
30 Aug 2001, 08:49
Hi there,

I included several hacks on my index_homepage.php3 which is a non-vB page outside the vB directory:

Who's online on non-vB page
http://vbulletin.com/forum/showthread.php?s=&threadid=12010

Last XX Posts on non-vB page
http://vbulletin.com/forum/showthread.php?s=&threadid=12324


Total Posts on a non-vbb page
http://vbulletin.com/forum/showthread.php?s=&threadid=24226

Total Threads on a non-vbb page
http://vbulletin.com/forum/showthread.php?s=&threadid=24227


All work fine, I got all problems like "cannot include global.php3" and "cannot add more header informations" solved with the great help of this community.

Now I came to this error:

Fatal error: Cannot redeclare class db_sql_vb in ./admin/db_mysql.php3 on line 7

when I try to include the following hacks in that page:

Show Events on non-vb page
http://vbulletin.com/forum/showthread.php?s=&threadid=24939&highlight=events

Homepage Login on non-vB page
http://vbulletin.com/forum/showthread.php?s=&threadid=23524


Ok, I can roughly imagine what happened but cannot solve the problem. The hacks work fine on a single page but I cannot include them in the page where the other hacks are included. What do I have to change/delete in the last hacks to make them run properly?

As always - many thanks for your help and best regards,
Markus

merk
30 Aug 2001, 09:04
Im guessing, its simply as you include these hacks, they incude certain files, ie functions.php

or something, and as a second one trys to call it, they fail.

Have a look thru your files, and make sure global.php(3 in your case) is only called _once_.

Thats really the only file it should be calling.

Wayne Luke
30 Aug 2001, 13:52
Change all the include() statements to include_once() statements.

Pyro
03 Sep 2001, 15:28
Originally posted by wluke
Change all the include() statements to include_once() statements. Hi there,

thank you for your quick help but it didn't solve my problem. I exchanged all require() and include() to include_once() but the error still occurs:

Fatal error: Cannot redeclare class db_sql_vb in ./admin/db_mysql.php3 on line 7

I guess, it has something to do with those two hacks and with the $DB_site in it.

NUMBER OF POSTS AND THREADS on non-vB page


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




CALENDAR EVENTS on non-vB page


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




Where is the problem and what would be an easy work around for it?

Thank you!!!
Markus

badmeetsevil-
03 Sep 2001, 15:46
Change



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



to



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



That should fix it.

badmeetsevil-
03 Sep 2001, 15:48
Also, in the script, change .php3 to .php for include_once and the db class name.