Editing linked files Editing linked files
 

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]

Main Menu

Editing linked files

Started by nambroque, February 15, 2023, 11:49:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nambroque

Reggarding this thread.
After installing 1.6.21 it doesn´t work any more.  :-[
My gallery:
Galería Fotometeo

ron4mac

If it would be of any help, one of the Admin Tools allows you to remove specific keywords. I assume people add a keyword for contest photos. After the contest, that keyword can be removed from everything with that Admin Tool.

nambroque

Thanks for your reply, but that is not useful for me
What I need is linked files to appear when clicking on "Edit files" of an album which is empty, but contains files linked there via the keyword of the album
Andrè gave me a solution for 1.5, and it worked great:

Quote from: Αndré on February 17, 2016, 03:50:52 PM
Open editpics.php, find
    $sql = "SELECT p.*,a.category FROM {$CONFIG['TABLE_PICTURES']} as p " .
            " INNER JOIN {$CONFIG['TABLE_ALBUMS']} as a " .
            " ON a.aid = p.aid " .
            " WHERE p.aid = '$album_id' $owner_str" .
            " ORDER BY p.pid DESC LIMIT $start, $count";

    $result = cpg_db_query($sql);

and replace with
    if (count($FORBIDDEN_SET_DATA) > 0) {
        $forbidden_set_string = ' AND aid NOT IN (' . implode(', ', $FORBIDDEN_SET_DATA) . ')';
    } else {
        $forbidden_set_string = '';
    }

    if (!empty($ALBUM_DATA['keyword'])) {
        $keyword = "OR (keywords like '%{$ALBUM_DATA['keyword']}%' $forbidden_set_string )";
    } else {
        $keyword = '';
    }

    $sql = "SELECT p.*,a.category FROM {$CONFIG['TABLE_PICTURES']} as p " .
            " INNER JOIN {$CONFIG['TABLE_ALBUMS']} as a " .
            " ON a.aid = p.aid " .
            " WHERE p.aid = '$album_id' $owner_str $keyword" .
            " ORDER BY p.pid DESC LIMIT $start, $count";

    $result = cpg_db_query($sql);

    $pic_count = mysql_num_rows($result);



But after installing 1.6 it doesn't work any more
My gallery:
Galería Fotometeo

ron4mac

I see you reverted to CPG 1.5.48.

You should be able to make the same modification to CPG 1.6.x in editpics.php at about line 753.
Just make the last line of the modification:
$pic_count = cpg_db_num_rows($result);
instead of:
$pic_count = mysql_num_rows($result);

nambroque

I'm sorry we`re back to 1.5.48 again, as our gallery failed two days ago. It had never happened before, so we are concerned it may have happened due to any problem with the new version
We'll wait until updating to 1.6.x is mandatory, and then we'll try to change this again.
Thank you very much for your reply!
My gallery:
Galería Fotometeo

Celestiq2020

Quote from: nambroque on February 17, 2023, 08:27:52 AM
Thanks for your reply, but that is not useful for me
What I need is linked files to appear when clicking on "Edit files" of an album which is empty, but contains files linked there via the keyword of the album
Andrè gave me a solution for 1.5, and it worked great:


But after installing 1.6 it doesn't work any more

hello,
I am not a programmer, where do I need to copy and paste this code?