Integrating linked files in meta albums Integrating linked files in meta albums
 

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

Integrating linked files in meta albums

Started by nambroque, March 02, 2016, 10:25:08 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nambroque

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/)
My gallery:
Galería Fotometeo

Αndré

Open
Quoteinclude/functions.inc.php
, find
$RESTRICTEDWHERE .= ") AND (1";
and remove or comment it out.

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

nambroque

Quote from: Αndré on March 02, 2016, 10:40:47 AM
Open , find
$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)


My gallery:
Galería Fotometeo

nambroque

Quote from: nambroque on March 04, 2016, 10:54:13 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.
My gallery:
Galería Fotometeo

Αndré

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:
QuoteSELECT 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)

nambroque

The source albums are the user's personal albums (they all reside in each user's category)
My gallery:
Galería Fotometeo

Αndré

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.

Αndré

Open include/functions.inc.php, find
$RESTRICTEDWHERE = "INNER JOIN {$CONFIG['TABLE_CATEGORIES']} AS c2 ON c2.cid = category WHERE (c2.lft BETWEEN $lft AND $rgt";
and replace with
$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.

nambroque

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...
My gallery:
Galería Fotometeo