Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: [Mod] Thumbnail for albums with linked files only (keyword albums)  (Read 13618 times)

0 Members and 1 Guest are viewing this topic.

Ludo

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
[Mod] Thumbnail for albums with linked files only (keyword albums)
« on: September 28, 2008, 06:13:53 pm »

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)
Code: [Select]
if ($count > 0) {
REPLACE WITH
Code: [Select]
if ($count > 0 || $alb_stat['link_pic_count'] > 0) {

OPEN
modifyalb.php

FIND
Code: [Select]
    global $CONFIG, $ALBUM_DATA, $album, $lang_modifyalb_php,$USER_DATA;
REPLACE WITH
Code: [Select]
    global $CONFIG, $ALBUM_DATA, $album, $lang_modifyalb_php, $USER_DATA, $FORBIDDEN_SET_DATA;
FIND
Code: [Select]
    $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
Code: [Select]
    (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
Logged

jakob.b

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: [Mod] Thumbnail for albums with linked files only (keyword albums)
« Reply #1 on: January 04, 2009, 10:23:06 pm »

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
Logged

Ludo

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: [Mod] Thumbnail for albums with linked files only (keyword albums)
« Reply #2 on: January 05, 2009, 06:15:21 pm »

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

jakob.b

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: [Mod] Thumbnail for albums with linked files only (keyword albums)
« Reply #3 on: January 05, 2009, 07:11:22 pm »

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
Logged

Ludo

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: [Mod] Thumbnail for albums with linked files only (keyword albums)
« Reply #4 on: January 07, 2009, 09:52:44 am »

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

jakob.b

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: [Mod] Thumbnail for albums with linked files only (keyword albums)
« Reply #5 on: January 18, 2009, 07:04:41 pm »

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
Logged

Ludo

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: [Mod] Thumbnail for albums with linked files only (keyword albums)
« Reply #6 on: January 19, 2009, 02:50:48 pm »

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

bryaxis

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: [Mod] Thumbnail for albums with linked files only (keyword albums)
« Reply #7 on: October 02, 2009, 01:18:56 pm »

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: [Mod] Thumbnail for albums with linked files only (keyword albums)
« Reply #8 on: October 02, 2009, 01:46:16 pm »

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

Old RMN

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 8
    • www.primethai.com -Discover Thailand individually-
Re: [Mod] Thumbnail for albums with linked files only (keyword albums)
« Reply #9 on: January 26, 2010, 09:58:33 am »

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)
Logged
Sometimes to find the way home one has to leave it.

Old RMN

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 8
    • www.primethai.com -Discover Thailand individually-
Re: [Mod] Thumbnail for albums with linked files only (keyword albums)
« Reply #10 on: February 07, 2010, 01:45:39 am »

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.
Logged
Sometimes to find the way home one has to leave it.

Ludo

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: [Mod] Thumbnail for albums with linked files only (keyword albums)
« Reply #11 on: March 30, 2010, 06:31:05 pm »

This mod is not supposed to create automatically album thumbnail from last uploaded file! :)
As of topic title, it applies only to keyword albums!
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 22 queries.