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: Create and upload / move user albums  (Read 11046 times)

0 Members and 1 Guest are viewing this topic.

orre

  • Coppermine newbie
  • Country: no
  • Offline Offline
  • Gender: Male
  • Posts: 7
Create and upload / move user albums
« on: October 28, 2011, 06:17:36 am »

Hi.

I'm in the process of immigrating from our old and kind of messy phpBB3 "Gallery v1" to the nice looking Coppermine.
I have gone the long way of downloading all gallery files to my computer (about 5 000), and sorted them into a folder structure I feel would fit a new and tidy gallery.
Now I "just" want to upload the files to a corresponding category and album structure in Coppermine.
My Coppermine is bridged with phpBB3.

The unsuspected problem I have stumbled over is in the administration of personal galleries...
This is one of the main features I like with Coppermine, and the plan is to insert a link in every phpBB-members profile to his/her personal album.
It never stroke me that I as a founder/administrator wouldn't have access to create and manage users albums?...
I have now found the Dev-Team thread where the matter was discussed, so I'm aware that this is intended.

So...
I found a tweak from "Abbas Ali" in an old thread from 2006 how to change albmgr.php and upload.php, but this seem to just partly work.
I can see my phpBB user's list in my batch upload, but upload ends with a "Empty Album" failure.

Moving albums from a public category also fail, as owner does not change, and the result is a non-visible file...

Only way I have found so far, is a really long and winding road editing both albums and files one by one directly in the database...

I have found a comment from GauGau saying
Workaround is to batch-add your files to a public album and then batch-move the pics from there to the personal album, which is pretty straightforward.

But I haven't been able to figure it out...
Thought I found a thread with a batch-move tweak, but I haven't been able to find it again...

Sorry if I have missed something obvious, besides that this isn't a feature of Coppermine...

I also found some old profile-albums from members that no longer resist in the phpBB database.
Them to should have been in the members gallery, but I don't know how to manage that?.. -They could get a public album of course, but that's not what I intended..

I actually can't really see how I could use the Coppermine gallery at all if I cant transport them old pictures to their categories?
Letting old members that is no longer active do it is obviously no object!...
I would really hate letting our Coppermine-project go and start over from scratch trying to find as nice gallery for our community!
Not at least when I already have spent tons of hours learning, searching, setting it up and growing to like it!...

All help is deeply appreciated!

Regards
/orre

Ps.
I have found the "Mass Import" plugin and was hoping to use that when I know things will work.
Ds.

Coppermine install: http://www.vtxriders.se/gallerian/
Bridging app install: http://www.vtxriders.se/forum/
Coppermine version: cpg1.5.16
Bridging app version: phpBB3
Test user account: testuser / testuser

BridgeManager settings:
Bridge app URL:  http://www.vtxriders.se/forum/
Relative path to your bridge app's config file:  ../forum/
Cookie name or prefix:  cpg15x
Use bridge app custom groups?:  1 
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Create and upload / move user albums
« Reply #1 on: October 28, 2011, 12:25:39 pm »

I'd also use the "Mass Import" plugin to import your existing folder structure to Coppermine. Depending on your folder structure it might be just some database queries to "batch" move the imported albums (created by the plugin) to the user categories and also "batch" adjust the owner_id. I guess you have a folder structure like
Quote
- user 1
-- album 1 of user 1
-- album 2 of user 1
- user 2
-- album 1 ....
Logged

orre

  • Coppermine newbie
  • Country: no
  • Offline Offline
  • Gender: Male
  • Posts: 7
Re: Create and upload / move user albums
« Reply #2 on: October 28, 2011, 01:57:39 pm »

Hi Andre!

Jupp! Sounds like this is the way to go!
I have noticed you have offered your knowledge to write such queries before in this forum, and would really appreciate sending me in the right direction!
I have zero knowledge my self in this matter. Only been experimenting with the phpMyAdmin gui...

