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: Integrating linked files in meta albums  (Read 4861 times)

0 Members and 1 Guest are viewing this topic.

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 88
    • Galería Fotometeo
Integrating linked files in meta albums
« on: March 02, 2016, 10:25:08 am »

At the moment if you are in an album which contains linked files through a keyword, when clicking on 'top rated', 'last uploads', 'most viewed', etc. those files are not included.
So, if you are in the thumbnail view of an album (or category) including only linked files, and you want to see the top rated, etc., no file will appear. 
I wonder if there may be any way to make the linked files also be included in the meta albums
Thanks

(My gallery: http://fotometeo.ame-web.org/)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Integrating linked files in meta albums
« Reply #1 on: March 02, 2016, 10:40:47 am »

Open
Quote
include/functions.inc.php
, find
Code: [Select]
$RESTRICTEDWHERE .= ") AND (1";and remove or comment it out.

I haven't checked for any side effects, so please report any unexpected behavior.
Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 88
    • Galería Fotometeo
Re: Re: Integrating linked files in meta albums
« Reply #2 on: March 04, 2016, 10:54:13 pm »

Open , find
Code: [Select]
$RESTRICTEDWHERE .= ") AND (1";and remove or comment it out.

I haven't checked for any side effects, so please report any unexpected behavior.

Thank you very much André
I have checked and it works when you are in an album, but not if you are in a category which contains albums with linked files.
And it doesn´t work with the 'top rated' (the linked files are not included)

 
Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 88
    • Galería Fotometeo
Re: Re: Integrating linked files in meta albums
« Reply #3 on: March 07, 2016, 07:39:59 pm »

And it doesn´t work with the 'top rated' (the linked files are not included)

Sorry, I was wrong, it works also with the 'top rated' (they did not appear because of the config: "minimum number of votes for a file to appear in the 'top rated' list")
So the only thing pending to solve the subject of this thread is the one about categories... if you are in a category and its albums contain only linked files, no photo appears in the meta albums.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Integrating linked files in meta albums
« Reply #4 on: March 08, 2016, 02:07:50 pm »

Do your "source" pictures (album) reside in the root category / *no category*? It didn't work for me with pictures in albums in *no category*, but when I move the parent album to any category, it worked as expected.

Reason: the bold part of the following SQL query excludes all albums without a category:
Quote
SELECT r.pid, r.aid, filepath, filename, url_prefix, pwidth, pheight, filesize, ctime, r.title, r.keywords, r.votes, pic_rating, hits, caption, r.owner_id, pic_raw_ip, pic_hdr_ip
                FROM cpg15x_pictures AS r
                INNER JOIN cpg15x_albums AS a ON a.aid = r.aid
                INNER JOIN cpg15x_categories AS c2 ON c2.cid = category WHERE (c2.lft BETWEEN 3 AND 4 OR keywords like '%test%')
                AND approved = 'YES'
                ORDER BY ctime DESC, pid DESC
                 LIMIT 0 ,12 [include/functions.inc.php:1504] (1.2 ms)
Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 88
    • Galería Fotometeo
Re: Re: Integrating linked files in meta albums
« Reply #5 on: March 08, 2016, 03:22:40 pm »

The source albums are the user's personal albums (they all reside in each user's category)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Integrating linked files in meta albums
« Reply #6 on: March 08, 2016, 03:41:07 pm »

I haven't tested that scenario. I was able to reproduce it on my gallery and will have a closer look. The reason is most likely, that user categories are generated by "USER_ID +  10000", so they actually don't exist in the database.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Integrating linked files in meta albums
« Reply #7 on: March 08, 2016, 03:47:08 pm »

Open include/functions.inc.php, find
Code: [Select]
$RESTRICTEDWHERE = "INNER JOIN {$CONFIG['TABLE_CATEGORIES']} AS c2 ON c2.cid = category WHERE (c2.lft BETWEEN $lft AND $rgt";and replace with
Code: [Select]
$RESTRICTEDWHERE = "LEFT JOIN {$CONFIG['TABLE_CATEGORIES']} AS c2 ON c2.cid = category WHERE (c2.lft BETWEEN $lft AND $rgt";
This should fix it for pictures in albums in *no category* and the user galleries. Again, I haven't checked for any side effects, so please report any unexpected behavior.
Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 88
    • Galería Fotometeo
Re: Integrating linked files in meta albums
« Reply #8 on: March 08, 2016, 06:45:00 pm »

Thanks, I confirm that it works with the user galleries  :)
By the moment I mark this as solved, and in case I detect anything wrong I would report it here...
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 19 queries.