Change owner of CPG picture from phpBB page - FAILED Change owner of CPG picture from phpBB page - FAILED
 

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

Change owner of CPG picture from phpBB page - FAILED

Started by rstober, June 14, 2005, 07:31:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rstober

Good Morning,

I have a specialized system where many of the images in the gallery are uploaded by a single account. Certain information is encoded into the title of each image, so that I can identify the user who is suppossed to own this image. For example, for a customerNumber 5010 and scanId 1186508221 the title of the image would be 5010.1186508221. This tells me that customerNumber 5010 should be the owner of this image. But remember, the file was uploaded by a different account.

So I want to change the ownership of this image when user 5010 logs in. I hacked the phpBB login.php script to try to connect to the CPG database and m,ake the change as shown below:

#
# change ownership of cpg_pictures customerID.scanId to the $row['username'] and $row['user_id'] we just got by logging in
#
define('IN_COPPERMINE', true);
require('../gallery/include/init.inc.php');
$sql = "UPDATE cpg_pictures SET owner_name = '" . $row['username'] . "', owner_id = " . $row['user_id'] . " WHERE title = '" . $cn . "." . $sn . "'";
if ( !($gallery = db_query($sql)) ) {
   message_die(GENERAL_ERROR, 'Could not update cpg_pictures table', '', __LINE__, __FILE__, $sql);
}

Yes, I also had to hack ../gallery/includes/init.inc.php (a lot) to make it work (bear in mind the code above is from /blog/login.php). And then just when I thought it was about to work, everything blew up, I got a database error, and now I can't access my gallery at all.

Here's what the Gallery looks like now: http://scrappingallery.com/gallery/

If you've looked at the above referenced page you'll see that it's indicating that CPG isn't even installed. I've put the /gallery/includes/init.inc.php file back to original state, but it didn't resolve the problem.

What would cause CPG to display such a message, to "think" that it's not installed? And what can I do fix it?

Thank you very much,

Robert

Nibbler

It will say that if the include/config.inc.php file is missing. You also posted this in the freelancers section, please make up your mind.

rstober

Nibbler,

My config.inc.php file is there, there's not much in it, but there's not much in the sample file either. Here's what it looks like:

<?php
// Coppermine configuration file

// MySQL configuration
$CONFIG['dbserver'] =                         'localhost';        // Your database server
$CONFIG['dbuser'] =                         'rstober_copp1';        // Your mysql username
$CONFIG['dbpass'] =                         '***********';                // mysql pasword obscured
$CONFIG['dbname'] =                         'rstober_copp1';        // Your mysql database name


// MySQL TABLE NAMES PREFIX
$CONFIG['TABLE_PREFIX'] =                'cpg_';
?>

Looks right, yes?

What if the DB is hosed somehow?

As far as my posting in freelancers, yes, I'd love for someone to fix this and I'll pay to have it done. But how can I be sure that someone will know how to fix it, or someone will want to fix it, ect.? Also, I need additional work done besides just fixing what I broke last night. Can you fix it? How about the additional work? Want to make a couple hundred bucks?

Thanks for your reply,

Robert