coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: sjordan on July 23, 2006, 02:14:44 AM

Title: Strategy for separation of photos and videos?
Post by: sjordan on July 23, 2006, 02:14:44 AM
Hello,

I'm working with a client and have suggested he go with CPG.

As a simple point of reference, he's trying to do a combo flickr.com + youtube.com

He'll allow users to create their own albums and upload content.

Now the question: Without running two instances of CPG, one only allowing image types (ex. jpg) and one allowing video types (ex .mov), how might we enforce separation of video content and photo content? The key is enforce.

I realize there is work involved and don't expect anyone to do the work for me with a simple recipe of edit this file on line #X, paste XYZ code, etc.

But rather the level of difficulty, a strategy, feasibility, any possible gotchas. In other words, if you were to do it, how might you approach it?

By separation, I mean, as an example, when a user goes to the lastup meta album (~gallery/thumbnails.php?album=lastup&cat=0) they might see the last photos uploaded. There would be a corresponding page for last uploaded videos. The separation would continue throughout the site (ex. newest, top rated, most comments, etc.)

Further clicking on an image (or video) thumbnail normally takes you to that photo's detail page (~gallery/displayimage.php?album=158&pos=1) The filmstrip along the bottom should also not intermingle photos and videos.

Thank you in advance for any insight.

version 1.48
Title: Re: Strategy for separation of photos and videos?
Post by: Joachim Müller on July 23, 2006, 06:36:58 AM
Hm, that's a tricky one that would require a lot of custom coding. How about two separate galleries (they could of course be made to visually fit) with a common user base (i.e. sharing one user table)?
If you're ready to do this in one gallery (the custom coding approach), you'd have to modify the upload.php script in the first place and adding some custom logic to the second step of the uploading process: make the script determine what filetype has been uploaded and only offer the albums that are allowed for that particular file type. You'd have to modify the part of the script that creates the album list dropdown on that screen.
Title: Re: Strategy for separation of photos and videos?
Post by: sjordan on July 23, 2006, 08:14:30 AM
Gaugau,

Thanks for the quick reply. I like the sound of the two galleries using one user table.

Would that be a simple matter of editing the init.inc file?

I'd set the following line
Quote$CONFIG['TABLE_USERS']      = $CONFIG['TABLE_PREFIX'].'users';

to something like
Quote$CONFIG['TABLE_USERS']   = 'cpg_common_users';

in both installs? Of course I'd have to make sure the 'cpg_common_users' table exists (probably by justing renaming of two created during install)

Would that just about cover it? Then as you said, from that point it's just a matter of styling them both to look the same?

And as long as the same cookie name is used, logging in would be seamless? A user would be logged in and out of both galleries, correct?

Thanks again.
Title: Re: Strategy for separation of photos and videos?
Post by: Joachim Müller on July 23, 2006, 08:32:14 AM
Yes, basically that's how it should work. Keep in mind that the cookie names need to differ.
Title: Re: Strategy for separation of photos and videos?
Post by: sjordan on July 23, 2006, 08:37:26 AM
Gaugau,

Oh? The cookie names need to differ? Why is that? By having the cookie name be the same, then a user could seamlessly move between both galleries (possibly without even knowing they've moved from to the other), correct?

Or is this not the case and would result in undesired behavior?

Again, thank you.
Title: Re: Strategy for separation of photos and videos?
Post by: Joachim Müller on July 23, 2006, 09:01:26 AM
Would result in undesired behaviour as far as I can see. You're welcome to try though, maybe it works for you.