Miri4413 Posted May 22, 2008 Share Posted May 22, 2008 Hi, this is my situation, I want to change te template base on the "current_category_id" if the current_category_id is equal to any of this numbers (1,12,13,14,15) require this tpl_modules_attributes_1.php if the current_category_id is equal to any of this numbers (2,5,6,7, require this tpl_modules_attributes_2.php if other number require tpl_modules_attributes.php So, this is my php code but something is wrong, (I don't know PHP) Please Help !!! <?php $clenses = array("1", "12", "13", "14"); $plenses = array("2", "5", "6", "7", "8"); if $current_category_id=="clenses"; require($template->get_template_dir('/tpl_modules_attributes_1.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes_1.php'); if ($current_category_id=="plenses") require($template->get_template_dir('/tpl_modules_attributes_2.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes_2.php'); ?> Thanks Link to comment https://forums.phpfreaks.com/topic/106835-solved-what-is-wrong-with-this/ Share on other sites More sharing options...
Dragen Posted May 22, 2008 Share Posted May 22, 2008 <?php $clenses = array("1", "12", "13", "14"); $plenses = array("2", "5", "6", "7", "8"); if(in_array($current_category_id, $clenses)){ require($template->get_template_dir('/tpl_modules_attributes_1.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes_1.php'); }elseif(in_array($current_category_id, $plenses)){ require($template->get_template_dir('/tpl_modules_attributes_2.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes_2.php'); }else{ die('invalid category id'); } ?> Link to comment https://forums.phpfreaks.com/topic/106835-solved-what-is-wrong-with-this/#findComment-547690 Share on other sites More sharing options...
Miri4413 Posted May 22, 2008 Author Share Posted May 22, 2008 Thank You, is working!!!!!!!!! ...of course is working, with your help, Thank You!!!!!!!!!!!!!!!! Link to comment https://forums.phpfreaks.com/topic/106835-solved-what-is-wrong-with-this/#findComment-547728 Share on other sites More sharing options...
Dragen Posted May 23, 2008 Share Posted May 23, 2008 glad I could help Link to comment https://forums.phpfreaks.com/topic/106835-solved-what-is-wrong-with-this/#findComment-547953 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.