Strategy for separation of photos and videos? Strategy for separation of photos and videos?
 

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

Main Menu

Strategy for separation of photos and videos?

Started by sjordan, July 23, 2006, 02:14:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sjordan

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

Joachim Müller

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.

sjordan

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.

Joachim Müller

Yes, basically that's how it should work. Keep in mind that the cookie names need to differ.

sjordan

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.

Joachim Müller

Would result in undesired behaviour as far as I can see. You're welcome to try though, maybe it works for you.