coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 permissions => Topic started by: yazeft on July 14, 2007, 03:37:00 PM

Title: Video Upload APPROVAL
Post by: yazeft on July 14, 2007, 03:37:00 PM
I would like to allow approval for everything uploaded by registered members EXPECT video files! I'm using CPG with SMF bridge

I want to approve video files separately, each time a member uploads pictures or other files it approves automatically, but only for video files (i.e. wmv, avi, mpeg etc..) it send me an email to approve the files or deny..

thanks.
Title: Re: Video Upload APPROVAL
Post by: Joachim Müller on July 15, 2007, 11:34:57 AM
Feature doesn't exist - you can't approve by file type. If you need it, you'll have to code it.
Title: Re: Video Upload APPROVAL
Post by: yazeft on July 15, 2007, 02:15:10 PM
yes i know that gaugau!

thats why im asking the question.. anyone willing to give me the code for this.. please!
Title: Re: Video Upload APPROVAL
Post by: Nibbler on July 15, 2007, 02:38:51 PM
I don't understand from your post if you want to require approval for only videos or for everything except videos so adjust the code below to suit.

Change the code in include/picmgmnt.inc.php


    // Test if picture requires approval
    if (GALLERY_ADMIN_MODE) {
        $approved = 'YES';
    } elseif (!$USER_DATA['priv_upl_need_approval'] && $category == FIRST_USER_CAT + USER_ID) {
        $approved = 'YES';
    } elseif (!$USER_DATA['pub_upl_need_approval'] && $category < FIRST_USER_CAT) {
        $approved = 'YES';
    } else {
        $approved = 'NO';
    }


to


    // Test if picture requires approval
    if (GALLERY_ADMIN_MODE) {
        $approved = 'YES';
    } elseif (is_movie($image)){
        $approved = 'NO';
    } elseif (!$USER_DATA['priv_upl_need_approval'] && $category == FIRST_USER_CAT + USER_ID) {
        $approved = 'YES';
    } elseif (!$USER_DATA['pub_upl_need_approval'] && $category < FIRST_USER_CAT) {
        $approved = 'YES';
    } else {
        $approved = 'NO';
    }
Title: Re: Video Upload APPROVAL
Post by: yazeft on July 15, 2007, 02:57:10 PM
sorry about the confusion i meant approval only for videos..

is this only for video files?

also how will i know if there is a video waiting approval? will i get an email notification?
Title: Re: Video Upload APPROVAL
Post by: Nibbler on July 15, 2007, 03:31:23 PM
This will require approval for movies uploaded by non-admin users. Disable upload approval on the groups page to make all other files not require approval. You will get email notification if you enable it in config.
Title: Re: Video Upload APPROVAL
Post by: yazeft on July 16, 2007, 02:51:19 PM
so i just need to set approval for the registered users to NO for public albums and set the config for notify admin for awaiting uploads to YES..

is that all (with the changes to the code)?
Title: Re: Video Upload APPROVAL
Post by: Nibbler on July 16, 2007, 04:37:44 PM
Yeah. It's not tested but it should work.
Title: Re: Video Upload APPROVAL
Post by: yazeft on July 17, 2007, 12:51:32 AM
thanks nibbler.. works great!

-SOLVED-