coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: micropalla on February 06, 2013, 10:39:42 PM

Title: Chenge user that posted one image
Post by: micropalla on February 06, 2013, 10:39:42 PM
Hello.
Do you know if there is a way to change the user that poste one image?
I've added lor og images of a friend of mine but now I think that I would like to make like if he was the user that uploaded them...

Many thanks!
Title: Re: Chenge user that posted one image
Post by: micropalla on February 06, 2013, 10:53:19 PM
What about an SQL like this:

UPDATE `cpg15x_pictures` SET `owner_id` = '1' WHERE `filepath ` = 'userpics/10002/';
Title: Re: Chenge user that posted one image
Post by: Jeff Bailey on February 06, 2013, 11:15:47 PM
if you phpmyadmin you can update it there without having to run an actual query.
Title: Re: Chenge user that posted one image
Post by: micropalla on February 06, 2013, 11:16:29 PM
500 images? :-\
Title: Re: Chenge user that posted one image
Post by: Jeff Bailey on February 07, 2013, 01:06:45 AM
Sorry your original post made it seem like you only wanted to change one image. A query would be much better for multiple images.
Your query should work but you'll have to move all the files otherwise personal albums will probably break. Try this plugin http://forum.coppermine-gallery.net/index.php/topic,67661.msg357718.html#msg357718
Title: Re: Chenge user that posted one image
Post by: micropalla on February 07, 2013, 08:43:29 AM
You are right.

So let me see if i'm doing well.

1) Move all images from album 10006 to album 10001
2) Apply the SQL query UPDATE `cpg15x_pictures` SET `owner_id` = '1' WHERE `filepath ` = 'userpics/10001/';

Is it right?
Title: Re: Chenge user that posted one image
Post by: ΑndrĂ© on February 07, 2013, 10:09:54 AM
I never tested or thought through what happens if you change the owner_id of pictures in the personal category. I assume it will work without any issues if you just update the owner_id (i.e. without moving the pictures or any further steps), as Coppermine usually doesn't care where the files are stored on file system level. I suggest to test this on a copy of your gallery before you apply it to your live gallery.
Title: Re: Chenge user that posted one image
Post by: Jeff Bailey on February 07, 2013, 09:29:46 PM
I changed the owner id of one of my test photos and it remained in the other users gallery but the file info said my un so I think they do need to be moved.
Title: Re: Chenge user that posted one image
Post by: phill104 on February 07, 2013, 09:41:20 PM
I've done this a lot in the past when bridging an already populated gallery to an already populated forum. Changing the user ID via a query each time caused lots of problems simply becuase of human error introducing mistakes but I did have on both occasions over 100 users to work through. In your case it would be easier. However, here is what I would do. If all the images are in albums of their own then it is really simple. Use the download complete album as a zip plugin and then re-upload them logged on as the user. Sounds a little complicated but if you are not keen to manipulate the DB like many users it is an easy method and really doesn't take too long.

@Dev Team - Maybe we should add the option in the batch add interface to "Add as User xxx" so admins can add large numbers of files for their users.