$item['width'] = $module_config[$module_name]['homewidth']; $end_weight = $item['weight']; $item['link'] = $global_array_cat[$item['catid']]['link'] . "/" . $item['alias'] . "-" . $item['id']; $topic_array[] = $item; } $db->sql_freeresult($query); unset($query, $row); $topic_other_array = array(); $query = $db->sql_query("SELECT t1.id, t1.catid, t1.addtime, t1.edittime, t1.publtime, t1.title, t1.alias, t1.hitstotal FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` as t1 INNER JOIN `" . NV_PREFIXLANG . "_" . $module_data . "_block` AS t2 ON t1.id = t2.id WHERE t2.bid= " . $bid . " AND t2.weight > " . $end_weight . " ORDER BY t2.weight ASC LIMIT 0," . $st_links . ""); while ($item = $db->sql_fetch_assoc($query)) { $item['link'] = $global_array_cat[$item['catid']]['link'] . "/" . $item['alias'] . "-" . $item['id']; $topic_other_array[] = $item; } unset($query, $row, $arr_listcatid); $generate_page = nv_alias_page($page_title, $base_url, $all_page, $per_page, $page); $contents = topic_theme($topic_array, $topic_other_array, $generate_page); if ($page > 1) { $page_title .= ' ' . NV_TITLEBAR_DEFIS . ' ' . $lang_global['page'] . ' ' . $page; } } } else { $array_cat = array(); $key = 0; $query_cat = $db->sql_query("SELECT `bid`, `number`, `title`, `alias` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_block_cat` ORDER BY `weight` ASC"); while (list($bid, $numberlink, $btitle, $balias) = $db->sql_fetchrow($query_cat, 1)) { $array_cat[$key] = array('catid' => $bid, 'alias' => '', 'subcatid' => '', 'title' => $btitle, 'link' => NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=groups/" . $balias); $query = $db->sql_query("SELECT t1.id, t1.catid, t1.admin_id, t1.author, t1.sourceid, t1.addtime, t1.edittime, t1.publtime, t1.title, t1.alias, t1.hometext, t1.homeimgfile, t1.homeimgalt, t1.homeimgthumb, t1.allowed_rating, t1.hitstotal, t1.hitscm, t1.total_rating, t1.click_rating, t1.keywords FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` as t1 INNER JOIN `" . NV_PREFIXLANG . "_" . $module_data . "_block` AS t2 ON t1.id = t2.id WHERE t2.bid= " . $bid . " AND t1.status= 1 ORDER BY t2.weight ASC LIMIT 0," . $numberlink); while ($item = $db->sql_fetch_assoc($query)) { $array_img = !empty($item['homeimgthumb']) ? explode("|", $item['homeimgthumb']) : ($array_img = array("", "")); if ($array_img[0] != "" and file_exists(NV_ROOTDIR . '/' . NV_FILES_DIR . '/' . $module_name . '/' . $array_img[0])) { $item['imghome'] = NV_BASE_SITEURL . NV_FILES_DIR . '/' . $module_name . '/' . $array_img[0];
$end_publtime = $item['publtime']; $item['link'] = $global_array_cat[$item['catid']]['link'] . '/' . $item['alias'] . '-' . $item['id'] . $global_config['rewrite_exturl']; $item_array[] = $item; } $result->closeCursor(); unset($query, $row); $item_array_other = array(); if ($st_links > 0) { $db->sqlreset()->select('id, catid, addtime, edittime, publtime, title, alias, hitstotal')->from(NV_PREFIXLANG . '_' . $module_data . '_rows')->where('status=1 AND id IN (SELECT id FROM ' . NV_PREFIXLANG . '_' . $module_data . '_tags_id WHERE tid=' . $tid . ') and publtime < ' . $end_publtime)->order('publtime DESC')->limit($st_links); $result = $db->query($db->sql()); while ($item = $result->fetch()) { $item['link'] = $global_array_cat[$item['catid']]['link'] . '/' . $item['alias'] . '-' . $item['id'] . $global_config['rewrite_exturl']; $item_array_other[] = $item; } unset($query, $row); } $generate_page = nv_alias_page($page_title, $base_url, $num_items, $per_page, $page); if (!empty($image_tag)) { $image_tag = NV_BASE_SITEURL . NV_FILES_DIR . '/' . $module_upload . '/' . $image_tag; } $contents = topic_theme($item_array, $item_array_other, $generate_page, $page_title, $description, $image_tag); if ($page > 1) { $page_title .= ' ' . NV_TITLEBAR_DEFIS . ' ' . $lang_global['page'] . ' ' . $page; } include NV_ROOTDIR . '/includes/header.php'; echo nv_site_theme($contents); include NV_ROOTDIR . '/includes/footer.php'; } } $redirect = '<meta http-equiv="Refresh" content="3;URL=' . nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name, true) . '" />'; nv_info_die($lang_global['error_404_title'], $lang_global['error_404_title'], $lang_global['error_404_content'] . $redirect);
} } else { $page_title = $module_info['custom_title']; $key_words = $module_info['keywords']; $result = $db_slave->query('SELECT topicid as id, title, alias, image, description as hometext, keywords, add_time as publtime FROM ' . NV_PREFIXLANG . '_' . $module_data . '_topics ORDER BY weight ASC'); while ($item = $result->fetch()) { if (!empty($item['image']) and file_exists(NV_ROOTDIR . '/' . NV_FILES_DIR . '/' . $module_upload . '/topics/' . $item['image'])) { //image thumb $item['src'] = NV_BASE_SITEURL . NV_FILES_DIR . '/' . $module_upload . '/topics/' . $item['image']; } elseif (!empty($item['image'])) { //image file $item['src'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/topics/' . $item['image']; } elseif (!empty($show_no_image)) { //no image $item['src'] = NV_BASE_SITEURL . $show_no_image; } else { $item['src'] = ''; } $item['alt'] = !empty($item['homeimgalt']) ? $item['homeimgalt'] : $item['title']; $item['width'] = $module_config[$module_name]['homewidth']; $item['link'] = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $module_info['alias']['topic'] . '/' . $item['alias']; $topic_array[] = $item; } $result->closeCursor(); unset($result, $row); $topic_other_array = array(); $contents = topic_theme($topic_array, $topic_other_array, '', $page_title, $description, ''); } include NV_ROOTDIR . '/includes/header.php'; echo nv_site_theme($contents); include NV_ROOTDIR . '/includes/footer.php';
} else { $item['src'] = ""; } $item['alt'] = !empty($item['homeimgalt']) ? $item['homeimgalt'] : $item['title']; $item['width'] = $module_config[$module_name]['homewidth']; $end_publtime = $item['publtime']; $item['link'] = $global_array_cat[$item['catid']]['link'] . "/" . $item['alias'] . "-" . $item['id']; $topic_array[] = $item; } $db->sql_freeresult($query); unset($query, $row); $topic_other_array = array(); $query = $db->sql_query("SELECT `id`, `catid`, `addtime`, `edittime`, `publtime`, `title`, `alias`, `hitstotal` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` WHERE `status`=1 AND `topicid` = " . $topicid . " AND `publtime` < " . $end_publtime . " ORDER BY `publtime` DESC LIMIT 0," . $st_links . ""); while ($item = $db->sql_fetch_assoc($query)) { $item['link'] = $global_array_cat[$item['catid']]['link'] . "/" . $item['alias'] . "-" . $item['id']; $topic_other_array[] = $item; } unset($query, $row, $arr_listcatid); $base_url = "" . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=topic/" . $topicalias; $generate_page = nv_alias_page($page_title, $base_url, $all_page, $per_page, $page); $contents = topic_theme($topic_array, $topic_other_array, $generate_page, $page_title, $description); if ($page > 1) { $page_title .= ' ' . NV_TITLEBAR_DEFIS . ' ' . $lang_global['page'] . ' ' . $page; } } else { Header("Location: " . nv_url_rewrite(NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name, true)); exit; } include NV_ROOTDIR . "/includes/header.php"; echo nv_site_theme($contents); include NV_ROOTDIR . "/includes/footer.php";
if ($size > 0) { $homewidth = $module_config[$module_name]['homewidth']; $size[1] = round($homewidth / $size[0] * $size[1]); $size[0] = $homewidth; $item['alt'] = !empty($item['homeimgalt']) ? $item['homeimgalt'] : $item['title']; $src = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_name . '/' . $array_img[0]; } $item['alt'] = $alt; $item['src'] = $src; $item['width'] = $size[0]; $item['height'] = $size[1]; $item['link'] = $global_array_cat[$catid]['link'] . "/" . $item['alias'] . "-" . $item['id']; $topic_array[] = $item; } $db->sql_freeresult($query); unset($query, $row); $topic_other_array = array(); $query = $db->sql_query("SELECT `id`, `listcatid`, `addtime`, `edittime`, `publtime`, `title`, `alias`, `hitstotal` FROM `" . NV_PREFIXLANG . "_" . $module_name . "_rows` WHERE `status`=1 AND `publtime` < " . NV_CURRENTTIME . " AND (`exptime`=0 OR `exptime`>" . NV_CURRENTTIME . ") AND `topicid` = " . $topicid . " AND `id` < " . $end_id . " ORDER BY `id` DESC LIMIT 0," . $st_links . ""); while ($item = $db->sql_fetchrow($query)) { $catid = end(explode(",", $item['listcatid'])); $item['link'] = $global_array_cat[$catid]['link'] . "/" . $item['alias'] . "-" . $item['id']; $topic_other_array[] = $item; } unset($query, $row); $base_url = "" . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&op=topic/" . $topicalias . ""; $contents = topic_theme($topic_array, $topic_other_array); $contents .= nv_news_page($base_url, $all_page, $per_page, $page); } include NV_ROOTDIR . "/includes/header.php"; echo nv_site_theme($contents); include NV_ROOTDIR . "/includes/footer.php";