Adding text link to filename on thumbnails Adding text link to filename on 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

Adding text link to filename on thumbnails

Started by Walkinman, April 16, 2007, 05:24:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Walkinman

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

Walkinman

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

Walkinman

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:

<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:


// 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

Walkinman

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

skidpics

Quote from: Walkinman on April 23, 2007, 05:21:28 PM


                                       <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

Walkinman

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:

<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

Nibbler

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


                $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


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


Additionally. include/functions.inc.php

after

$thumb_list[$i]['aid'] = $row['aid'];

add in

$thumb_list[$i]['filename'] = $row['filename'];

Walkinman

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

Nibbler

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

Walkinman

Hey Nibbler

YOU ROCK!!!!

Thank you - perfect.

Feel free to mark this thread solved.

Thanks again.

Cheers

Carl