New Zenner
- Join Date:
- Nov 2011
- Posts:
- 34
- Plugin Contributions:
- 0
v139 Random Products Image instead of Category Icon
Hi, i wish to add an option for using a random Products Image instead of Category Icon Image,
In includes/modules/category_row.php
after:
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
i've added something like:
$rand_category_query = $db->Execute("select p.products_image as img from ". TABLE_PRODUCTS . " p ".
"LEFT JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc ON ".
"p.products_id = ptc.products_id ".
"WHERE LENGTH(p.products_image) > 0 ".
"AND ptc.categories_id = " .$categories->fields['categories_id'].
" ORDER BY rand( ) LIMIT 1");$random_cat = $rand_category_query->fields['img'];
But
$random_cat instead of zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'] is not working, whts wrong? Thanks :blink: