//no image $item['imghome'] = NV_BASE_SITEURL . $show_no_image; } else { $item['imghome'] = ''; } $item['newday'] = $global_array_cat[$catid_i]['newday']; $item['link'] = $global_array_cat[$catid_i]['link'] . '/' . $item['alias'] . '-' . $item['id'] . $global_config['rewrite_exturl']; $array_cat_other[$key]['content'][] = $item; } unset($sql, $result); ++$key; } unset($array_catid); } $generate_page = nv_alias_page($page_title, $base_url, $num_items, $per_page, $page); $contents = viewcat_top($array_catcontent, $generate_page); $contents .= call_user_func('viewsubcat_main', $viewcat, $array_cat_other); } elseif ($viewcat == 'viewcat_two_column') { // Cac bai viet phan dau $array_catcontent = array(); $db_slave->sqlreset()->select('id, listcatid, topicid, admin_id, author, sourceid, addtime, edittime, publtime, title, alias, hometext, homeimgfile, homeimgalt, homeimgthumb, allowed_rating, hitstotal, hitscm, total_rating, click_rating')->from(NV_PREFIXLANG . '_' . $module_data . '_' . $catid)->where('status=1'); $featured = 0; if ($global_array_cat[$catid]['featured'] != 0) { $db_slave->where('id=' . $global_array_cat[$catid]['featured'] . ' and status= 1'); $result = $db_slave->query($db_slave->sql()); while ($item = $result->fetch()) { if ($item['homeimgthumb'] == 1) { //image thumb $item['imghome'] = NV_BASE_SITEURL . NV_FILES_DIR . '/' . $module_upload . '/' . $item['homeimgfile']; } elseif ($item['homeimgthumb'] == 2) { //image file
if (!empty($item['homeimgthumb'])) { $array_img = explode("|", $item['homeimgthumb']); } else { $array_img = array("", ""); } $item['imghome'] = $array_img[0]; $item['imgthumb'] = $array_img[1]; $item['link'] = $global_array_cat[$catid_i]['link'] . "/" . $item['alias'] . "-" . $item['id']; $array_cat_other[$key]['content'][] = $item; } unset($sql, $result); $key++; } unset($array_catid); } $contents = viewcat_top($array_catcontent); $contents .= nv_news_page($base_url, $all_page, $per_page, $page); $contents .= call_user_func("viewsubcat_main", $viewcat, $array_cat_other); } elseif ($viewcat == "viewcat_two_column") { // Cac bai viet phan dau $array_catcontent = array(); //$sql = "SELECT `id`, `listcatid`, `topicid`, `admin_id`, `author`, `sourceid`, `addtime`, `edittime`, `publtime`, `title`, `alias`, `hometext`, `homeimgfile`, `homeimgalt`, `homeimgthumb`, `imgposition`, `inhome`, `allowed_rating`, `ratingdetail`, `hitstotal`, `hitscm` , `keywords` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_" . $catid . "` WHERE `status`=1 AND `publtime` < " . NV_CURRENTTIME . " AND (`exptime`=0 OR `exptime`>" . NV_CURRENTTIME . ") ORDER BY `publtime` DESC LIMIT " . $page . "," . $per_page . ""; $sql = "SELECT `id`, `listcatid`, `topicid`, `admin_id`, `author`, `sourceid`, `addtime`, `edittime`, `publtime`, `title`, `alias`, `hometext`, `homeimgfile`, `homeimgalt`, `homeimgthumb`, `imgposition`, `inhome`, `allowed_rating`, `ratingdetail`, `hitstotal`, `hitscm` , `keywords` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_" . $catid . "` WHERE `status`=1 AND `publtime` < " . NV_CURRENTTIME . " AND (`exptime`=0 OR `exptime`>" . NV_CURRENTTIME . ") ORDER BY `publtime` DESC LIMIT " . $cp_number_items; $result = $db->sql_query($sql); while ($item = $db->sql_fetchrow($result)) { if (!empty($item['homeimgthumb'])) { $array_img = explode("|", $item['homeimgthumb']); } else { $array_img = array("", ""); } $item['imghome'] = $array_img[0];