Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Chenge user that posted one image  (Read 3701 times)

0 Members and 1 Guest are viewing this topic.

micropalla

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Chenge user that posted one image
« 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!
Logged

micropalla

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: Chenge user that posted one image
« Reply #1 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/';
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: Chenge user that posted one image
« Reply #2 on: February 06, 2013, 11:15:47 pm »

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

micropalla

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: Chenge user that posted one image
« Reply #3 on: February 06, 2013, 11:16:29 pm »

500 images? :-\
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: Chenge user that posted one image
« Reply #4 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
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

micropalla

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: Chenge user that posted one image
« Reply #5 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?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Chenge user that posted one image
« Reply #6 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.
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: Chenge user that posted one image
« Reply #7 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.
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4886
    • Windsurf.me
Re: Chenge user that posted one image
« Reply #8 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.
Logged
It is a mistake to think you can solve any major problems just with potatoes.
Pages: [1]   Go Up
 

Page created in 0.015 seconds with 19 queries.