I understand this is kind of a different question I also mentioned above, but would it be possible to insert user albums (create user?) for users that is NOT in my phpBB database?
As said before I have found some profile albums to which I haven't been able to locate owner in the database...
(The reason I have chosen to use the phpBB database, is that I thought it would be easier to administrate as our community's active club-members (paying members) change from year to year, which will regulate their community and gallery rights.
Maybe there are other thoughts about this?..)

Sincerely
/orre
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Create and upload / move user albums
« Reply #3 on: October 28, 2011, 02:47:14 pm »

would it be possible to insert user albums (create user?) for users that is NOT in my phpBB database?
I assume the only way is to create a dummy user.


Is it important that each user has to be the owner of the album and pictures (= full control over their data), or do you just want to appear their files in their corresponding user gallery?
Logged

orre

  • Coppermine newbie
  • Country: no
  • Offline Offline
  • Gender: Male
  • Posts: 7
Re: Create and upload / move user albums
« Reply #4 on: October 28, 2011, 02:56:47 pm »

Dummy user sounds logical. How?

Yes, user as owner, -I think...
I like to maintain the idea of personal galleries, but still would like to be able to administrate it! Our members in general are not versed computer users...
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Create and upload / move user albums
« Reply #5 on: October 28, 2011, 03:08:57 pm »

Dummy user sounds logical. How?
Just create a new user in your board.


Yes, user as owner, -I think...
I like to maintain the idea of personal galleries, but still would like to be able to administrate it! Our members in general are not versed computer users...
Do your users usually upload and maintain their pictures/files themselves? If so, they also should be the owner of the imported files. If you maintain the gallery for your users, I don't see any reason why you should mess around with the database stuff, especially as it in't intended that the administrator maintain albums in the user galleries.
Logged

orre

  • Coppermine newbie
  • Country: no
  • Offline Offline
  • Gender: Male
  • Posts: 7
Re: Create and upload / move user albums
« Reply #6 on: October 28, 2011, 05:09:34 pm »

You're right. This is to be a pure installation task, and user should thereafter be the owner of his/her personal gallery.
I guess a simple task e.g. removing a offensive picture, as easy could be done via phpMyAdmin...
Logged

orre

  • Coppermine newbie
  • Country: no
  • Offline Offline
  • Gender: Male
  • Posts: 7
Re: Re: Create and upload / move user albums
« Reply #7 on: November 01, 2011, 11:02:40 am »

I'd also use the "Mass Import" plugin to import your existing folder structure to Coppermine. Depending on your folder structure it might be just some database queries to "batch" move the imported albums (created by the plugin) to the user categories and also "batch" adjust the owner_id. I guess you have a folder structure like
André. Could I ask you to guide me on how to write and perform such a query please?

/orre
Logged

orre

  • Coppermine newbie
  • Country: no
  • Offline Offline
  • Gender: Male
  • Posts: 7
Re: Create and upload / move user albums
« Reply #8 on: November 03, 2011, 02:40:13 pm »

Sorry to bump... again... But could someone please teach me how to do Andrés suggestion writing database queries!?

Or even better, how to mod cpg 1.5.16 like this old thread suggest.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Create and upload / move user albums
« Reply #9 on: November 03, 2011, 03:32:23 pm »

Or even better, how to mod cpg 1.5.16 like this old thread suggest.
With that mod your users won't become the owner of the uploaded pictures.


You mainly have to do the following tasks to assign the albums and files to a user:
1. Adjust the owner in the albums table
2. Adjust the owner_id in the pictures table


Adjust 1 album
Code: [Select]
UPDATE cpg15x_albums SET owner = '{USER_ID}' WHERE aid = '{ALBUM_ID}
Adjust several albums
Code: [Select]
UPDATE cpg15x_albums SET owner = '{USER_ID}' WHERE aid IN ('{ALBUM_ID}', '{ALBUM_ID}', '{ALBUM_ID}', ...)
Adjust all albums in a category
Code: [Select]
UPDATE cpg15x_albums SET owner = '{USER_ID}' WHERE category = '{CATEGORY_ID}

