[Mod] Thumbnail for albums with linked files only (keyword albums) [Mod] Thumbnail for albums with linked files only (keyword 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

[Mod] Thumbnail for albums with linked files only (keyword albums)

Started by Ludo, September 28, 2008, 06:13:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ludo

Here is a mod that will display in the thumbnail selection listbox on Album properties page, for all albums, both uploaded and linked files.

DEMO: http://vanrokken.altervista.org/ (Album Fiori)

FILES TO EDIT: 2
index.php
modifyalb.php


OPEN
index.php

FIND (2 times)
if ($count > 0) {

REPLACE WITH
if ($count > 0 || $alb_stat['link_pic_count'] > 0) {


OPEN
modifyalb.php

FIND
    global $CONFIG, $ALBUM_DATA, $album, $lang_modifyalb_php,$USER_DATA;

REPLACE WITH
    global $CONFIG, $ALBUM_DATA, $album, $lang_modifyalb_php, $USER_DATA, $FORBIDDEN_SET_DATA;

FIND
    $results = cpg_db_query("SELECT pid, filepath, filename, url_prefix FROM {$CONFIG['TABLE_PICTURES']} WHERE aid='$album' AND approved='YES' ORDER BY filename");

REPLACE WITH
    (count($FORBIDDEN_SET_DATA) > 0) ? $forbidden_set_string = "AND aid NOT IN (".implode(",", $FORBIDDEN_SET_DATA).")" : $forbidden_set_string = '';   
    ($ALBUM_DATA['keyword']) ? $where_string = " (aid='$album' OR (keywords LIKE '%{$ALBUM_DATA['keyword']}%' $forbidden_set_string))" : $where_string = "aid='$album'";       
    $results = cpg_db_query("SELECT pid, filepath, filename, url_prefix FROM {$CONFIG['TABLE_PICTURES']} WHERE $where_string AND approved='YES' ORDER BY filename");



SAVE AND CLOSE ALL FILES

EDIT: added check on private albums. I don't have any private album on my gallery, so I can't test it

jakob.b

Hi Ludo

Your Mod works fine, however only if you have some linked pics. My album stays totaly empty, it's only a placeholder with the info I like to display in with a thumbnail.

http://fotos.lauftreff.ch

I just started, and got stuck with this problem.

I'm very thankfull for any help

Jakob

Ludo

Simply replace images/thumb_nopic.jpg with a custom thumbnail for empty albums!

jakob.b

Thank you Ludo

unfortunately I have several albums which serve as placeholder, which should have each a different thumbnails as you may see in my gallerie.


Hope you may have an idea,

regards JAkob

Ludo

In my humble opinion there is no point in keeping empty albums for other purposes than containing and organizing images. Placeholder...for what?

jakob.b

Well the club (running) I do this for in my spare time, dosen't like the idea of categories. So as you may seen in the link I provided, there are no categories. However I like to add some placeholder for the years, just to get some easier overview.

It dosen't have to be a album, a single picture I could place somhow in there would be great (just something without a link behind it, as it should not be clickable - that is why the idea of a emty album).

Can you get the idea? Or do you think there is no way and they just have to go with categories?

Ludo, I appreciate your opinion very much and thank you for your input.

Warm regards from Switzerland

Jakob

Ludo

Using the "placeholder" album, you end putting some albums "under" a certain year...that is just the aim of organizing albums in categories!

bryaxis

Hi,

I installed your mod by modifying the two relevant files but it seems I must have missed something since the thumbnails won't appear... I'm currently running Coppermine 1.4.25 locally on Wamp.

Any idea on why this might happen ?

Joachim Müller

Do a right-click, properties on the broken thumbnails. Select the full thumbnail URL, copy it and paste it into the address bar of your browser to see what is wrong. It's hard to impossible to advice such things if we can't see them at all.

Old RMN

Hello,

I experience the same problem as posted by bryaxis:

I am running Copp 1.4.25 in a locally hosted Xampp environment.
The actual source code of the pages with the missing thumbnails does not contain any target for the image URI at all:

<a href="thumbnails.php?album=3" class="albums"><img src="" class="image" width="0" border="0" alt="" /><br /></a>

This Mod worked fine with a previous Coppermine version, 1.4.20

Any suggestions? (I appreciate the 'linked files' for albums feature very much)
Sometimes to find the way home one has to leave it.

Old RMN

Correction to my previous post:
-the mod does work (1.4.25 & 1.4.26) for all thumbnails that will be entered in manually as album property.
What does not work is the automatic fill in of the last uploaded file as album thumbnail.
Sometimes to find the way home one has to leave it.

Ludo

This mod is not supposed to create automatically album thumbnail from last uploaded file! :)
As of topic title, it applies only to keyword albums!