coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: fareforce on August 20, 2006, 05:43:25 AM

Title: Custom Header Problem
Post by: fareforce on August 20, 2006, 05:43:25 AM
Coppermine Version: 1.4.8
Website: http://www.alaskastudio.com (http://www.alaskastudio.com)
Coppermine Installation: http://www.alaskastudio.com/gallery (http://www.alaskastudio.com/gallery)
Coppermine is bridged with SFM


Okay now that I have that out of the way I am trying to include a php file (leftnav.php) for a left menu through the admin control panel. The problem is that the left menu php file accesses a different database on my server then coppermine uses.

My aurora meter uses alaskastudio_com_aurora
Coppermine uses alaskastudio_com_photo

Because of this I get the error:
Database Error: Table 'alaskastudio_com_aurora.smf_sessions' doesn't exist

The error is true, but I can't figure out why it is not switching databases. Unfortunatly, I dont want to move the database for the aurora program to the Coppermine one as it is really big. I am trying to keep it running smoothly, and as quick as possable. Any sugesstions?
Title: Re: Custom Header Problem
Post by: Sami on August 20, 2006, 07:01:15 AM
Rename leftnav.php to leftnav.txt and attach it to this thread using Additional Options, to check the connection string
Title: Re: Custom Header Problem
Post by: fareforce on August 20, 2006, 09:30:08 AM
leftnav.php is actually composed of two files.

leftnav.php (which builds the left navigation layout, and aurora.php (the actual aurora program that accesses the database).

I have only included aurora.php (aurora.txt) as that should be the only one in question. I also added some notes so you can see what is going on easier. If for some reason you need the other one, please let me know.

Thank you so much in advance for your help.

Title: Re: Custom Header Problem
Post by: Sami on August 20, 2006, 12:37:21 PM
okey you have variable conflict problem , bridge file for smf use the $db_name for smf database name :)
try to rename your $db_name under aurora to something else something like $ar_db_name
Title: Re: Custom Header Problem
Post by: Nibbler on August 20, 2006, 12:55:59 PM
Are you using the same database username for coppermine or smf and aurora?
Title: Re: Custom Header Problem
Post by: fareforce on August 20, 2006, 07:39:46 PM
Quote from: bmossavari on August 20, 2006, 12:37:21 PM
okey you have variable conflict problem , bridge file for smf use the $db_name for smf database name :)
try to rename your $db_name under aurora to something else something like $ar_db_name

I will try that.
Title: Re: Custom Header Problem
Post by: fareforce on August 20, 2006, 07:40:10 PM
Quote from: Nibbler on August 20, 2006, 12:55:59 PM
Are you using the same database username for coppermine or smf and aurora?
Yes - I also kust noticed that I left the username/password in the file. The file has been changed to erase them, and they have been changed.
Title: Re: Custom Header Problem
Post by: Nibbler on August 20, 2006, 07:50:48 PM
You'll need to either use different mysql users or add code to keep the database connections seperate.
Title: Re: Custom Header Problem
Post by: fareforce on August 20, 2006, 07:56:05 PM
Quote from: bmossavari on August 20, 2006, 12:37:21 PM
okey you have variable conflict problem , bridge file for smf use the $db_name for smf database name :)
try to rename your $db_name under aurora to something else something like $ar_db_name

Now I get:
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 35 bytes) in /home/virtual/site3/fst/var/www/html/gallery/include/debugger.inc.php on line 112
Database Error: Table 'alaskastudio_com_aurora.smf_sessions' doesn't exist
File: /home/virtual/site3/fst/var/www/html/board/Sources/Load.php
Line: 1193
Warning: Unknown(): A session is active. You cannot change the session module's ini settings at this time. in Unknown on line 0

Title: Re: Custom Header Problem
Post by: Joachim Müller on August 20, 2006, 09:38:52 PM
Fatal error: Allowed memory size of X bytes exhausted  (http://forum.coppermine-gallery.net/index.php?topic=24088.msg110690#msg110690)
Title: Re: Custom Header Problem
Post by: Sami on August 20, 2006, 09:44:06 PM
@fareforce:
you didn't replace (change) all $db_name on the aurora meter files
Title: Re: Custom Header Problem
Post by: fareforce on August 20, 2006, 10:13:26 PM
Quote from: bmossavari on August 20, 2006, 09:44:06 PM
@fareforce:
you didn't replace (change) all $db_name on the aurora meter files

I did, I just forgot to upload the new file.. here it is..
Title: Re: Custom Header Problem
Post by: fareforce on August 20, 2006, 10:15:45 PM
Quote from: Nibbler on August 20, 2006, 07:50:48 PM
You'll need to either use different mysql users or add code to keep the database connections seperate.

add code to CPG or to aurora? Also, what code.. I thought re-establishing the connection would work. In aurora I terminate the connection very quickly to save on bandwidth.
Title: Re: Custom Header Problem
Post by: Nibbler on August 20, 2006, 10:49:47 PM
Yeah, but you are not actually re-establishing the connection. If you connect again to the same server with the same user then it will just re-use the connection you already had. Your code will then switch to the aurora database and confuse SMF when it cleans up your session. I can't come up with the code to fix it off the top of my head, you'll need to either switch users or code it yourself. Maybe disabling db sessions in SMF will help.
Title: Re: Custom Header Problem
Post by: fareforce on August 21, 2006, 02:38:48 AM
Quote from: Nibbler on August 20, 2006, 10:49:47 PM
Yeah, but you are not actually re-establishing the connection. If you connect again to the same server with the same user then it will just re-use the connection you already had. Your code will then switch to the aurora database and confuse SMF when it cleans up your session. I can't come up with the code to fix it off the top of my head, you'll need to either switch users or code it yourself. Maybe disabling db sessions in SMF will help.

I will try it with a different sql login. Now I just have to remeber my root login.. LOL
Title: Re: Custom Header Problem
Post by: fareforce on August 21, 2006, 05:25:11 PM
Well, as you said it works fine with 2 seperate logins. Now I just have to figure out why the program is blowing apart the template in cpg. It work fine everywhere else.