Advanced search  

News:

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

Pages: [1]   Go Down

Author Topic: Move user albums to public category  (Read 37109 times)

0 Members and 1 Guest are viewing this topic.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Move user albums to public category
« on: September 05, 2008, 01:16:53 pm »

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


« Last Edit: February 23, 2009, 04:45:31 pm by eenemeenemuu »
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Move user albums to a public category
« Reply #1 on: September 05, 2008, 01:18:52 pm »

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

Update: outputs are now in english.
« Last Edit: September 05, 2008, 02:08:40 pm by eenemeenemuu »
Logged

ib2loud

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 77
  • I <3 CPG!
    • OKShowPics.com
Re: Move user albums to public category
« Reply #2 on: October 07, 2008, 08:56:40 pm »

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.
Logged

morli

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Move user albums to public category
« Reply #3 on: November 27, 2008, 08:40:02 pm »

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 ?

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Move user albums to public category
« Reply #4 on: November 27, 2008, 09:10:37 pm »

Open move_to_public.php and add after:
Code: [Select]
  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)
Code: [Select]
  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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Move user albums to public category
« Reply #5 on: November 28, 2008, 02:16:20 pm »

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.
Logged

morli

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Move user albums to public category
« Reply #6 on: November 28, 2008, 02:35:50 pm »

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

morli

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Move user albums to public category
« Reply #7 on: November 29, 2008, 11:48:23 am »

hi,



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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Move user albums to public category
« Reply #8 on: November 29, 2008, 01:45:11 pm »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Move user albums to public category
« Reply #9 on: December 11, 2008, 03:45:12 pm »

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.
Logged

jmnetje

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Move user albums to public category
« Reply #10 on: February 23, 2009, 02:39:24 pm »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Move user albums to public category
« Reply #11 on: February 23, 2009, 04:47:49 pm »

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 :)
Logged

jmnetje

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Move user albums to public category
« Reply #12 on: February 24, 2009, 09:34:50 am »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Move user albums to public category
« Reply #13 on: February 24, 2009, 10:04:06 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.
Logged

jmnetje

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Move user albums to public category
« Reply #14 on: February 24, 2009, 12:40:13 pm »

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.
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 22 queries.