Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Editing linked files  (Read 9261 times)

0 Members and 1 Guest are viewing this topic.

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Editing linked files
« on: February 14, 2016, 02:15:16 pm »

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!
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: Editing linked files
« Reply #1 on: February 17, 2016, 02:44:37 pm »

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.
Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Re: Editing linked files
« Reply #2 on: February 17, 2016, 03:06:22 pm »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: Editing linked files
« Reply #3 on: February 17, 2016, 03:50:52 pm »

Open editpics.php, find
Code: [Select]
    $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
Code: [Select]
    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);
« Last Edit: June 11, 2016, 08:59:10 am by Αndré »
Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Re: Editing linked files
« Reply #4 on: February 17, 2016, 04:31:16 pm »

Solved!
Thank you very much  :)
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: Editing linked files
« Reply #5 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)..  :)
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Re: Re: Editing linked files
« Reply #6 on: February 18, 2016, 06:41:37 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 
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: Editing linked files
« Reply #7 on: February 18, 2016, 07:02:31 pm »

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

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: Editing linked files
« Reply #8 on: February 18, 2016, 08:08:48 pm »

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
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: Editing linked files
« Reply #9 on: February 19, 2016, 02:35:26 pm »

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...)
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Re: Re: Editing linked files
« Reply #10 on: February 19, 2016, 03:10:39 pm »

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 


Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Re: Editing linked files
« Reply #11 on: March 02, 2016, 10:27:43 am »

As the initial subject of this post hass already been solved, I have moved the new question about linked files to a new thread
Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Re: Editing linked files
« Reply #12 on: June 06, 2016, 08:53:10 am »

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.




Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: Editing linked files
« Reply #13 on: June 07, 2016, 10:34:03 am »

I updated my above instructions. There's 1 additional line
Code: [Select]
$pic_count = mysql_num_rows($result);below
Code: [Select]
$result = cpg_db_query($sql);
Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Re: Editing linked files
« Reply #14 on: June 11, 2016, 08:48:30 am »

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

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

Open editpics.php, find
Code: [Select]
    $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:

Open editpics.php, find
Code: [Select]
    $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]
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: Editing linked files
« Reply #15 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?
Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Re: Re: Editing linked files
« Reply #16 on: July 03, 2016, 12:49:17 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: Editing linked files
« Reply #17 on: July 04, 2016, 08:59:08 pm »

Unfortunately you haven't answered my question:
With the last modifications, do the number of files is displayed correctly or doesn't it change at all?
Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Re: Re: Editing linked files
« Reply #18 on: July 05, 2016, 09:56:33 am »

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

Logged
Pages: [1]   Go Up
 

Page created in 0.099 seconds with 19 queries.