pnCPG ignoring coppermine database name pnCPG ignoring coppermine database name
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

pnCPG ignoring coppermine database name

Started by jiberjaber, May 15, 2005, 01:02:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jiberjaber

OK, finally installed post-nuke but I am still having a few problems.

I am running Coppermine 1.3.1 standalone (working fine) in a directory off the root ("/cm")
I am running Post-Nuke 7.50 GOLD in a directory off the root ("/pn") (this is installed by my provider in Fantastico).

Other information (which may not be needed):
     Apache version    1.3.33 (Unix)   
     MySQL version    4.0.22-standard   
     PHP version    4.3.9   
     PERL version    5.8.4   
     Operating system    Linux   
     Kernel version    2.4.21-27.0.4.EL   

I have followed the readme upto step 6.

I have installed the whole pnCPG into "/pn/modules" off the root directory and init and activated the module..

I have configured using the pnCPG adminitrative icon as follows shown in the attachment.

When I then try to add a block (either image scoller or random) it insists on trying to find the coppermine users in the post nuke database even though the coppermine users data base is set in the configuration correctly.  Unfortunatly once it has done this I can not access the admin config for pnCPG any more and have found that the only way to reset is to wipe and re-install the post nuke installation.


Can someone help me?

casNuy

If you installed Coppermnine 1.31 (why not 1.33?), the prefix for your tables looks wrong to me.
Aswell in the config as the block config, you have cpg11d as prefix, please adjust to whatever you used when installing Coppermine and you problem will melt like snow in the sun.

cas

jiberjaber

1.31 was teh last update I carried out, the site has been running for over a year now and I never figured out how to move all the entries over to the new tables.

If I were to use the [original] 1.31 table prefix there wouldnt be any pictures to see :)

Of course what might help is if I posted the bit that looks very wrong to me, which I forgot to do!...

Anyway, the problem is that when I try and place a block, I get an error saying

Query0 failed : Table 'jcburns_pnke1.cpg11d_users' doesn't exist

Basically it is trying to find the coppermine database tables in the postnuke database!.  I am reluctant to replicate it as I am fed up of re-installing the nuke side of things as it totaly kills everything!..

Config details for the box are as detailed in the attachment to this post.

Thanks in advance :)



.....scratch that... I have installed the cpg again and you should be able to see the error at www.jiberjaber.org.uk/pn  it should be the box on the right hand side.





casNuy

What is the prefix, is it truly 'cpg11d' ?
Still think that is the problem.
Otherwise send me an admin account and i will check it next week.

Cas

jiberjaber

I still am not convinced that the problem is the table name (cgp11d) as the error is that it is looking for the coppermine tables in the post-nuke database rather than the specified coppermine database.

Although I am not convinced it will solve the problem, I think I will have a go at upgrading the coppermine installation tonight and also see if I can rationalise all the database information into one set of tables relating to the latest installed version of coppermine.

On a side note, when you say an admin account, which admin account are you refering to? Coppermine, post-nuke or my cpanel ?

casNuy

It looks you have 3 installations on your database so now it will depend on the rest of your config.
I would need admin accounts for all 3 in your case.

cas

Photo-nut

Quote from: jiberjaber on May 15, 2005, 09:31:34 PM

Anyway, the problem is that when I try and place a block, I get an error saying

Query0 failed : Table 'jcburns_pnke1.cpg11d_users' doesn't exist

Basically it is trying to find the coppermine database tables in the postnuke database!.... 


I am running into exactly the same problem - I cannot get the module and/or the block to stop trying to access a database that is not related. I finally got the "cpg_users" part to stop asking for "11d", but can't change the table name to what it should be.

Any solution to this out there?

Thanks in advance if you know how to solve this pesky problem...

Photo-nut

OK, I solved this problem, but the solution requires a bit of PHP hacking. If you are new to scripting, don't get too freaked. If you follow the set of steps below you should get to a working random picture block.

The underlying problem, as noted by the first person who started this thread and myself later is that the database that is currently open when this script is working is not the coppermine db, but the postnuke db. I think the author of the script set it up to connect user accounts of PN and Coppermine, so the first db needed to be open. The problem lies in that the Coppermine db is not opened and so the queries to get the pics can't access the Coppermine db. I want a simple random pic to appear in my postnuke site taken from a coppermine photo gallery.  So I have to add to his/her script the two lines of code to open the Coppermine database.

1. OK, let's get started. First go to your mysql area for your hosting control panel  Hopefully you are using Cpanel because this is what I am basing this step on. Add a new user to mysql. Add this new user to your coppermine database (which is named _____copp1 - fill in the blank from what you see in Cpanel). Write down the full coppermine database name, full username and pw.

2. Open the file  /modules/pnCPG/pnblocks/pncpg-random.php  - ftp a copy from your web site.

Add in the following lines, noted in red around the other code, which starts about line 95 +/- of the script. replace stuff noted between "{...}" with your information, removing the "{  } " brackets as well.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

