Changing the uploader's name possible? Changing the uploader's name possible?
 

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

Changing the uploader's name possible?

Started by Llamaman, September 29, 2004, 06:12:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Llamaman

Ive had a search for this but I cannot find anything:

I am looking for some sort of Mod or way that I can change the uploader's name for images in my gallery. For example, say I uploaded an image for someone who is registered at the gallery, coppermine would display that the image has been uploaded by me underneath the thumbnail of the image. My question is if there is anyway to change the person that coppermine displays as uploaded an image, for example, an option when clicking on "EDIT IMAGE" or something?

Thanks.


Nibbler

Only if you edit 'owner_name' and 'owner_id' in the pics table of the datbase.

Tranz


Llamaman

Nibbler, this would be possible of course but would there be an easier way of doing it, i.e through coppermine itself?

I have done a search for this, as I explained in my first post, though I haven't found any threads that cover the same subject.

Nibbler

You could use this mod for future uploads : http://forum.coppermine-gallery.net/index.php?topic=4122.0

Might need tweaking to work with 1.3.2

Llamaman

Thanks for showing me this Nibbler.

This mod almost works in 1.3.2, but I cannot seem to do the last code edit. There is nowhere in picmgmt.inc.php where anything similar to this piece of code is present:

            // User ID is not recorded when in admin mode (ie. for batch uploads)
           $user_id = GALLERY_ADMIN_MODE ? 0 : USER_ID;
                       $username=$USER_DATA['user_name'] ;


Here is what you are meant to replace it with:

// User ID is not recorded when in admin mode (ie. for batch uploads)
           If (GALLERY_ADMIN_MODE)
               {
                $username = $upload_as;
                If (defined('UDB_INTEGRATION'))
                       {
                        $result = db_query("SELECT user_id FROM phpbb_users WHERE username = '$username'");
                       } else {
                               $result = db_query("SELECT user_id FROM {$CONFIG['TABLE_USERS']} WHERE user_name = '$username'");
                               }
                $record = mysql_fetch_array($result);
                $user_id = $record[0];
               } else {
               $user_name = $USER_DATA['user_name'];
               $user_id = $USER_DATA['user_id'];
               }


Can you suggest where this piece of code could go or where it could be edited? Thanks.

(by the way, thank you very much for the help so far. Much better quality support than the producers of 4images which i was previously using)


Nibbler

That section now reads:

    // User ID is now recorded when in admin mode (casper)
    $user_id = USER_ID;
    $username= USER_NAME;

Llamaman

Ok i have found that section and tried to make the edit, but it doesnt seem to work unfortunatly. Ive made the edits to "phpbb_users" and changed it to "ibf_members" and changed "username" to just "name" and "user_id" to just "id" (following the structure for that table in IPB)

This is what the edited section of the code looks like:

// User ID is not recorded when in admin mode (ie. for batch uploads)
           If (GALLERY_ADMIN_MODE)
               {
                $username = $upload_as;
                If (defined('UDB_INTEGRATION'))
                       {
                        $result = db_query("SELECT id FROM ibf_members WHERE name = '$username'");
                       } else {
                               $result = db_query("SELECT user_id FROM {$CONFIG['TABLE_USERS']} WHERE user_name = '$username'");
                               }
                $record = mysql_fetch_array($result);
                $user_id = $record[0];
               } else {
               $user_name = $USER_DATA['user_name'];
               $user_id = $USER_DATA['user_id'];
               }
// End of upload as user mod edit
    $query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (pid, aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip) VALUES ('', '$aid', '" . addslashes($filepath) . "', '" . addslashes($filename) . "', '$image_filesize', '$total_filesize', '{$imagesize[0]}', '{$imagesize[1]}', '" . time() . "', '$user_id', '$username','$title', '$caption', '$keywords', '$approved', '$user1', '$user2', '$user3', '$user4', '$raw_ip', '$hdr_ip',$upload_as)";
    $result = db_query($query);

    return $result;
}


Could anyone suggest an alternate way to make this compatible for cpg 1.3.1?

xt3rm

Would there be a way to make this work with batch add?  Because you would want that if there was a huge number of photos so that you could up them by ftp.  And allow the user the same access to the file as they would have normally.