Move user albums to public category Move user albums to public category
 

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

Move user albums to public category

Started by Αndré, September 05, 2008, 01:16:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Αndré

Because so many people ask how they can move user albums to public categories, I made a little plugin.

Just install it like every other plugin. A new button will appear in the admin menu.

Version 1.0 (2008-11-28):
- [new] plugin
- list all user albums (for admins only)
- move the selected album to the latest category (with the highest 'cid')
- [new] choose if the user can edit his files after moving or not
-> after moving to public, you can move it to a category you want, as you can do it with every other public album

Version 1.1.0 (2008-12-11):
- [bugfix] new owner name will be applied
- [improvement] choose where to move the selected album
- [improvement] choose which user will be the new owner of the moved files (or just leave the current user as owner)
- [new] move more than 1 album at a time
- [new] status page which lists the moving status and some links, relating to the moved album

Version 1.1.1 (2009-02-23):
- [improvement] show name of parent category in category list



Αndré

#1
I forgot to mention, that the script is hardcoded in german yet (only 2 status lines).

Update: outputs are now in english.

ib2loud

You're a life saver! I just realized I couldn't move a user gallery to public and found this and it worked great. Thank you so much.

morli

Hi,
thank you for your work, but i think it is a problem, that users cant edit their albums when they have been moved  :(
is there a way to solve this problem ?


Αndré

Open move_to_public.php and add after:
  cpg_db_query("UPDATE {$CONFIG['TABLE_ALBUMS']} SET category = (SELECT cid FROM {$CONFIG['TABLE_CATEGORIES']} ORDER BY cid DESC LIMIT 1) WHERE aid = {$_GET['move']} AND category > 10000");
(should be line 10 if you have nothing modified)
  cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET owner_id = 1 WHERE aid = {$_GET['move']}");

This will only work, if you have a user with user-id 1 (this is the admin in most cases). Change the user-id if you want to assign the pictures to another user(-id). Make sure, that this user exist. Otherwise the uploader can edit their albums further on.

Αndré

I improved my script and made a plugin out of it. Check first post for the link to the new file.
Maybe I will work on it in the next time, to choose the category where the album should be moved to.

morli

hi ee...
thank you !!!  ;D   I'll try that

morli

hi,



user cannot edit their albums and not sort their fotos, is there an option to solve this problem ?

Αndré

No this isn't possible with my plugin. Maybe some modifications in the files modifyalb.php and picmgr.php can make it possible for users to keep control over their files.

Αndré

I've just released a new version of my plugin. There are some new features and improvements (you can now choose, where to move the album and whom you want to give the ownership of the new files).

Check my first post for the new plugin file.

Update is easy: just replace the old data with the new one.

jmnetje

Hi There, would it be possible to see the entire catagory path. Because I have a lot of catagories and some off them are returning names in differend categories so I Only can see 'Lezingen' but I can't see if this is the catagory under the catagory 2008 or category 'Lezingen' under category 2007.

Αndré

I just uploaded version 1.1.1 - it's a simple change which shows the name of the parent category (just one level higher, not the whole category path).
I hope this is what you wanted. If not. let me know :)

jmnetje

Yes!!!! This wil make the choice for moving an album a lot easyer.
Did you also think about the same tool but then from public to user gallery. Because I also use this but i can only fix this with phpmyadmin into the database. That would also be a great plugin.
Based on this. (see Below)

To move an album from a public category into the user galleries, first open the db _users table, to find the user you want to own the album.  Note down their id (the original admin will be 1).

Now open your _albums table in your db.  Browse to the row for the album you want to move and click edit.  Now change the cat from its current setting to user id number +10000 (so for admin it will be 10001).

save the settings, and away you go.

To move an album from the user galleries to a public category, simply change the setting from its 10000+ number, to the cat id number.

Αndré

Quote from: jmnetje on February 24, 2009, 09:34:50 AM
Did you also think about the same tool but then from public to user gallery.
No, because I don't need this myself :P

But this would be a quite simple hack/plugin. I would add a button "move to personal gallery" next to each album (near "DELETE", "PROPERTIES", "EDIT FILES").

Because I don't have much time atm and this plugin is beyond my demand, I won't code it for free. Sorry.
If you still want me to code it, please start a new thread. Thank you.

jmnetje

However thanks for the update to version 1.1.1. The otherway version I have to write it by myself I think.  :'( that wil be a challenge for me.