[FONT=Courier New]Adapted the link image code from Glenn Hebert's "Categories Dressing" mod to substitute the EZ Pages links text with an image if it is available. None of the other "Categories Dressing" features were adapted here, but they easily could be. I just didn't need them. [/FONT]
[FONT=Courier New]If you have an image, it should be named ezimg_yourEZpageNameHere.gif[/FONT]
[FONT=Courier New]where "yourEZpageNameHere" is substituted with the text that is in your EZ page link. If there are blanks in the name, replace the blanks with underscores when naming the image file. The image should exist in includes/templates/YOUR_TEMPLATE/images in order for the code to find it. If there is no appropriately named image found, the code will just put the text name that you defined just as the vanilla code does.[/FONT]
[FONT=Courier New]Here's my override copy of the includes/templates/YOUR_TEMPLATE/sideboxes/tpl_ezpages.php file with the changes applied to 1.3.8a version.[/FONT]
PHP Code:
<?php
/**
* Side Box Template
* 05/28/08 Modifications adapted from Categories Dressing mod to post images instead of the
* page name if the *.gif image is available.
*
* @package templateSystem
* @copyright Copyright 2003-2005 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_ezpages.php 2982 2006-02-07 07:56:41Z birdbrain $
*/
$content = "";
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
$content .= "\n" . '<ul style="margin: 0; padding: 0; list-style-type: none;">' . "\n";
for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) {
$ez_name_display = $var_linksList[$i]['name'];
$assoc_image_file = 'ezimg_' . strtr($ez_name_display,' ','_') . '.gif'; /* replace blanks in name with underscore */
if( file_exists(DIR_WS_TEMPLATE_IMAGES . $assoc_image_file) ) {
/* code has determined that image file with appropriate name exists, so plug it in */
$ez_name_display = zen_image(DIR_WS_TEMPLATE_IMAGES . $assoc_image_file, '', '', '', ' title="Follow link to ' . $ez_name_display . ' "');
}
$content .= '<li><a href="' . $var_linksList[$i]['link'] . '">' . $ez_name_display . '</a></li>' . "\n" ;
} // end FOR loop
$content .= '</ul>' . "\n";
$content .= '</div>';
?>
[FONT=Courier New]Hope this is helpful to someone![/FONT]
[FONT=Courier New]Karen[/FONT]
Bookmarks