$page_title = $lang_module['download_filequeue']; $sql = 'FROM ' . NV_PREFIXLANG . '_' . $module_data . '_tmp'; $sql1 = 'SELECT COUNT(*) ' . $sql; $result1 = $db->query($sql1); $all_file = $result1->fetchColumn(); if (!$all_file) { $contents = "<div style=\"padding-top:15px;text-align:center\">\n"; $contents .= "<strong>" . $lang_module['filequeue_empty'] . "</strong>"; $contents .= "</div>\n"; $contents .= "<meta http-equiv=\"refresh\" content=\"2;url=" . NV_BASE_ADMINURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "\" />"; include NV_ROOTDIR . '/includes/header.php'; echo nv_admin_theme($contents); include NV_ROOTDIR . '/includes/footer.php'; exit; } $listcats = nv_listcats(0); if (empty($listcats)) { Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=cat&add=1'); exit; } $sql2 = 'SELECT * ' . $sql . ' ORDER BY uploadtime DESC'; $result2 = $db->query($sql2); $array = array(); while ($row = $result2->fetch()) { $array[$row['id']] = array('id' => (int) $row['id'], 'title' => $row['title'], 'cattitle' => $listcats[$row['catid']]['title'], 'catlink' => NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&catid=' . $row['catid'], 'uploadtime' => nv_date('d/m/Y H:i', $row['uploadtime'])); } $xtpl = new XTemplate('filequeue.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file); $xtpl->assign('LANG', $lang_module); $xtpl->assign('GLANG', $lang_global); $xtpl->assign('TABLE_CAPTION', $page_title); if (!empty($array)) {
if ($array['parentid'] != $row['parentid']) { nv_FixWeightCat($row['parentid']); } Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=cat"); exit; } } } else { $array['parentid'] = (int) $row['parentid']; $array['title'] = $row['title']; $array['description'] = $row['description']; $array['who_view'] = (int) $row['who_view']; $array['groups_view'] = !empty($row['groups_view']) ? explode(",", $row['groups_view']) : array(); } $listcats = array(array('id' => 0, 'name' => $lang_module['faq_category_cat_maincat'], 'selected' => "")); $listcats = $listcats + nv_listcats($array['parentid'], $catid); $who_view = $array['who_view']; $array['who_view'] = array(); foreach ($array_who as $key => $who) { $array['who_view'][] = array('key' => $key, 'title' => $who, 'selected' => $key == $who_view ? " selected=\"selected\"" : ""); } $groups_view = $array['groups_view']; $array['groups_view'] = array(); if (!empty($groups_list)) { foreach ($groups_list as $key => $title) { $array['groups_view'][] = array('key' => $key, 'title' => $title, 'checked' => in_array($key, $groups_view) ? " checked=\"checked\"" : ""); } } $xtpl = new XTemplate("cat_add.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_file); $xtpl->assign('FORM_ACTION', NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $op . "&edit=1&catid=" . $catid); $xtpl->assign('LANG', $lang_module);
} if (!empty($array['description'])) { $array['description'] = nv_htmlspecialchars($array['description']); } if (!empty($array['introtext'])) { $array['introtext'] = nv_htmlspecialchars($array['introtext']); } if (!count($array['fileupload'])) { array_push($array['fileupload'], ""); } if (!count($array['linkdirect'])) { array_push($array['linkdirect'], ""); } $array['fileupload_num'] = count($array['fileupload']); $array['linkdirect_num'] = count($array['linkdirect']); $listcats = nv_listcats($array['catid']); if (empty($listcats)) { Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=cat&add=1"); exit; } $array['comment_allow'] = $array['comment_allow'] ? " checked=\"checked\"" : ""; $array['is_del_report'] = $array['is_del_report'] ? " checked=\"checked\"" : ""; $who_comment = $array['who_comment']; $array['who_comment'] = array(); foreach ($array_who as $key => $who) { $array['who_comment'][] = array('key' => $key, 'title' => $who, 'selected' => $key == $who_comment ? " selected=\"selected\"" : ""); } $groups_comment = $array['groups_comment']; $array['groups_comment'] = array(); if (!empty($groups_list)) { foreach ($groups_list as $key => $title) {
$sql = "SELECT COUNT(*) AS count, catid FROM " . NV_PREFIXLANG . "_" . $module_data . " WHERE id=" . $id; $result = $db->query($sql); list($count, $catid) = $result->fetch(3); if ($count != 1) { die('NO'); } $sql = "DELETE FROM " . NV_PREFIXLANG . "_" . $module_data . " WHERE id=" . $id; $db->query($sql); nv_update_keywords($catid); nv_FixWeight($catid); die('OK'); } //List faq $listcats = array(); $listcats[0] = array('id' => 0, 'name' => $lang_module['nocat'], 'title' => $lang_module['nocat'], 'selected' => 0 == 0 ? " selected=\"selected\"" : ""); $listcats = $listcats + nv_listcats(0); if (empty($listcats)) { Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=cat&add=1"); exit; } $page_title = $lang_module['faq_manager']; $page = $nv_Request->get_int('page', 'get', 0); $per_page = 30; $sql = "SELECT SQL_CALC_FOUND_ROWS * FROM " . NV_PREFIXLANG . "_" . $module_data . ""; $base_url = NV_BASE_ADMINURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name; if ($nv_Request->isset_request("catid", "get")) { $catid = $nv_Request->get_int('catid', 'get', 0); if (!$catid or !isset($listcats[$catid])) { Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name); exit; }
$cat = $nv_Request->get_int('cat', 'post'); $key = filter_text_input('q', 'post', '', 1, NV_MAX_SEARCH_LENGTH); $keyword = $key; $xtpl->assign("KEYWORD", $key); $per_page = $download_config['items_per_page']; $base_url = NV_BASE_SITEURL . "?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=newsearch"; $xtpl->assign('FORMACTION', $base_url); if ($cp_mark) { if (!$nv_Request->isset_request('submit', 'post')) { $base_url .= "&f=m"; } } $query = "SELECT `id`, `title`, `alias`, `parentid` FROM `" . NV_PREFIXLANG . "_" . $module_name . "_categories` WHERE parentid=0 AND `status`=1 ORDER BY weight"; $result = $db->sql_query($query); $store_cats = array(); $nv_list_cats = nv_listcats(0); foreach ($nv_list_cats as $cat_i) { if (!$cat_i['status']) { continue; } if ($cat == $cat_i['id']) { $cat_i['selected'] = "selected=\"selected\""; } $xtpl->assign('LISTCATS', $cat_i); $xtpl->parse('main.form.catid'); $store_cats[$cat_i['id']] = $cat_i['title']; } $xtpl->parse("main.form"); if ($nv_Request->isset_request('submit', 'post')) { $key = filter_text_input('q', 'post', '', 1, NV_MAX_SEARCH_LENGTH); if (!empty($key)) {