4images Forum & Community

4images Modifications / Modifikationen => Templates & Styles (Requests & Discussions) => Topic started by: tobz on March 12, 2003, 02:53:20 PM

Title: Link/bordercolor around thumbnails?
Post by: tobz on March 12, 2003, 02:53:20 PM
I have changed my link and visited link colors and it worked but I still have a blue link color and a purple visited color around my thumbnail images, how do I change this? I have tried the css and header file but with no luck.

Thanks in advance...
Tobias
Title: Link/bordercolor around thumbnails?
Post by: Chris on March 12, 2003, 10:55:30 PM
Check inside thumbnail_bit.html
Title: Re: Link/bordercolor around thumbnails?
Post by: realeyes on November 23, 2005, 06:52:33 PM
i'm having difficulty changing the border color around the thumbnails. this is what i have in my thumbnail_bit.html:

Code: [Select]
<!-- you wish detail page in a small javascript open window, use {thumbnail_openwindow} -->
{thumbnail}<br />
<b>{image_name}</b> {if image_is_new}<sup class="new">{lang_new}</sup>{endif image_is_new}
<br />
<a href="{cat_url}">{cat_name}</a><br />
{if allow_comments}{lang_comments} {image_comments}{endif allow_comments}<br />

i do not see where to change the border. help finding where i need to do this would be greatly appreciated. thanks.
Title: Re: Link/bordercolor around thumbnails?
Post by: mawenzi on November 23, 2005, 07:24:05 PM
find in /includes/functions.php all thumbnail-codes (similar like) :
Quote
$thumb = "< ... here your thumb-code ... >";

and replace every (and similar) by :
Quote
$thumb = "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#FF0000\">< ... here your thumb-code ... ></td></tr></table>";

configuration :
- cellpadding=\"2\"  -  your bordersize
- bgcolor=\"#FF0000\" - your bordercolor
- in APC set image border - 0

mawenzi

PS.: We all use other thumb-code-versions, therefore the new general representation of the thumbnail-code !

« Letzte Änderung: 24.11.2005 um 19.18 von mawenzi »
Title: Re: Link/bordercolor around thumbnails?
Post by: realeyes on November 24, 2005, 04:06:46 AM
am i only to replace the EXACT code (the first mentioned), or do i replace ALL that look remotely similar?

i tried it, and it just gave me errors on line 328 and such. ??? meh. it's not a big deal, but my thumbnails would look nicer with a border.

thanks for the help. :)
Title: Re: Link/bordercolor around thumbnails?
Post by: V@no on November 24, 2005, 09:46:33 AM
Try again, I've updated mawenzi's post above, there was a little misstake ;)
Title: Re: Link/bordercolor around thumbnails?
Post by: realeyes on November 24, 2005, 04:16:22 PM
i did that and got the following error:

Fatal error: Call to undefined function: multilang() in /home/realeyes/public_html/4images/includes/functions.php on line 333

so i just took out the multilang() and it worked fine, so if you could please edit that code again for others that would be great.

thank you both very much.  :mrgreen:
Title: Re: Link/bordercolor around thumbnails?
Post by: V@no on November 24, 2005, 04:38:47 PM
ok, fixed again...:?
Title: Re: Link/bordercolor around thumbnails?
Post by: mawenzi on November 24, 2005, 06:18:11 PM
ok ... my mistake ... I did not take the original thumb code ...  :?
thanks V@no for the correction ... !
Title: Re: Link/bordercolor around thumbnails?
Post by: realeyes on November 24, 2005, 06:22:02 PM
ut-oh. i just realized that now the link doesn't work on the thumbnails. you hover over the thumbnail and the url shows up in the status window but it doesn't go anywhere when you click on them.  :?: ah, so complicated.
Title: Re: Link/bordercolor around thumbnails?
Post by: mawenzi on November 24, 2005, 07:34:06 PM
ok, now I fixed again ...  :wink:

mawenzi
Title: Re: Link/bordercolor around thumbnails?
Post by: Jdm on February 10, 2006, 03:53:25 PM
Hi!
I have the nice white border but also cannot click on the pictures...  :roll:
Can you help me?
Thanks!
 :oops:
Title: Re: Link/bordercolor around thumbnails?
Post by: mawenzi on February 13, 2006, 11:18:44 PM
you only add the table code (red code) to your $thumb - tag ?
for a fresh 4images functions.php it should look like this ...
Code: [Select]
  if ($show_link) {
    if ($open_window) {
      $thumb = "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#FF0000\"><a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a></td></tr></table>";
    }
    else {
      $thumb = "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#FF0000\"><a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a></td></tr></table>";
    }
  }
Title: Re: Link/bordercolor around thumbnails?
Post by: technobia on April 12, 2006, 04:55:22 AM
Is this the procedure good for ver. 1.7.2?   My thumbnail borders are the standard normal (blue) and visited (purple) link color.  I would therfore assume this would be controled by a stylesheet but I have not had luck with that apporch.  Then I found this post but I am sure I understand what code to put where.

REF mawenzi's post:
$thumb = "table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#FF0000\"> < ... here your thumb-code ..> ></td></tr></table>";

Below is all the code that appears to be related to thumbnails in my includes/functions.php  Where does the red code go exactly?  Is there a way to use the a.link, a.hover, a.visited colors as one might in a css file?

