Exemple #1
0
         if ($catid) {
             $alias = 'cat-' . $catid;
         } else {
             $_m_catid = $db->query('SELECT MAX(catid) AS cid FROM ' . NV_PREFIXLANG . '_' . $module_data . '_cat')->fetchColumn();
             if (empty($_m_catid)) {
                 $alias = 'cat-1';
             } else {
                 $alias = 'cat-' . (intval($_m_catid) + 1);
             }
         }
     }
 } else {
     $alias = $_alias;
 }
 $_groups_post = $nv_Request->get_array('groups_view', 'post', array());
 $groups_view = !empty($_groups_post) ? implode(',', nv_groups_post(array_intersect($_groups_post, array_keys($groups_list)))) : '';
 $image = $nv_Request->get_string('image', 'post', '');
 if (is_file(NV_DOCUMENT_ROOT . $image)) {
     $lu = strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/');
     $image = substr($image, $lu);
 } else {
     $image = '';
 }
 if (!defined('NV_IS_ADMIN_MODULE')) {
     if (!(isset($array_cat_admin[$admin_id][$parentid]) and $array_cat_admin[$admin_id][$parentid]['admin'] == 1)) {
         Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&parentid=' . $parentid);
         die;
     }
 }
 if ($catid == 0 and $title != '') {
     $weight = $db->query('SELECT max(weight) FROM ' . NV_PREFIXLANG . '_' . $module_data . '_cat WHERE parentid=' . $parentid)->fetchColumn();
Exemple #2
0
 if (nv_is_file($image, NV_UPLOADS_DIR . '/' . $module_upload)) {
     $lu = strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/');
     $row['image'] = substr($image, $lu);
 } else {
     $row['image'] = '';
 }
 $row['imagealt'] = $nv_Request->get_title('imagealt', 'post', '', 1);
 $row['imageposition'] = $nv_Request->get_int('imageposition', 'post', 0);
 $row['description'] = $nv_Request->get_textarea('description', '', 'br', 1);
 $row['bodytext'] = $nv_Request->get_editor('bodytext', '', NV_ALLOWED_HTML_TAGS);
 $row['keywords'] = nv_strtolower($nv_Request->get_title('keywords', 'post', '', 0));
 $row['socialbutton'] = $nv_Request->get_int('socialbutton', 'post', 0);
 $row['layout_func'] = $nv_Request->get_title('layout_func', 'post', '');
 $row['gid'] = $nv_Request->get_int('gid', 'post', 0);
 $_groups_post = $nv_Request->get_array('activecomm', 'post', array());
 $row['activecomm'] = !empty($_groups_post) ? implode(',', nv_groups_post(array_intersect($_groups_post, array_keys($groups_list)))) : '';
 if (empty($row['title'])) {
     $error = $lang_module['empty_title'];
 } elseif (strip_tags($row['bodytext']) == '') {
     $error = $lang_module['empty_bodytext'];
 } elseif (empty($row['layout_func']) or in_array('layout.' . $row['layout_func'] . '.tpl', $layout_array)) {
     $row['alias'] = empty($row['alias']) ? change_alias($row['title']) : change_alias($row['alias']);
     if (empty($row['keywords'])) {
         $row['keywords'] = nv_get_keywords($row['title']);
         if (empty($row['keywords'])) {
             $row['keywords'] = nv_unhtmlspecialchars($row['keywords']);
             $row['keywords'] = strip_punctuation($row['keywords']);
             $row['keywords'] = trim($row['keywords']);
             $row['keywords'] = nv_strtolower($row['keywords']);
             $row['keywords'] = preg_replace('/[ ]+/', ',', $row['keywords']);
         }
     if (empty($rowcontent['alias'])) {
         $rowcontent['alias'] = 'post';
     }
 } else {
     $rowcontent['alias'] = $alias;
 }
 $rowcontent['hometext'] = $nv_Request->get_textarea('hometext', '', 'br', 1);
 $rowcontent['vid_path'] = $nv_Request->get_title('vid_path', 'post', '');
 $rowcontent['vid_duration'] = $nv_Request->get_title('vid_duration', 'post', '');
 $rowcontent['homeimgfile'] = $nv_Request->get_title('homeimg', 'post', '');
 $rowcontent['homeimgalt'] = $nv_Request->get_title('homeimgalt', 'post', '', 1);
 $rowcontent['bodyhtml'] = $nv_Request->get_editor('bodyhtml', '', NV_ALLOWED_HTML_TAGS);
 $rowcontent['copyright'] = (int) $nv_Request->get_bool('copyright', 'post');
 $rowcontent['inhome'] = (int) $nv_Request->get_bool('inhome', 'post');
 $_groups_post = $nv_Request->get_array('allowed_comm', 'post', array());
 $rowcontent['allowed_comm'] = !empty($_groups_post) ? implode(',', nv_groups_post(array_intersect($_groups_post, array_keys($groups_list)))) : '';
 $rowcontent['allowed_rating'] = (int) $nv_Request->get_bool('allowed_rating', 'post');
 $rowcontent['allowed_send'] = (int) $nv_Request->get_bool('allowed_send', 'post');
 $rowcontent['allowed_save'] = (int) $nv_Request->get_bool('allowed_save', 'post');
 $rowcontent['gid'] = $nv_Request->get_int('gid', 'post', 0);
 $rowcontent['keywords'] = $nv_Request->get_array('keywords', 'post', '');
 $rowcontent['keywords'] = implode(', ', $rowcontent['keywords']);
 // Tu dong xac dinh keywords
 if ($rowcontent['keywords'] == '' and !empty($module_config[$module_name]['auto_tags'])) {
     $keywords = $rowcontent['hometext'] != '' ? $rowcontent['hometext'] : $rowcontent['bodyhtml'];
     $keywords = nv_get_keywords($keywords, 100);
     $keywords = explode(',', $keywords);
     // Ưu tiên lọc từ khóa theo các từ khóa đã có trong tags thay vì đọc từ từ điển
     $keywords_return = array();
     foreach ($keywords as $keyword_i) {
         $sth = $db->prepare('SELECT COUNT(*) FROM ' . NV_PREFIXLANG . '_' . $module_data . '_tags_id where keyword = :keyword');
Exemple #4
0
 $array_config['viewlist_type'] = $nv_Request->get_title('viewlist_type', 'post', 'list');
 $array_config['per_page_home'] = $nv_Request->get_int('per_page_home', 'post', 20);
 $array_config['per_page_child'] = $nv_Request->get_int('per_page_child', 'post', 20);
 $array_config['is_addfile'] = $nv_Request->get_int('is_addfile', 'post', 0);
 $array_config['maxfilesize'] = $nv_Request->get_float('maxfilesize', 'post', 0);
 $array_config['upload_filetype'] = $nv_Request->get_typed_array('upload_filetype', 'post', 'string');
 $array_config['is_zip'] = $nv_Request->get_int('is_zip', 'post', 0);
 $array_config['readme'] = $nv_Request->get_textarea('readme', '');
 $array_config['readme'] = strip_tags($array_config['readme']);
 $array_config['is_resume'] = $nv_Request->get_int('is_resume', 'post', 0);
 $array_config['max_speed'] = $nv_Request->get_int('max_speed', 'post', 0);
 $array_config['tags_alias'] = $nv_Request->get_int('tags_alias', 'post', 0);
 $_groups_post = $nv_Request->get_array('groups_addfile', 'post', array());
 $array_config['groups_addfile'] = !empty($_groups_post) ? implode(',', nv_groups_post(array_intersect($_groups_post, array_keys($groups_list)))) : '';
 $_groups_post = $nv_Request->get_array('groups_upload', 'post', array());
 $array_config['groups_upload'] = !empty($_groups_post) ? implode(',', nv_groups_post(array_intersect($_groups_post, array_keys($groups_list)))) : '';
 if ($array_config['maxfilesize'] <= 0 or $array_config['maxfilesize'] > NV_UPLOAD_MAX_FILESIZE) {
     $array_config['maxfilesize'] = NV_UPLOAD_MAX_FILESIZE;
 } else {
     $array_config['maxfilesize'] = intval($array_config['maxfilesize'] * 1048576);
 }
 $array_config['upload_filetype'] = !empty($array_config['upload_filetype']) ? implode(',', $array_config['upload_filetype']) : '';
 $sth = $db->prepare('UPDATE ' . NV_MOD_TABLE . '_config SET config_value = :config_value WHERE config_name = :config_name');
 foreach ($array_config as $config_name => $config_value) {
     if ($config_name != 'readme') {
         $sth->bindParam(':config_name', $config_name, PDO::PARAM_STR);
         $sth->bindParam(':config_value', $config_value, PDO::PARAM_STR);
         $sth->execute();
     }
 }
 if (!empty($array_config['readme'])) {
 $array['filesize'] = $nv_Request->get_int('filesize', 'post', 0);
 $array['fileimage'] = $row['fileimage'];
 // Lay duong dan day du hinh cu
 if (!empty($array['fileimage'])) {
     if (!preg_match('#^(http|https|ftp|gopher)\\:\\/\\/#', $array['fileimage'])) {
         $array['fileimage'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . $array['fileimage'];
     }
 }
 $array['fileimage2'] = $nv_Request->get_title('fileimage2', 'post', '');
 $array['copyright'] = $nv_Request->get_title('copyright', 'post', '', 1);
 $_groups_post = $nv_Request->get_array('groups_view', 'post', array());
 $array['groups_view'] = !empty($_groups_post) ? implode(',', nv_groups_post(array_intersect($_groups_post, array_keys($groups_list)))) : '';
 $_groups_post = $nv_Request->get_array('groups_download', 'post', array());
 $array['groups_download'] = !empty($_groups_post) ? implode(',', nv_groups_post(array_intersect($_groups_post, array_keys($groups_list)))) : '';
 $_groups_post = $nv_Request->get_array('groups_comment', 'post', array());
 $array['groups_comment'] = !empty($_groups_post) ? implode(',', nv_groups_post(array_intersect($_groups_post, array_keys($groups_list)))) : '';
 // Sort image
 if (!empty($array['fileimage'])) {
     if (!preg_match('#^(http|https|ftp|gopher)\\:\\/\\/#', $array['fileimage'])) {
         $array['fileimage'] = substr($array['fileimage'], strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR));
     }
 }
 if (!empty($array['fileimage2'])) {
     if (!preg_match('#^(http|https|ftp|gopher)\\:\\/\\/#', $array['fileimage2'])) {
         $array['fileimage2'] = substr($array['fileimage2'], strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR));
     }
 }
 if (!empty($array['author_url'])) {
     if (!preg_match('#^(http|https|ftp|gopher)\\:\\/\\/#', $array['author_url'])) {
         $array['author_url'] = 'http://' . $array['author_url'];
     }
Exemple #6
0
         $row['title'] = str_replace('_', ' ', $matches[1] . ' ' . $matches[2]);
     }
 } else {
     $error[] = $lang_module['block_error_nsblock'];
 }
 $row['link'] = $nv_Request->get_title('link', 'post', '');
 $row['template'] = nv_substr($nv_Request->get_title('template', 'post', '', 0), 0, 55);
 $row['position'] = nv_substr($nv_Request->get_title('position', 'post', '', 0), 0, 55);
 if (preg_match('/^([0-9]{1,2})\\/([0-9]{1,2})\\/([0-9]{4})$/', $nv_Request->get_string('exp_time', 'post'), $m)) {
     $row['exp_time'] = mktime(0, 0, 0, $m[2], $m[1], $m[3]);
 } else {
     $row['exp_time'] = 0;
 }
 $row['active'] = $nv_Request->get_int('active', 'post', 0);
 $groups_view = $nv_Request->get_array('groups_view', 'post', array());
 $row['groups_view'] = !empty($groups_view) ? implode(',', nv_groups_post(array_intersect($groups_view, array_keys($groups_list)))) : '';
 $all_func = ($nv_Request->get_int('all_func', 'post') == 1 and ((preg_match($global_config['check_block_module'], $row['file_name']) or preg_match($global_config['check_block_theme'], $row['file_name'])) and preg_match('/^global\\.([a-zA-Z0-9\\-\\_\\.]+)\\.php$/', $row['file_name']))) ? 1 : 0;
 $array_funcid_post = $nv_Request->get_array('func_id', 'post');
 if (empty($all_func) and empty($array_funcid_post)) {
     $error[] = $lang_module['block_no_func'];
 }
 $row['leavegroup'] = $nv_Request->get_int('leavegroup', 'post', 0);
 if (!empty($row['leavegroup']) and !empty($row['bid'])) {
     $all_func = 0;
     $row['leavegroup'] = 1;
 } else {
     $row['leavegroup'] = 0;
 }
 $row['all_func'] = $all_func;
 $row['config'] = '';
 if (!empty($path_file_php) and !empty($path_file_ini)) {
Exemple #7
0
            $error['name'] = $lang_module['album_error_name'];
        }
        if (empty($data['folder'])) {
            $error['folder'] = $lang_module['album_error_folder'];
        }
        if (empty($data['category_id'])) {
            $error['category'] = $lang_module['album_error_category'];
        }
        if (!empty($error) && !isset($error['warning'])) {
            $error['warning'] = $lang_module['album_error_warning'];
        }
        $_groups_post = $nv_Request->get_array('groups_view', 'post', array());
        $data['groups_view'] = !empty($_groups_post) ? implode(',', nv_groups_post(array_intersect($_groups_post, array_keys($groups_list)))) : '';
        $data['author'] = $admin_info['userid'];
        $_allow_cmm = $nv_Request->get_array('allow_comment', 'post', array());
        $data['allow_comment'] = !empty($_allow_cmm) ? implode(',', nv_groups_post(array_intersect($_allow_cmm, array_keys($groups_list)))) : '';
        if (!empty($data['folder']) && !is_dir(NV_ROOTDIR . '/' . $currentpath . '/' . $data['folder'])) {
            $mkdir = nv_mkdir(NV_ROOTDIR . '/' . $currentpath, $data['folder']);
            if ($mkdir[0] == 0) {
                $error['warning'] = $lang_module['album_error_create_folder'];
            } else {
                $db->query("INSERT IGNORE INTO " . NV_UPLOAD_GLOBALTABLE . "_dir (dirname, time) VALUES ('" . $currentpath . '/' . $data['folder'] . "', 0)");
            }
        }
        $data['alias'] = strtolower($data['alias']);
        if (empty($error)) {
            $mime = nv_parse_ini_file(NV_ROOTDIR . '/includes/ini/mime.ini', true);
            if ($data['album_id'] == 0) {
                $stmt = $db->prepare('INSERT INTO ' . TABLE_PHOTO_NAME . '_album SET 
					category_id = ' . intval($data['category_id']) . ', 
					status=' . intval($data['status']) . ', 
Exemple #8
0
    $data['active_gift'] = $nv_Request->get_int('active_gift', 'post', 0);
    $data['active_warehouse'] = $nv_Request->get_int('active_warehouse', 'post', 0);
    $data['tags_alias'] = $nv_Request->get_int('tags_alias', 'post', 0);
    $data['auto_tags'] = $nv_Request->get_int('auto_tags', 'post', 0);
    $data['tags_remind'] = $nv_Request->get_int('tags_remind', 'post', 0);
    $data['point_active'] = $nv_Request->get_int('point_active', 'post', 0);
    $data['point_conversion'] = $nv_Request->get_string('point_conversion', 'post', 0);
    $data['point_new_order'] = $nv_Request->get_string('point_new_order', 'post', 0);
    $data['review_active'] = $nv_Request->get_int('review_active', 'post', 0);
    $data['review_check'] = $nv_Request->get_int('review_check', 'post', 0);
    $data['review_captcha'] = $nv_Request->get_int('review_captcha', 'post', 0);
    $data['group_price'] = $nv_Request->get_textarea('group_price', '', 'br');
    $data['template_active'] = $nv_Request->get_int('template_active', 'post', 0);
    $data['download_active'] = $nv_Request->get_int('download_active', 'post', 0);
    $_dowload_groups = $nv_Request->get_array('download_groups', 'post', array());
    $data['download_groups'] = !empty($_dowload_groups) ? implode(',', nv_groups_post(array_intersect($_dowload_groups, array_keys($groups_list_default)))) : '';
    if ($error == '') {
        foreach ($data as $config_name => $config_value) {
            $db->query("REPLACE INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES('" . NV_LANG_DATA . "', " . $db->quote($module_name) . ", " . $db->quote($config_name) . ", " . $db->quote($config_value) . ")");
        }
        $mid = intval($currencies_array[$data['money_unit']]['numeric']);
        $sql = "UPDATE " . $db_config['prefix'] . "_" . $module_data . "_money_" . NV_LANG_DATA . " SET exchange = '1' WHERE id = " . $mid;
        $db->query($sql);
        nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['setting'], "Setting", $admin_info['userid']);
        nv_del_moduleCache('settings');
        nv_del_moduleCache($module_name);
        Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . '=setting');
        die;
    }
}
$array_setting_payment = array();
Exemple #9
0
 $array_config['nv_unick_type'] = $nv_Request->get_int('nv_unick_type', 'post', 0);
 $array_config['allowmailchange'] = $nv_Request->get_int('allowmailchange', 'post', 0);
 $array_config['allowuserpublic'] = $nv_Request->get_int('allowuserpublic', 'post', 0);
 $array_config['allowquestion'] = $nv_Request->get_int('allowquestion', 'post', 0);
 $array_config['allowloginchange'] = $nv_Request->get_int('allowloginchange', 'post', 0);
 $array_config['allowuserlogin'] = $nv_Request->get_int('allowuserlogin', 'post', 0);
 $array_config['allowuserloginmulti'] = $nv_Request->get_int('allowuserloginmulti', 'post', 0);
 $array_config['allowuserreg'] = $nv_Request->get_int('allowuserreg', 'post', 0);
 $array_config['is_user_forum'] = $nv_Request->get_int('is_user_forum', 'post', 0);
 $array_config['openid_servers'] = $nv_Request->get_typed_array('openid_servers', 'post', 'string');
 $array_config['openid_servers'] = !empty($array_config['openid_servers']) ? implode(',', $array_config['openid_servers']) : '';
 $array_config['openid_processing'] = $nv_Request->get_int('openid_processing', 'post', 0);
 $array_config['user_check_pass_time'] = 60 * $nv_Request->get_int('user_check_pass_time', 'post');
 $array_config['auto_login_after_reg'] = $nv_Request->get_int('auto_login_after_reg', 'post', 0);
 $array_config['whoviewuser'] = $nv_Request->get_typed_array('whoviewuser', 'post', 'int', array());
 $array_config['whoviewuser'] = !empty($array_config['whoviewuser']) ? implode(',', nv_groups_post(array_intersect($array_config['whoviewuser'], array_keys($groups_list)))) : '';
 if ($array_config['user_check_pass_time'] < 120) {
     $array_config['user_check_pass_time'] = 120;
 }
 $sth = $db->prepare("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = :config_value WHERE lang = 'sys' AND module = 'global' AND config_name = :config_name");
 foreach ($array_config as $config_name => $config_value) {
     $sth->bindParam(':config_name', $config_name, PDO::PARAM_STR, 30);
     $sth->bindParam(':config_value', $config_value, PDO::PARAM_STR);
     $sth->execute();
 }
 $array_config['name_show'] = $nv_Request->get_int('name_show', 'post', 0);
 $sth = $db->prepare("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = :config_value WHERE lang = '" . NV_LANG_DATA . "' AND module = 'global' AND config_name = :config_name");
 $sth->bindValue(':config_name', 'name_show', PDO::PARAM_STR);
 $sth->bindParam(':config_value', $array_config['name_show'], PDO::PARAM_INT);
 $sth->execute();
 // Cau hinh kich thuoc avatar
Exemple #10
0
 $array_config = array();
 $array_config['emailcomm'] = $nv_Request->get_int('emailcomm', 'post', 0);
 $array_config['auto_postcomm'] = $nv_Request->get_int('auto_postcomm', 'post', 0);
 $array_config['activecomm'] = $nv_Request->get_int('activecomm', 'post', 0);
 $array_config['sortcomm'] = $nv_Request->get_int('sortcomm', 'post', 0);
 $array_config['captcha'] = $nv_Request->get_int('captcha', 'post', 0);
 $_groups_com = $nv_Request->get_array('allowed_comm', 'post', array());
 if (in_array(-1, $_groups_com)) {
     $array_config['allowed_comm'] = '-1';
 } else {
     $array_config['allowed_comm'] = !empty($_groups_com) ? implode(',', nv_groups_post(array_intersect($_groups_com, array_keys($groups_list)))) : '';
 }
 $_groups_com = $nv_Request->get_array('view_comm', 'post', array());
 $array_config['view_comm'] = !empty($_groups_com) ? implode(',', nv_groups_post(array_intersect($_groups_com, array_keys($groups_list)))) : '';
 $_groups_com = $nv_Request->get_array('setcomm', 'post', array());
 $array_config['setcomm'] = !empty($_groups_com) ? implode(',', nv_groups_post(array_intersect($_groups_com, array_keys($groups_list)))) : '';
 $admins_mod_name = explode(',', $site_mod_comm[$mod_name]['admins']);
 $admins_module_name = explode(',', $site_mods[$module_name]['admins']);
 $admins_module_name = array_unique(array_merge($admins_mod_name, $admins_module_name));
 $adminscomm = $nv_Request->get_typed_array('adminscomm', 'post', 'int');
 $adminscomm = array_intersect($adminscomm, $admins_module_name);
 $array_config['adminscomm'] = implode(',', $adminscomm);
 $sth = $db->prepare("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = :config_value WHERE lang = '" . NV_LANG_DATA . "' and module = :module_name and config_name = :config_name");
 $sth->bindParam(':module_name', $mod_name, PDO::PARAM_STR);
 foreach ($array_config as $config_name => $config_value) {
     $sth->bindParam(':config_name', $config_name, PDO::PARAM_STR);
     $sth->bindParam(':config_value', $config_value, PDO::PARAM_STR);
     $sth->execute();
 }
 nv_del_moduleCache('settings');
 Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&rand=' . nv_genpass());