Adjust all pictures of 1 album
Code: [Select]
UPDATE cpg15x_pictures SET owner_id = '{USER_ID}' WHERE aid = '{ALBUM_ID}'
Adjust all pictures of several albums
Code: [Select]
UPDATE cpg15x_pictures SET owner_id = '{USER_ID}' WHERE aid IN ('{ALBUM_ID}', '{ALBUM_ID}', '{ALBUM_ID}', ...)

Of course you have to replace the placeholders with the actual IDs and maybe you have to adjust the table prefix (cpg15x_).
Logged

orre

  • Coppermine newbie
  • Country: no
  • Offline Offline
  • Gender: Male
  • Posts: 7
Re: Create and upload / move user albums
« Reply #10 on: November 18, 2011, 06:28:25 pm »

Ok..

It has been a tedious job immigrating to Coppermine!...
The worst part, uploading and assigning old personal albums, I have saved to last...
Strangeley, Coppermine, still after 5 years, does not offer the ability for admin to control this part of his/her gallery????

Sadly, a huge amount of Coppermine forum threads are ruined by a weird character called Joachim, using all his effort being extremely unpleasant, yelling at people not asking the "right way", instead of helping out... So unfortunately it's a nearly hopeless job finding help in old forum-threads as most of them is a "dead end" as they has been shut down by mr. Joachim...
I have MANY times nearly given up, and been so sad trying to figure things out when I again and again have been "running into the wall" ending up with this guys unnecessary and devastating rudeness!...

BUT!
He, and a lot of other people has no doubt created a beautiful gallery that they allow us to use for free! That really counts! And I have hated the idea to give this project up!
Fortunately the other people in the develop crew seem to be really nice people! Not at least mr. André that has helped me and lots of others!


Now to the topic.
The "Mass-import" plugin unfortunate did not work as purposed.
All albums imported got signed up with category_id 0 and owner_id 1, and all files got assigned with album_id 0 and owner_id from admin (my self). -(the last one of course as expected)

The job of assigning albums and files to the owner of the "personal album" I have learned from Andrè has to be done directly in the database (eg. by phpMyAdmin)

So after upload all albums by the "help" of Mass Import plugin, I have done the following in phpMyAdmin: (All my users got one folder each with pictures in it)
1. In my phpbb database: Finding the usr_id.
2. In my coppermine database cpg15x_albums, change the "owner" and "category" accordingly. For my gallery, the "category" is specified as the user id with an extra 1*** in front of it, to make it a 5 figure nr. (eg. user id 5 got category 10005, user id 162 got category 10162, user id 2568 got category 12568) I dont know how this will be with more then 9999 users?...
3. In my coppermine database cpg15x_pictures, change the "aid" (album id) and "owner_id" for all files (pictures) that should fit in the above album. As this is applying to several lines I am doing this with a query looking like this:
Code: [Select]
UPDATE cpg15x_pictures SET owner_id = '{USER_ID}', aid = '{ALBUM_ID}' WHERE filepath = '{FILEPATH}'
NOW there is a new user album! :D

Even though the assigned user now has got all rights to administrate this album (as he/she now are the owner) I as admin despite of what I have been told, can still administrate it just like all other albums and files...

I have just started the process of changing hundreds of personal albums, and I have no idea if I am doing it right... But as I still got the admin rights of all albums, it actually seem to work even better than expected!...

Andrè whrote:
With that mod your users won't become the owner of the uploaded pictures.
I don't understand the difference to what you then suggest, and as said above, none of it actually seem to apply to what I am experiencing anyway...

Anyway. Issue seem to be solved so far.....
Thank you so much to showing me the direction Andrè!! :)
Please shout out if I'm mistaking!

/orre
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 20 queries.