function getArticleData() { // create the array $ids = array(); $idsK2 = array(); // generate the content of the array foreach ($this->config['image_show_data'] as $slide) { if ($slide->type == 'article') { array_push($ids, $slide->art_id); } if ($slide->type == 'k2') { array_push($idsK2, $slide->artK2_id); } } // get the data if (count($idsK2) > 0) { $this->articlesK2 = GKIS_gk_game_Model::getDataK2($idsK2); } if (count($ids) > 0) { $this->articles = GKIS_gk_game_Model::getData($ids); } }
function getArticleData() { // create the array $ids = array(); $idsK2 = array(); // generate the content of the array if ($slide->type == 'article') { if ($slide->art_id) { array_push($ids, $slide->art_id); } else { array_push($ids, 0); } } if ($slide->type == 'k2') { if ($slide->artK2_id) { array_push($idsK2, $slide->artK2_id); } else { array_push($idsK2, 0); } } // get the data if (count($idsK2) > 0) { $this->articlesK2 = GKIS_gk_game_Model::getDataK2($idsK2); } if (count($ids) > 0) { $this->articles = GKIS_gk_game_Model::getData($ids); } }