forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: mlsbv on August 31, 2005, 01:08:22 pm

Title: I can add phpadsnew, and see the banner, but
Post by: mlsbv on August 31, 2005, 01:08:22 pm
I can add phpadsnew in theme.php, and see the banner in top of my blog, but give this error:

Code: [Select]
There was an error while processing a database query


when remove my phpadsnew code in theme.php my gallery was worked very good.
Title: Re: I can add phpadsnew, and see the banner, but
Post by: Nibbler on August 31, 2005, 01:23:09 pm
It's probably changing the database connection. Enable debug mode to get the mysql error message that is caused. Posting the code would also help. You may have to add some code after the ads to re-select the coppermine database.

Code: [Select]
mysql_select_db($CONFIG['dbname'])
It may also be helpful to keep the ads in the same database as coppermine.
Title: Re: I can add phpadsnew, and see the banner, but
Post by: mlsbv on August 31, 2005, 01:29:36 pm

Code: [Select]

While executing query "SELECT count(*) FROM cpg134_albums as a WHERE category = '0'" on 0

mySQL error: Table 'adver.cpg134_albums' doesn't exist



thanks
Title: Re: I can add phpadsnew, and see the banner, but
Post by: Stramm on August 31, 2005, 01:46:14 pm
switch from local mode to eg javascript invocation and all should be good
Title: Re: I can add phpadsnew, and see the banner, but
Post by: mlsbv on August 31, 2005, 01:57:31 pm
switch from local mode to eg javascript invocation and all should be good


no, this isn't way for me. i want use bye PHP.
Title: Re: I can add phpadsnew, and see the banner, but
Post by: Joachim Müller on August 31, 2005, 06:05:32 pm
Then you'll have to be a PHP coder to accomplish this.
Title: Re: I can add phpadsnew, and see the banner, but
Post by: mlsbv on August 31, 2005, 06:49:17 pm

Code: [Select]

While executing query "SELECT count(*) FROM cpg134_albums as a WHERE category = '0'" on 0

mySQL error: Table 'adver.cpg134_albums' doesn't exist



thanks



Hi
I using as this code:

Code: [Select]
function banner() {

    if (@include(getenv('DOCUMENT_ROOT').'/ad/phpadsnew.inc.php')) {
        if (!isset($phpAds_context)) $phpAds_context = array();
        $phpAds_raw = view_raw ('', 0, '', '', '0', $phpAds_context);
$return  = $phpAds_raw['html'];
mysql_select_db($CONFIG['gallery']);


    }
return $return;
}


but, still is conflict database
Title: Re: I can add phpadsnew, and see the banner, but
Post by: mlsbv on August 31, 2005, 06:50:55 pm

Code: [Select]

While executing query "SELECT count(*) FROM cpg134_albums as a WHERE category = '0'" on 0

mySQL error: Table 'adver.cpg134_albums' doesn't exist



thanks



Hi
I using as this code:

Code: [Select]
function banner() {

    if (@include(getenv('DOCUMENT_ROOT').'/ad/phpadsnew.inc.php')) {
        if (!isset($phpAds_context)) $phpAds_context = array();
        $phpAds_raw = view_raw ('', 0, '', '', '0', $phpAds_context);
$return  = $phpAds_raw['html'];
mysql_select_db($CONFIG['gallery']);


    }
return $return;
}


but, still is conflict database
Title: Re: I can add phpadsnew, and see the banner, but
Post by: Stramm on August 31, 2005, 08:00:07 pm
this will help you
php.net/global
Title: Re: I can add phpadsnew, and see the banner, but
Post by: mlsbv on September 01, 2005, 07:28:36 am
Nibbler, please help me.
Title: Re: I can add phpadsnew, and see the banner, but
Post by: Nibbler on September 01, 2005, 12:27:21 pm
Under

Code: [Select]
function banner() {
add

Code: [Select]
global $CONFIG;
Title: Re: I can add phpadsnew, and see the banner, but
Post by: mlsbv on September 01, 2005, 01:07:22 pm
Under

Code: [Select]
function banner() {
add

Code: [Select]
global $CONFIG;

Hi, i put

Code: [Select]
global $CONFIG;
Quote

in

Code: [Select]
function banner() {but not worked
please see the my function.

Code: [Select]
mysql_select_db($CONFIG['gallery']);

is corect?
Title: Re: I can add phpadsnew, and see the banner, but
Post by: Nibbler on September 01, 2005, 01:10:53 pm
No, use the code as I posted it.

Code: [Select]
mysql_select_db($CONFIG['dbname']);
Title: Re: I can add phpadsnew, and see the banner, but
Post by: mlsbv on September 01, 2005, 01:23:06 pm
No, use the code as I posted it.

Code: [Select]
mysql_select_db($CONFIG['dbname']);

Thanks man.  ;)