I've read most of the thread, and managed to get the foreground image code working, to vary between different logo foreground images. I've tried several times to replace the current code that is in tpl_header.php to get images to work with subcategories, using the bg image code, modified for use with foreground images and with .jpg
Base code (works, but no subcatagories)
Code:
if ($current_page_base == 'index' or $current_page_base == 'product_info') { //change filename to smartimg_ and top cat id only if cat image exists
$smart_image = (file_exists(DIR_WS_TEMPLATE_IMAGES . 'smartimg_' . str_replace(strstr($_GET[cPath],'_'),'',$_GET[cPath]) . '.jpg'))?'smartimg_' . str_replace(strstr($_GET[cPath],'_'),'',$_GET[cPath] . '.jpg'):HEADER_LOGO_IMAGE;
Attempted code (no images show)
Code:
if ($current_page_base == 'index' or $current_page_base == 'product_info') { //add _ and cPath to img filename only if individual cat img image exists, else add _ and top cat id to img filename only if top cat img image exists
$smart_image = file_exists(DIR_WS_TEMPLATE_IMAGES . 'smartimg_' . $_GET[cPath] . '.jpg')?'_' . $_GET[cPath]:(file_exists(DIR_WS_TEMPLATE_IMAGES . 'smartimg_' . (int)$_GET[cPath] . '.jpg')?'_' . (int)$_GET[cPath]:'');
Any help or ideas would be most appreciated.