Editing linked files Editing linked files
 

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

Editing linked files

Started by nambroque, February 14, 2016, 02:15:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nambroque

Hello
I'd like to know if there is any way to edit the files which are linked to an album through the keyword.
I mean, if you have an album which contains only linked files, and you click on "Edit files", no file will appear in the editpics page.
My gallery: http://fotometeo.ame-web.org/
Thanks in advance!
My gallery:
Galería Fotometeo

Αndré

One way would be edit each file separately via the "Edit file information" button below each picture on its intermediate-sized view (displayimage.php). Alternatively it should be possible to display linked files in editpics.php, but I haven't checked yet the needed effort.

nambroque

Thank you very much for your reply André
I know that possibility exits, but the problem is that we are using the gallery mainly for running photo contests every three months, so everyone who participates uploads the photos to their own albums and, in case they want any of their photo to participate, they have to write the keyword of the contest album.
So they keep their photos in their own albums, but we have all the photos which participate in the contest album all together.
Then we check if the photos comply the requirements and edit them from the contest album in case there is anything incorrect.
We normally use the way you indicate for doing so, but it would be very much easier if the linked photos would appear when clicking in the "Edit files" button of the album.
My gallery:
Galería Fotometeo

Αndré

#3
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);

nambroque

My gallery:
Galería Fotometeo

gmc

Sounds like a good addition (with a config variable as we did for whether or not to use linked files in determining last update of album)..  :)
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

nambroque

Quote from: gmc on February 18, 2016, 01:14:40 PM
Sounds like a good addition (with a config variable as we did for whether or not to use linked files in determining last update of album)..  :)

May you please indicate any thread about that subject?
Thanks 
My gallery:
Galería Fotometeo

Αndré

I think that post was designated for me and I already added it to my to-do list :)

gmc

Yep... was for Αndré - but nambroque might like the feature - since it sounds like they have albums with only linked files...
CPG has a config option to display the number of linked files in an album... but doesn't by default update the 'last uploaded' date if it was a linked file.

Here is the thread: http://forum.coppermine-gallery.net/index.php/topic,77021.0.html

To use this (and other 'hidden' options we have added thru the life of CPG 1.5) easily, install Αndré's 'Hidden features' plugin. It provides the config panel, adds the database entries, and language strings needed. These will all be 'normal' options in CPG 1.6. 
Here is the plugin thread: http://forum.coppermine-gallery.net/index.php/topic,77314.0.html
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

gmc

Perhaps another extension to further integrate 'linked files'...
When viewing a category - and displaying meta albums like last uploaded in the thumbnail view - linked files are not included...

Perhaps a single config variable to regard linked files in all these areas (last update date, editpics, meta albums) and logic behind that to include those files...
The ability to link is a great feature - the option to more fully integrate those pics sounds even better...

Example:
http://greggallery.gmcdesign.com/index.php?cat=20
Category has 2 albums - both with linked files added in late 2015... but scrolling down to the 'last additions' meta album shows pics from 2011...  (Random ignores them as well - but less obvious...)
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

nambroque

That would be great
At the moment linked files do not appear when clicking on 'top rated', 'last uploads', 'most viewed', etc.
So, if you are in a category and all the albums in it are containing only linked files, and you want to see the top rated etc. no file appears 


My gallery:
Galería Fotometeo

nambroque

As the initial subject of this post hass already been solved, I have moved the new question about linked files to a new thread
My gallery:
Galería Fotometeo

nambroque

I re-open this topic because of this matter:
When opening "Edit files" of an album which contains more files than the "number of files to display" you have at the top the option: "See next files", but this doesn't take into account the linked files.
So if you have an album which conteins no files, but with more than 100 linked files (that's the max. number of files to display) there is not the chance of editing more that 100 photos through the "Edit files" function.




My gallery:
Galería Fotometeo

Αndré

I updated my above instructions. There's 1 additional line
$pic_count = mysql_num_rows($result);
below
$result = cpg_db_query($sql);

nambroque

Thanks André, but I'm sorry I have add that line and nothing changed  ::)

On the other hand, in the above instructions you say:

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);

    $pic_count = mysql_num_rows($result);



But in the original file of editpics.php the last line you mention does not appear, so I think you should modify that instruction and delete the last line, so it would be:

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);

[/quote]
My gallery:
Galería Fotometeo

Αndré

I updated my instructions. With the last modifications, do the number of files is displayed correctly or doesn't it change at all?

nambroque

Quote from: Αndré on June 16, 2016, 05:25:37 PM
I updated my instructions. With the last modifications, do the number of files is displayed correctly or doesn't it change at all?

I confirm that the "See next files" option still does not appear.
My gallery:
Galería Fotometeo

Αndré

Unfortunately you haven't answered my question:
Quote from: Αndré on June 16, 2016, 05:25:37 PM
With the last modifications, do the number of files is displayed correctly or doesn't it change at all?

nambroque

Quote from: Αndré on July 04, 2016, 08:59:08 PM
Unfortunately you haven't answered my question:

The number of files was already displayed correctly when implementing your first instructions.
The problem I was talking about now is that the option of seeing more files does not appear, if the number of files is bigger than the number of files selected to be displayed.
Anyway, it is not so important, so I mark this topic as solved again.
Thanks

My gallery:
Galería Fotometeo