Advanced search  

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

Pages: [1]   Go Down

Author Topic: Changing the ownership after batch upload  (Read 3993 times)

0 Members and 1 Guest are viewing this topic.

tom123

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Changing the ownership after batch upload
« on: November 28, 2006, 12:10:02 pm »

I have tried finding information on this issue, but all I came across is posts about not being able to upload. I am able to upload via the batch process just fine. I would, however, like to change the ownership/control of images (uploaded via a batch upload) back to the original owner instead of the admin. How can I do turn control back to the user just as if they uploaded the images themselves?
« Last Edit: November 29, 2006, 09:54:56 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Changing the ownership after batch upload
« Reply #1 on: November 28, 2006, 04:51:41 pm »

You can't change ownership in Coppermine, there's no control built into the Coppermine user interface. You'll have to manually edit your database table "yourPrefix_pictures", using a tool like phpMyAdmin.
Logged

tom123

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: Changing the ownership after batch upload
« Reply #2 on: November 28, 2006, 07:30:11 pm »

I was hoping there would be something in admin to do this, nonetheless I would like to change it. Since I don't know much about php, could someone please tell me what I would have to change in the table yourPrefix_pictures to give control of the batch uploaded images back to the user? I searched the forum for information on this table but nothing other than this post and something about a language change showed up.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Changing the ownership after batch upload
« Reply #3 on: November 29, 2006, 12:19:39 am »

owner_id and owner_name. Should be pretty self-explanatory. No PHP skills needed. Backup before you try, or don't try at all.
Logged

lamama

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 404
Re: Changing the ownership after batch upload
« Reply #4 on: November 29, 2006, 12:46:41 am »

You'll need some experience with phpMyAdmin and MySQL databases.

phpMyadmin (or a simliar tool) should been available on your webserver or your webhost's admin interface.

Find it, start it and get familiar with it.

As GauGau said: The database table is something like
cpgXXX_pictures  (the prefix may be different, '_pictures' is the important part)

Let phpMyAdmin display you that table. There is a button "Browse" above the datafield definitions. Click it and browse the database a bit.

Throw a look on the table columns "owner_id" and "owner_name".
You'll have to update both.

You'll need something like this - modify it to your needs and put in the SQL quiery window of your database:

Code: [Select]
UPDATE `cpgXXX_pictures`
SET `owner_name`='YOUR-NAME-HERE', owner_id=2
WHERE `owner_id`=3;

Result: all pics of owner #3 will become pics of owner #2 and the owner name is set too (change the name to the real CPG login name of owner #2)

More info about the SQL Syntax: http://dev.mysql.com/doc/refman/5.0/en/update.html

WARNING: if you're not careful you can destroy your database.
a) Backup your database before changing anything (and be sure you're able to restore it)
b) if you're the "no risk no fun" type of guy, just go on - you have been warned.  :)

Logged

tom123

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: Changing the ownership after batch upload
« Reply #5 on: November 29, 2006, 08:59:18 am »

Thank you. That is the type of information I was looking for in changing it. I will definitely make sure to back up the database before I attempt anything as I am updating to the latest version as well.
Logged

Sy

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Changing the ownership after batch upload
« Reply #6 on: April 12, 2007, 08:49:03 pm »

Sorry for bumping an old post, and for something that people have probably already figured out themselves.

But as I've just resolved this issue myself I thought I'd tack my reply on.

If your ftp uploading for other users into their own directory, so for example your uploading for a user called Fred into '/gallery/albums/fred/', you cal use the following SQL query to change the owner of all the items uploaded to that directory.

Code: [Select]
UPDATE `cpg148_pictures`
SET `owner_name`='Fred', owner_id=2
WHERE `filepath`='fred/';

Obviously you will need to change the owner_name, owner_id and filepath to suit your needs but it made the job a lot quicker for me.

Hope this helps some other CPG n00bs like myself.

Sy
Logged

MatthewSchenker

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 38
Re: Changing the ownership after batch upload
« Reply #7 on: June 30, 2007, 03:28:29 pm »

GauGau, lamama, and Sy,
Thank you for this!  I was also looking for a way to re-assign ownership of photos, but I'm not that good with mysql databases.  This discussion got me on the right track!

This is a great function to know about.

Thanks again!
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 15 queries.