Chenge user that posted one image Chenge user that posted one image
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Chenge user that posted one image

Started by micropalla, February 06, 2013, 10:39:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

micropalla

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!

micropalla

What about an SQL like this:

UPDATE `cpg15x_pictures` SET `owner_id` = '1' WHERE `filepath ` = 'userpics/10002/';

Jeff Bailey

if you phpmyadmin you can update it there without having to run an actual query.
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

micropalla


Jeff Bailey

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
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

micropalla

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?

ΑndrĂ©

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.

Jeff Bailey

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.
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

phill104

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.
It is a mistake to think you can solve any major problems just with potatoes.