forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: pols1337 on July 25, 2011, 01:42:13 am

Title: Bridged Coppermine, Showing User Albums for ALL Registered Users
Post by: pols1337 on July 25, 2011, 01:42:13 am
Dear Andre :)

I was moving an album around, and clicked on "Edit Album Properties."  In the drop-down menu for "Album Categories," to showed me both the categories that I created (which is good  :)) .... and hundreds of hundreds of user galleries (which is bad  :-\).  Please see picture.   

In my "Config" > "Registration" settings, "Create user album in personal gallery on registration" is disabled because Coppermine is bridged so the function is automatically disabled. 

Is there a way for me to purge Coppermine of these unused user galleries? 

Joel
Title: Re: Bridged Coppermine, Showing User Albums for ALL Registered Users
Post by: Αndré on July 25, 2011, 11:30:24 am
Open modifyalb.php, find
Code: [Select]
        $sql = $cpg_udb->get_admin_album_list();
       
        $result = cpg_db_query($sql);
       
        while ($row = mysql_fetch_assoc($result)) {
            print_r($row);
            // Add to multi-dim array for later sorting
            $rowset[] = array(
                'cat'   => $lang_modifyalb_php['user_gal'],
                'aid'   => $row['aid'],
                'title' => $row['title'],
            ); 
        }
       
        mysql_free_result($result);
and remove it completely.
Title: Re: Bridged Coppermine, Showing User Albums for ALL Registered Users
Post by: pols1337 on July 25, 2011, 09:15:53 pm
Hi Andre,

I did what you told me to do, but when I checked, it still showed all the User Galleries.  Please see picture.

Please see attached for my modifyalb (saved a text document to attach)

Joel
Title: Re: Bridged Coppermine, Showing User Albums for ALL Registered Users
Post by: Αndré on July 26, 2011, 02:21:00 pm
Oops, my solution removed the user categories from the 'Choose album' box ;D

Undo that change. Instead, find
Code: [Select]
    foreach ($CAT_LIST as $category) {
        echo '                <option value="' . $category[0] . '"' . ($ALBUM_DATA['category'] == $category[0] ? ' selected="selected"': '') . ">" . $category[1] . '</option>' . $LINEBREAK;
    }
and replace with
Code: [Select]
    foreach ($CAT_LIST as $category) {
        if ($category[0] == USER_GAL_CAT || $category[0] > FIRST_USER_CAT) continue;
        echo '                <option value="' . $category[0] . '"' . ($ALBUM_DATA['category'] == $category[0] ? ' selected="selected"': '') . ">" . $category[1] . '</option>' . $LINEBREAK;
    }
Title: Re: Bridged Coppermine, Showing User Albums for ALL Registered Users
Post by: pols1337 on July 26, 2011, 07:28:19 pm
Yes, this works -- resolved.

I have a question though, is this because my CPG is bridged with SMF, or did I have a setting wrong or something?  How come it showed all of these user albums even though, in my Groups settings, I purposely put no user uploads. 
Title: Re: Bridged Coppermine, Showing User Albums for ALL Registered Users
Post by: Αndré on July 27, 2011, 08:57:50 am
is this because my CPG is bridged with SMF
No.


did I have a setting wrong
No.


How come it showed all of these user albums
What you see are user categories, not albums. You as admin might want to assign (move) some albums to a particular user. That's the reason why you see all available user names.