Hi Clyde,
I'm still using your mod with no problems, but I have something you or your readers may be interested in adding.
I wanted to do this ever seance I installed my link trade page on my classified site. That one use only web page thumbnails for the link image and some other interesting things. The easiest one to bring over was the web page thumbnail. Some easy edits and it works! I didn't take time to set up a better way of controlling the use of thumbnails, but I did set it up so that having a default image in Configuration ->Links Manager ->Default Link Image, will use the default and not the thumbnail shot. So to turn this on, leave the default image blank!
In includes\modules\YOUR_TEMPLATE\link_listing.php find line 82
Code:
$lc_text = TABLE_HEADING_LINKS_IMAGE;
and change it to this one
Code:
//$lc_text = TABLE_HEADING_LINKS_IMAGE;
$lc_text = '<div valign="top" class="thumbnail"><img src="http://open.thumbshots.org/image.pxf?url=' .zen_get_links_url($listing_query->fields['links_id']).'" style="vertical-align: middle;" border="1" width="120" height="90" alt="Thumbnail"> </div>';
next in includes\modules\pages\links_submit\header_php.php find line 91
Code:
}else { // Use default image if form field is left blank
and change it to this one
Code:
}else { // Use default image if form field is left blank
//$links_image_name = DEFAULT_LINK_IMAGE;
if (DEFAULT_LINK_IMAGE !='') {
$links_image_name = LINK_IMAGE_DIRECTORY . DEFAULT_LINK_IMAGE;
$db->Execute("update " . TABLE_LINKS . "
set links_image_url = '" . $links_image_name . "'
where links_id = '" . (int)$links_id . "'");
$messageStack->add_session('header', WARNING_DEFAULT_FILE_UPLOADED, 'success');
}else { // no default image, use thumbnail of site
$links_image_name = '';
$db->Execute("update " . TABLE_LINKS . "
set links_image_url = '" . $links_image_name . "'
where links_id = '" . (int)$links_id . "'");
$messageStack->add_session('header', DEFAULT_THUMBNAIL, 'success');
}
next in includes\languages\english\extra_definitions\YOUR_TEMPLATE\links_manager_defines .php add this line to the bottom.
Code:
define('DEFAULT_THUMBNAIL', 'Your web site Thumbnail will be used for this link.');
And lastly, you need to register with thumbshots.org it's free, and you need to place a link back to them on your site. I did mine in the includes\languages\english\html_includes\YOUR_TEMPLATE\define_links.php page.
That's all there was to it, if they upload a image, no thumbnail, if you have a default image, no thumbnail, no image, thumbnail is used. In admin, if you edit the submitted link and add you default image there (links_image/links_default.jpg), then that will turn off thumbnails for that link. Same way, deleting the image link will turn on the thumbnail shot.
Bookmarks