/** * @Project NUKEVIET 3.0 * @Author VINADES (contact@vinades.vn) * @Copyright (C) 2010 VINADES. All rights reserved * @Createdate Apr 20, 2010 10:47:41 AM */ if (!defined('NV_IS_MOD_FAQ')) { die('Stop!!!'); } $channel = array(); $items = array(); $channel['title'] = $global_config['site_name'] . ' RSS: ' . $module_info['custom_title']; $channel['link'] = NV_MY_DOMAIN . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name; $channel['atomlink'] = NV_MY_DOMAIN . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=rss"; $channel['description'] = $global_config['site_description']; $list_cats = nv_list_cats(); if (!empty($list_cats)) { $catalias = isset($array_op[1]) ? $array_op[1] : ""; $catid = 0; if (!empty($catalias)) { foreach ($list_cats as $c) { if ($c['alias'] == $catalias) { $catid = $c['id']; break; } } } if ($catid > 0) { $channel['title'] = $global_config['site_name'] . ' RSS: ' . $module_name . ' - ' . $list_cats[$catid]['title']; $channel['link'] = NV_MY_DOMAIN . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $list_cats[$catid]['alias']; $channel['description'] = $list_cats[$catid]['description'];
} $page_title = $lang_module['upload']; $download_config = nv_mod_down_config(); if (!$download_config['is_addfile_allow']) { if (!defined('NV_IS_USER')) { $alert_content = $lang_module['error_not_permission_upload_content_guest']; $urlback = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=users&' . NV_OP_VARIABLE . '=login&nv_redirect=' . nv_redirect_encrypt($client_info['selfurl']); $lang_back = false; } else { $alert_content = $lang_module['error_not_permission_upload_content_user']; $urlback = nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name, true); $lang_back = true; } nv_theme_alert($lang_module['error_not_permission_title'], $alert_content, 'info', $urlback, 5, $lang_back); } $list_cats = nv_list_cats(false, false); if (empty($list_cats)) { Header('Location: ' . nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name, true)); exit; } $is_error = false; $error = ''; $array = array(); if ($nv_Request->isset_request('addfile', 'post')) { $addfile = $nv_Request->get_string('addfile', 'post', ''); if (empty($addfile) or $addfile != md5($client_info['session_id'])) { Header('Location: ' . nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name, true)); exit; } $array['catid'] = $nv_Request->get_int('upload_catid', 'post', 0); $array['title'] = nv_substr($nv_Request->get_title('upload_title', 'post', '', 1), 0, 255);
<?php /** * @Project NUKEVIET 4.x * @Author VINADES.,JSC (contact@vinades.vn) * @Copyright (C) 2014 VINADES.,JSC. All rights reserved * @License GNU/GPL version 2 or any later version * @Createdate 3-6-2010 0:30 */ if (!defined('NV_IS_MOD_DOWNLOAD')) { die('Stop!!!'); } global $global_config, $lang_module, $lang_global, $module_info, $module_name, $module_file, $nv_Request; $list_cats = nv_list_cats(true); $download_config = nv_mod_down_config(); $page = $nv_Request->get_int('page', 'get', 1); $per_page = $download_config['per_page_child']; $key = nv_substr($nv_Request->get_title('q', 'post', '', 1), 0, NV_MAX_SEARCH_LENGTH); $cat = $nv_Request->get_int('cat', 'post', 0); $page_title = $lang_module['search'] . ' ' . $key; $base_url = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=search'; $array_where = array(); $db->sqlreset()->select('COUNT(*)')->from(NV_PREFIXLANG . '_' . $module_data); if (!empty($key)) { $array_where[] = '(title LIKE :keyword1 OR description LIKE :keyword2 OR introtext LIKE :keyword3)'; } if (!empty($cat) and isset($list_cats[$cat])) { $allcat = $list_cats[$cat]['subcats']; if (!empty($allcat)) { $allcat[] = $cat; $array_where[] = 'catid IN (' . implode(',', $allcat) . ')';
* nv_list_cats() * * @param mixed $module_data * @return */ function nv_list_cats($module_data) { global $db; $sql = "SELECT `id`, `title`, `alias`, `who_view`, `groups_view` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_categories` WHERE `status`=1"; $result = $db->sql_query($sql); $list = array(); while ($row = $db->sql_fetchrow($result)) { if (nv_set_allow($row['who_view'], $row['groups_view'])) { $list[$row['id']] = array('id' => (int) $row['id'], 'title' => $row['title'], 'alias' => $row['alias']); } } return $list; } $list_cats = nv_list_cats($m_values['module_data']); $in = implode(",", array_keys($list_cats)); $sql = "SELECT SQL_CALC_FOUND_ROWS `alias`,`title`,`description`, `introtext`, `catid` \r\nFROM `" . NV_PREFIXLANG . "_" . $m_values['module_data'] . "` \r\nWHERE `catid` IN (" . $in . ") \r\nAND (" . nv_like_logic('title', $dbkeyword, $logic) . " \r\nOR " . nv_like_logic('description', $dbkeyword, $logic) . " \r\nOR " . nv_like_logic('introtext', $dbkeyword, $logic) . ") \r\nLIMIT " . $pages . "," . $limit; $tmp_re = $db->sql_query($sql); $result = $db->sql_query("SELECT FOUND_ROWS()"); list($all_page) = $db->sql_fetchrow($result); if ($all_page) { $link = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $m_values['module_name'] . '&' . NV_OP_VARIABLE . '='; while (list($alias, $tilterow, $content, $introtext, $catid) = $db->sql_fetchrow($tmp_re)) { $content = $content . ' ' . $introtext; $result_array[] = array('link' => $link . $list_cats[$catid]['alias'] . '/' . $alias, 'title' => BoldKeywordInStr($tilterow, $key, $logic), 'content' => BoldKeywordInStr($content, $key, $logic)); } }