YePix Posted September 26, 2019 Share Posted September 26, 2019 Hi folks, i need an approach for my idea. It is the Nivo Slider module. I would like certain banner groups to be displayed only if the corresponding category is also activated. Does anyone have some info for me that could help me realize it? Link to comment Share on other sites More sharing options...
YePix Posted September 26, 2019 Author Share Posted September 26, 2019 In the table categories I added a new field "categories_slide_group". How do I get this now to hide the slidegroup if this is the same as the one in the table "s.lindex_slides_group" All other groups should be displayed further. private function get_lindex_slides_data() { global $languages_id; // select banners_group to be used $new_banner_search = ''; if (MODULE_CONTENT_LINDEX_NIVO_SLIDER_GROUP != '') { $selected_banners = explode(':', MODULE_CONTENT_LINDEX_NIVO_SLIDER_GROUP); $size = sizeof($selected_banners); if ($size == 1) { $new_banner_search .= " lindex_slides_group = '" . trim($selected_banners[0]) . "'"; // elimino espacios al principio y al final. } else { for ($i=0, $n=$size; $i<$n; $i+=1) { $new_banner_search .= " lindex_slides_group = '" . trim($selected_banners[$i]) . "'"; // elimino espacios al principio y al final. if ($i+1 < $n) { $new_banner_search .= ' or '; } } } if ($new_banner_search != '') { $new_banner_search = ' and (' . $new_banner_search . ')'; } } $lindex_slides_query_raw = tep_db_query("select s.lindex_slides_id, s.lindex_slides_url, s.lindex_slides_image, s.lindex_slides_group, sd.lindex_slides_title, sd.lindex_slides_description, c.categories_id, c.categories_slide_group from lindex_slides s, lindex_slides_description sd, categories c where status = 1 " . $new_banner_search . " and s.lindex_slides_id = sd.lindex_slides_id and sd.language_id = '" . (int)$languages_id . "' and s.lindex_slides_group = c.categories_slide_group order by rand() limit " . MODULE_CONTENT_LINDEX_NIVO_SLIDER_LIMIT); return $lindex_slides_query_raw; } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.