Display Title for Filmstrip thumbnails.. Display Title for Filmstrip thumbnails..
 

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

Display Title for Filmstrip thumbnails..

Started by mr.bena, April 20, 2012, 04:17:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mr.bena

Hi, I want the filmstrip thumbnails to display their titles. I such the forum and found that there is a plugin for this in cpg 1.4.x. Is it possible to achieve this in cpg 1.5.x as well? Is it safe to use the same plugin in cpg 1.5.20?

Αndré

#1
Open include/functions.inc.php, find
            $pic_title = $lang_common['filename'] . '=' . $row['filename'] . $LINEBREAK .
                $lang_common['filesize'] . '=' . ($row['filesize'] >> 10) . $lang_byte_units[1] . $LINEBREAK .
                $lang_display_thumbnails['dimensions'] . $row['pwidth'] . "x" . $row['pheight'] . $LINEBREAK .
                $lang_display_thumbnails['date_added'] . localised_date($row['ctime'], $lang_date['album']);

and replace with
$pic_title = $row['title'] ? $row['title'] : $row['filename'];

The better solution would be to use the plugin hook thumb_strip_html_title.

mr.bena


mr.bena

It is solved, Andre. However, it works only when we place the mouse over the thumbnails. Is there a way to display without having to always place the mouse over the thumbnails?

Αndré

Open include/functions.inc.php, find
$thumb_list[$i]['image']      = '<img src="' . $pic_url . '" class="strip_image" border="0" alt="' . $row['filename'] . '" title="' . $pic_title . '" />';
and below, add
$thumb_list[$i]['image']     .= '<span class="thumb_title">'.$pic_title.'</span>';

This should work for all initially loaded thumbnails in the film strip, but won't work for all dynamically loaded thumbnails.

Αndré

#5
To apply the mod to the dynamically loaded thumbnails, open js/displayimage.js, find
src="' + data['url'] + '"/></a>
and replace with
src="' + data['url'] + '"/><span class="thumb_title">' + data['title'] + '</span></a>
twice

find
src="' + url_cache[nextPosition + $go_next] + '"/></a>
and replace with
src="' + url_cache[nextPosition + $go_next] + '"/><span class="thumb_title">' + title_cache[nextPosition + $go_next] + '</span></a>
twice

find
src="'+data['url']+'"/></a>
and replace with
src="' + data['url'] + '"/><span class="thumb_title">' + data['title'] + '</span></a>
twice

find
src="'+url_cache[nextPosition-$go_next]+'"/></a>
and replace with
src="' + url_cache[nextPosition - $go_next] + '"/><span class="thumb_title">' + title_cache[nextPosition - $go_next] + '</span></a>
twice.

mr.bena


mr.bena

Hi, Andre. As you can see from the attached snapshot, the link on the thumbnails which have not been clicked are gray and hard to see. However, the links that have been clicked are highlighted (blue) and very much visible. I want to reverse this, I want the links that have not been click to be highlighted (blue) and the link which have been clicked to be grey instead. Could you please help me further? Am I out of topic?

Αndré

Quote from: mr.bena on April 26, 2012, 03:53:54 AM
Am I out of topic?
I think so. How your links appear is handled in your theme's style.css file.

allvip

Quote from: Αndré on April 23, 2012, 12:26:12 PM
Open include/functions.inc.php, find
            $pic_title = $lang_common['filename'] . '=' . $row['filename'] . $LINEBREAK .
                $lang_common['filesize'] . '=' . ($row['filesize'] >> 10) . $lang_byte_units[1] . $LINEBREAK .
                $lang_display_thumbnails['dimensions'] . $row['pwidth'] . "x" . $row['pheight'] . $LINEBREAK .
                $lang_display_thumbnails['date_added'] . localised_date($row['ctime'], $lang_date['album']);

and replace with
$pic_title = $row['title'] ? $row['title'] : $row['filename'];

Andre forgot to say that $pic_title = ... is found twice in include/functions.inc.php.
Once in function display_thumbnails for thumbnails and once in function display_film_strip for filmstrip thumbnails.

You need to find both $pic_title = ... and replace the second one.

The first one replaces the filename,date etc. with the pic title when you hover over album thumbnails.

allvip

Quote from: mr.bena on April 26, 2012, 03:53:54 AM
Hi, Andre. As you can see from the attached snapshot, the link on the thumbnails which have not been clicked are gray and hard to see. However, the links that have been clicked are highlighted (blue) and very much visible. I want to reverse this, I want the links that have not been click to be highlighted (blue) and the link which have been clicked to be grey instead. Could you please help me further? Am I out of topic?


Add this css rule to style.css (your css file may have a diffrent name) to change the color for the filmstrip thumb title(I used the curve theme and the tumb cell has class .thumb):


.thumb a:link{
        color: #FFFFFF;
}
.thumb a:visited{
        color: #009;
}
.thumb a:focus{
        color: #444;
}
.thumb a:hover{
        color: #5A7E9F;text-decoration:none;
}
.thumb a:active{
        color: #FFCC01;
}



allvip

#11
style the filmstrip current thumbnail (active thumbnail) :

http://forum.coppermine-gallery.net/index.php/topic,77353.0.html