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: Add class to thumbnails.php  (Read 5204 times)

0 Members and 1 Guest are viewing this topic.

biellebrunner

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Add class to thumbnails.php
« on: August 21, 2020, 07:41:52 am »

If I add a class to the html in $template_thumbnail_view on theme.php, every place in the gallery where the thumbnails are displayed have that class. I want only the album thumbnails (in URL/thumbnails.php?album=###) to have that class. Is there a way to do so?
Thanks.
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 2026
Re: Add class to thumbnails.php
« Reply #1 on: August 21, 2020, 08:03:45 pm »

Code: [Select]
$special_class = defined('THUMBNAILS_PHP') ? ' my-thumb-class' : '';
// HTML template for thumbnails display
$template_thumbnail_view = <<<EOT

<!-- BEGIN header -->
        <tr>
<!-- END header -->
<!-- BEGIN thumb_cell -->
        <td valign="top" class="thumbnails{$special_class}" width ="{CELL_WIDTH}" align="center">
                <table width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                                <td align="center">
                                        <a href="{LINK_TGT}">{THUMB}<br /></a>
                                        {CAPTION}
                                        {ADMIN_MENU}
                                </td>
                        </tr>
                </table>
        </td>
<!-- END thumb_cell -->
-etc
-etc

Logged

biellebrunner

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Re: Add class to thumbnails.php
« Reply #2 on: August 22, 2020, 02:09:10 am »

Had to add a space between 'thumbnails' and '{$special_class}', but it worked like a charm.
Thank you!  ;D
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 2026
Re: Add class to thumbnails.php
« Reply #3 on: August 22, 2020, 03:02:30 am »

Had to add a space between 'thumbnails' and '{$special_class}'
That's what the space at the front of ' my-thumb-class' was for. ;)
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.