Author Topic: How to add text link under thumbnail?  (Read 6889 times)

0 Members and 1 Guest are viewing this topic.

Offline magooo

  • Newbie
  • *
  • Posts: 14
    • View Profile
How to add text link under thumbnail?
« on: April 23, 2007, 04:57:36 AM »
Hello everybody!

As you know, under every thumbnail is listed its name. I want to make that name clickable (adding href).

Example:


Google Earth day (clickable name)


How to do this? I've tried with:

{thumbnail}
<br />
<a href="{image_url}">{image_name}</a>


but without luck... Any ideas/suggestions?


Many thanks, in advance!

Offline Lesik

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: How to add text link under thumbnail?
« Reply #1 on: April 23, 2007, 09:10:01 AM »
in file thumbnail_bit.html in version 1.7.4

beside I work

<a href="{image_url}">{image_name}</a>

OR

<a  href="{image_path}">{image_name}</a>
« Last Edit: April 23, 2007, 09:21:10 AM by Lesik »

Offline magooo

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: How to add text link under thumbnail?
« Reply #2 on: April 23, 2007, 04:52:49 PM »
Thanks for reply Lesik ;)

Unfortunately, none of them worked...

manurom

  • Guest
Re: How to add text link under thumbnail?
« Reply #3 on: April 23, 2007, 05:22:28 PM »
Hello;
I believe you want to get a direct link to the picture, not to details... Am I right?

Then open includes/functions.php and find:
Code: [Select]
function get_media_code($media_file_name, $image_id = 0, $cat_id = 0, $image_name = "", $mode = "", $show_link = 0, $detailed_view = 0) {
  global $site_template, $site_sess, $lang, $mode;

Replace by:
Code: [Select]
function get_media_code($media_file_name, $image_id = 0, $cat_id = 0, $image_name = "", $mode = "", $show_link = 0, $detailed_view = 0) {
  global $site_template, $site_sess, $lang, $mode, $script_url;

About 60 lines behind, find this line:
Code: [Select]
      "image_name" => $image_name,
Insert after this one:
Code: [Select]
      "image_path" => $site_sess->url($script_url.(str_replace("./", "/",$media_src))),

Now, in templates/your_template/thumbnail_bit.html, you can add your code:
Code: [Select]
<a href="{image_path}">{image_name}</a>(Tested and working in version 1.7.4)

Offline magooo

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: How to add text link under thumbnail?
« Reply #4 on: April 23, 2007, 10:13:30 PM »
Hello;
I believe you want to get a direct link to the picture, not to details... Am I right?

Many thanks for replay Manurom :wink: however i want a direct (text) link to the details page.

I'm able to get a direct link to the picture, with:
<a href="{thumbnail_file_name}">{image_name}</a>
and
<a href="{image_file_name}">{image_name}</a>

 but it doesn't help me...
« Last Edit: April 23, 2007, 10:44:18 PM by magooo »

manurom

  • Guest
Re: How to add text link under thumbnail?
« Reply #5 on: April 23, 2007, 10:49:27 PM »
Direct link to details from thumbnail:
insert in templates/your_template/thumbnail_bit.html:
Code: [Select]
<a href="details.php?image_id">{image_name}</a><br />

Offline magooo

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: How to add text link under thumbnail?
« Reply #6 on: April 23, 2007, 11:07:35 PM »
It still doesn't work... now the text link looks like this:
http://www.sitename.com/{details.php?image_id}

manurom

  • Guest
Re: How to add text link under thumbnail?
« Reply #7 on: April 23, 2007, 11:37:48 PM »
Sorry;
it did work because I did not close my session.
Try this:
Code: [Select]
<a href="{image_url}">{image_name}</a><br />Works for me on version 1.7.4...

Offline magooo

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: How to add text link under thumbnail?
« Reply #8 on: April 24, 2007, 01:01:25 AM »
Finally solved!  :D

I'm still using ver.1.7.2 because i have many mods installed... i've added the following line:
"image_url" => ($show_link) ? $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_row['image_id'].((!empty($mode)) ? "&amp;mode=".$mode : "")) : "",
into functions.php file and now it works.

Many thanks for assistance manurom  :wink: