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: Adding text link to filename on thumbnails  (Read 3951 times)

0 Members and 1 Guest are viewing this topic.

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Adding text link to filename on thumbnails
« on: April 16, 2007, 05:24:51 am »

Hey Folks

I was wondering if it's possible to change the filename that is displayed under the thumnbails to a text link. For an example, you can look at this this page here. I would like to change it so the filename still displays, but is a text link to the page displaying larger image.

As always, any help is much appreciated.

Thank you.

Cheers

Carl
« Last Edit: May 01, 2007, 11:42:06 pm by Nibbler »
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Adding text link to filename on thumbnails
« Reply #1 on: April 20, 2007, 06:03:31 am »

Hey Folks

If someone has any idea of how I might be able to do this I would really appreciate it. All I want is to make the filename actually be a link to the page that the larger image opens up . just like what happens with the thumbnail. Is this possible?

Thank you.

Cheers

Carl
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Adding text link to filename on thumbnails
« Reply #2 on: April 23, 2007, 05:21:28 pm »

Hello folks

I see I have to turn off display filename in the Config setting. So I did that (it's on right now). Then I added this:

Code: [Select]
<a href="{LINK_TGT}">{FILENAME}<br /></a>
to the // HTML template for thumbnails display section in my theme.php. The whole thing looks like this:

Code: [Select]
// HTML template for thumbnails display

$template_thumbnail_view = <<<EOT



<!-- BEGIN header -->

        <tr>

<!-- END header -->

<!-- BEGIN thumb_cell -->

        <td valign="top" class="thumbnails" 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 -->

But all i can make it do is display the word filename, as a text link to the correct page. What am I doing wrong that I can change to display the actual filename, ,then I can turn off display filename in Config and this should work.

Thank you.

Cheers

Carl
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Adding text link to filename on thumbnails
« Reply #3 on: April 30, 2007, 05:26:20 pm »

Hey Folks,

Can someone please let me know if this is possible? Or if it's impossible. Or, if you'd be so ind, maybe offer some help as to how I might get this working? I'd really appreciate it.

Thank you.

Cheers

Carl
Logged

skidpics

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 223
Re: Adding text link to filename on thumbnails
« Reply #4 on: May 01, 2007, 12:34:15 am »



                                       <a href="{LINK_TGT}">{THUMB}<br /></a>
         

Seems like you should be able to link with changing the {LINK_TGT] to whatever link you needed without the {}, since the href appears to be the link to the actual picture..  I might be wrong, but I think that should do it..

-- Skidpics
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Adding text link to filename on thumbnails
« Reply #5 on: May 01, 2007, 10:33:26 pm »

Hey Skidpcs

Thank you for your help.

But I probably wasn't as clear about what I want to as I shoud have been. I want the filename of the photo to appear under the thumbnail. I can do this in Config. But, I want that filename to be a text link to the larger image page .. A visitor can click on the thumbnail or the filename and be taken to the page referred to as "{LINK_TGT}".

I went to Config, thumbnail view, and clicked "no", next to "Display file name below the thumbnail". Then I went to my theme.php and made this the code for display thumbnail section:

Code: [Select]
<td align="center">

                                       <a href="{LINK_TGT}">{THUMB}<br /></a>
<a href="{LINK_TGT}">{FILENAME}<br /></a>
{CAPTION}
{ADMIN_MENU}

                                </td>

What happens then is I get the thumbnail display correctly, and act as a link to the larger page, as normal. But under the thumbnail I get this:

{FILENAME}

which is a link to the larger page .. I want it to be the actual filename, not the text {FILENAME}. Does this make sense. It's linking to the correct place, it just isn't displaying the actual filename, but rather the text {FILENAME}.

Anyone have any ideas for correcting this?

Thank you.

Cheers

Carl
Logged

Nibbler

  • Guest
Re: Adding text link to filename on thumbnails
« Reply #6 on: May 01, 2007, 10:49:03 pm »

That should be in theme_display_thumbnails. Copy from sample to your theme, find

Code: [Select]
                $params = array('{CELL_WIDTH}' => $cell_width,
                    '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&amp;pos={$thumb['pos']}$uid_link",
                    '{THUMB}' => $thumb['image'],
                    '{CAPTION}' => $thumb['caption'],
                    '{ADMIN_MENU}' => $thumb['admin_menu']
                    );

and add in a

Code: [Select]
'{FILENAME}' => $thumb['filename'],

Additionally. include/functions.inc.php

after

Code: [Select]
$thumb_list[$i]['aid'] = $row['aid'];
add in

Code: [Select]
$thumb_list[$i]['filename'] = $row['filename'];
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Adding text link to filename on thumbnails
« Reply #7 on: May 01, 2007, 11:22:11 pm »

Hey Nibbler

Thanks a lot man. I can see a few things I was missing. I did this, I THINK it was correct, but I got this error:

"Fatal error: Cannot redeclare theme_display_thumbnails() (previously declared in /home/skola2/public_html/stock/plugins/album_fav_boxes/codebase.php:121) in /home/skola2/public_html/stock/themes/water_drop/theme.php on line 1372"

Do I have to open up the plug in and do something there?

Thanks for your hrelp, as always I appreciate it.

Cheers

Carl
Logged

Nibbler

  • Guest
Re: Adding text link to filename on thumbnails
« Reply #8 on: May 01, 2007, 11:25:53 pm »

Apply the mod to the codebase.php of that plugin instead of to your theme's theme.php.
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Adding text link to filename on thumbnails
« Reply #9 on: May 01, 2007, 11:31:41 pm »

Hey Nibbler

YOU ROCK!!!!

Thank you - perfect.

Feel free to mark this thread solved.

Thanks again.

Cheers

Carl
Logged
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 19 queries.