Code: [Select]
function get_thumbnail_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $mode = "", $show_link = 1, $open_window = 0) {
  global $site_sess, $config;

  if (!check_media_type($media_file_name)) {
    $thumb = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
  }
  else {
    if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0)) {
      $file_src = ICON_PATH."/".get_file_extension($media_file_name).".gif";
      $image_info = @getimagesize($file_src);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
      $thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".$image_name."\" />";
    }
    else {
      $file_src = get_file_path($thumb_file_name, "thumb", $cat_id, 0, 1);
      $image_info = @getimagesize($file_src);
      $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
      $thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".$image_name."\" />";
    }
  }

  if ($show_link) {
    if ($open_window) {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
    }
    else {
      $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a>";
    }
  }
  return $thumb;
}

Thanks - Technobia
Title: Re: Link/bordercolor around thumbnails?
Post by: Adrienne on May 20, 2006, 06:56:51 PM
I would like to know too!  :?:
Title: Re: Link/bordercolor around thumbnails?
Post by: mawenzi on May 22, 2006, 11:38:21 AM
...
REF mawenzi's post:
$thumb = "table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#FF0000\"> < ... here your thumb-code ..> </td></tr></table>";
...
Where does the red code go exactly?
...

... that means ...

find your original thumb-code ( 5 x $thumb ) in functions.php :
( e.g. the following ... ! it's your thumb-code ... ! my code looks differently ... ! therefore the general code like above ... !)
Code: [Select]
...
$thumb = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
...
$thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".$image_name."\" />";
...
$thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".$image_name."\" />";
...
$thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
...
$thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a>";
...

should be changed as follows :

Quote
...
$thumb = "table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#FF0000\"> <img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" /> </td></tr></table>";
...
$thumb = "table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#FF0000\"> <img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".$image_name."\" /> </td></tr></table>";
...
$thumb = "table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#FF0000\"> <img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".$image_name."\" /> </td></tr></table>";
...
$thumb = "table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#FF0000\"> <a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a> </td></tr></table>";
...
$thumb = "table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#FF0000\"> <a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a> </td></tr></table>";
...

configuration :
- cellpadding=\"2\"  -  your bordersize
- bgcolor=\"#FF0000\" - your bordercolor
- in APC set image border - 0

mawenzi

Title: Re: Link/bordercolor around thumbnails?
Post by: alekseyn1 on December 22, 2007, 12:32:55 PM
...
REF mawenzi's post:
$thumb = "table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#FF0000\"> < ... here your thumb-code ..> </td></tr></table>";
...
Where does the red code go exactly?
...

... that means ...

find your original thumb-code ( 5 x $thumb ) in functions.php :
( e.g. the following ... ! it's your thumb-code ... ! my code looks differently ... ! therefore the general code like above ... !)
Code: [Select]
...
$thumb = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
...
$thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".$image_name."\" />";
...
$thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".$image_name."\" />";
...
$thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
...
$thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a>";
...

should be changed as follows :

Quote
...
$thumb = "table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#FF0000\"> <img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" /> </td></tr></table>";
...
$thumb = "table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#FF0000\"> <img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".$image_name."\" /> </td></tr></table>";
...
$thumb = "table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#FF0000\"> <img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".$image_name."\" /> </td></tr></table>";
...
$thumb = "table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#FF0000\"> <a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a> </td></tr></table>";
...
$thumb = "table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#FF0000\"> <a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a> </td></tr></table>";
...

configuration :
- cellpadding=\"2\"  -  your bordersize
- bgcolor=\"#FF0000\" - your bordercolor
- in APC set image border - 0

mawenzi




Well, this modification does not really work. I think you have forgotten "<" right after "$thumb =" in every instance of your code.
The problem is even if I correct it and put the "<" it makes a border, but it's not clickable... after some code diggin' found out that something funny was happening with nested tables... Unfortunately I do not know enough about the code to correct it... Please help... (example http://kristina.napolskih.com (http://kristina.napolskih.com))
Title: Re: Link/bordercolor around thumbnails?
Post by: KurtW on December 22, 2007, 01:01:42 PM
Code: [Select]
  if ($show_link) {
    if ($open_window) {
      $thumb = "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#ffc0cb\">\n";
      $thumb .= "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>\n";
      $thumb .= "</td></tr></table>\n";
    }
    else {
      $thumb = "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#ffc0cb\">\n";
      $thumb .= "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a>\n";
      $thumb .= "</td></tr></table>\n";
    }
  }
  return $thumb;


Kurt
Title: Re: Link/bordercolor around thumbnails?
Post by: alekseyn1 on December 22, 2007, 01:47:36 PM
Thanks very much Kurt  :D

Your multiple line code did not work for me as well (could be a bug in "hands.sys"  :lol:)

in any case this is the code that worked:

Code: [Select]
  if ($show_link) {
    if ($open_window) {
      $thumb = "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#ffc0cb\"><a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a></td></tr></table>";
    }
    else {
      $thumb = "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\"><tr><td bgcolor=\"#ffc0cb\"><a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a></td></tr></table>";
    }
  }
  return $thumb;
}

Thanks a lot for your help!
Title: Re: Link/bordercolor around thumbnails?
Post by: niad on December 28, 2015, 12:38:33 PM
It works great, thank you! :D