if (!cur_logged) {
   $view_list="0" ;
} else {

$db_new=mysql_connect("localhost", {full username you just created}, {password you just created}) or mysql_error();
mysql_select_db("full name of your coppermine database",$db_new) ;

   $view_list="0" ;
   $query0= "select user_group,user_id from $cpgprf"._users." where user_name= '$cur_usr'";
   $result0 = mysql_query($query0) or die("Query0 stupid failed : " . mysql_error());
   $num_rows = mysql_num_rows($result0);

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

3. Save the file, ftp it up to your server, replacing the original on your server.

4. Now the block should work. Edit the options noted by the original author of this block normally.

I hope this helps others....


casNuy

pnCPG does indeed expect the PostNuke DB user to have also access to the Coppermine database.
Other option is to install the coppermine tables into the PN database.
Cas

Photo-nut

Quote from: casNuy on July 07, 2005, 10:59:45 PM
pnCPG does indeed expect the PostNuke DB user to have also access to the Coppermine database.
Other option is to install the coppermine tables into the PN database.
Cas

Thanks for following up on this. I haven't done an install of one db's tables to another db. Would you post a quick set of instructions here?

Cheers,

Paul

casNuy

Paul,
i will try to update the installation instructions,hopefully that will do the trick.

Cas

TomG

#11
Hi,
I'm trying to get the scroller block working with pncpg3.2, coppermine 1.4.3 and pn 0.7.6.1, and I have the exact same problem, with an external coppermine database. I never had this problem with pnCPG 2.7. I haven't yet tried the hack described above, but surely this should not be necessary, when it used to work before?

EDIT: carried out the above modificaitons, and now it works! But this should work/be configurable 'out of the box'...

Tom
www.lightpainter.co.uk
www.edinburghphotographicsociety.co.uk

casNuy

I would strongly advice against hardcoding user/password in the scripts.

I canl add this again to the module. It was part of the previous releases but never used heavily. It is actually only needed if the Coppermie DB resiedes on another server !!
But for this case there is a much easier solution, just grant the PostNuke DB-user access to your coppermine installation and all is ok.

The Coppermine tables do not need to be within the Postnuke database.

Let me know if this is clear now.

Cas

TomG

Hi Cas,

I too would prefer not to hardcode this information in scripts.

My Coppermine DB is on the same server as my postnuke one, and I had the name of the CPG DB filled in the pn CPG admin, but as the first poster said, it is not using this information. It is still looking for the pnCPG user table in the postnuke db and not the specified CPG db. The error I got was:

Query0 failed : Table 'epspn.cpg132_users' doesn't exist

Where cpg132_users is the user table in the CPG db (epscpg2), so it should actually be looking for epscpg2.cpg132_users. (After upgrading from 1.3.2. I have not changed the database table names)

You say I should "just grant the PostNuke DB-user access to your coppermine installation"- I thought that's what I had done by telling it to use that database? Or should I be doing something else?

Here are my pnCPG settings:
http://www.edinburghphotographicsociety.co.uk/pnCPG screenshot.JPG

Thanks for your help

Tom
www.lightpainter.co.uk
www.edinburghphotographicsociety.co.uk

casNuy

I suspect that you used a different Database user when installing Coppermine opposite installing Postnuke. If you remember when you install an application you are asked for a database user/password.
You should grant the user you used when installing Postnuke full rights onto the Coppermine database (see link mentioned below).
In the next version  (4.0) I will add the option to use different databases with different user/passwords.
If all fails on your end, you can have the beta version of this release since it is working on Coppermine 1.4.3 but not yet on cpgNG (which will be the future release of Coppermine).

cas

Link:
http://dev.mysql.com/doc/refman/5.1/en/adding-users.html

TomG

Hi Cas,

My problem is that Plesk won't let me add a user for the CPG database that is an existing user for any of the other databases. So I can't add the PN database user details as a user for CPG too. So if you could send me the beta that would be great! you can send to tomATlightpainterDOTcoDOTuk.

Thanks,

Tom
www.lightpainter.co.uk
www.edinburghphotographicsociety.co.uk

casNuy

Tom,
mail is on its way.
Hope it solves your problems.
cas

TomG

Hi Cas,

Sorry it's taken so long to test this new version. The version you sent me does sort the problem without having to hard code login details into the script. Thanks.
The incentive to make the move came when I installed the pnPHPBB module into my PN site and for some inexplicable reason the hard-coded login workaround for the scroller stopped working. Nothing had changed in the code, but it was having no effect- I just got the original "Query0 failed : Table 'epspn.cpg132_users' doesn't exist" error. Bizzare.

It seems to have some other issues with pnPHPBB- if I include the scroller in the pnPHPBB module in Xanthia, it goes in and works, but has this error displayed above the scroller block:
"Warning: mysql_connect(): Access denied for user: 'apache@localhost' (Using password: NO) in /home/httpd/vhosts/edinburghphotographicsociety.co.uk/httpdocs/CMS/modules/pnCPG/pnblocks/scroller.php on line 193"

I'm not too bothered, I don't particularly want the scroller in the BB module anyway. I'll update this if I find the same problem in other modules.

Tom
www.lightpainter.co.uk
www.edinburghphotographicsociety.co.uk