示例#1
0
 function nv_block_data_config_html_submit($module, $lang_block)
 {
     $xhtml = filter_text_textarea('htmlcontent', '', NV_ALLOWED_HTML_TAGS);
     $return = array();
     $return['error'] = array();
     $return['config'] = array();
     $return['config']['htmlcontent'] = defined('NV_EDITOR') ? nv_editor_nl2br($xhtml) : nv_nl2br($xhtml, '<br />');
     return $return;
 }
示例#2
0
     $value = strip_tags($value, $allowed_html_tags);
     $value = nv_nl2br($value, '<br />');
     if ($row_f['match_type'] == 'regex') {
         if (!preg_match("/" . $row_f['match_regex'] . "/", $value)) {
             $error = sprintf($lang_module['field_match_type_error'], $row_f['title']);
         }
     } elseif ($row_f['match_type'] == 'callback') {
         if (function_exists($row_f['func_callback'])) {
             if (!call_user_func($row_f['func_callback'], $value)) {
                 $error = sprintf($lang_module['field_match_type_error'], $row_f['title']);
             }
         } else {
             $error = "error function not exists " . $row_f['func_callback'];
         }
     }
     $value = $row_f['question_type'] == 'textarea' ? nv_nl2br($value, '<br />') : nv_editor_nl2br($value);
     $strlen = nv_strlen($value);
     if ($strlen < $row_f['min_length'] or $strlen > $row_f['max_length']) {
         $error = sprintf($lang_module['field_min_max_error'], $row_f['title'], $row_f['min_length'], $row_f['max_length']);
     }
 } elseif ($row_f['question_type'] == 'checkbox' or $row_f['question_type'] == 'multiselect') {
     $temp_value = array();
     $row_f['question_choices'] = unserialize($row_f['question_choices']);
     foreach ($value as $value_i) {
         if (isset($row_f['question_choices'][$value_i])) {
             $temp_value[] = $value_i;
         }
     }
     $value = implode(',', $temp_value);
 } elseif ($row_f['question_type'] == 'select' or $row_f['question_type'] == 'radio') {
     $row_f['question_choices'] = unserialize($row_f['question_choices']);
示例#3
0
 $post['title'] = filter_text_input('title', 'post', '', 1);
 if (empty($post['title'])) {
     die($lang_module['title_empty']);
 }
 $_groupsList = $groupsList;
 if (isset($post['id'])) {
     unset($_groupsList[$post['id']]);
 }
 foreach ($_groupsList as $_group) {
     if (strcasecmp($_group['title'], $post['title']) == 0) {
         die(sprintf($lang_module['error_title_exists'], $post['title']));
     }
 }
 $post['content'] = nv_editor_filter_textarea('content', '', NV_ALLOWED_HTML_TAGS);
 $test_content = trim(strip_tags($post['content']));
 $post['content'] = !empty($test_content) ? nv_editor_nl2br($post['content']) : "";
 $post['exp_time'] = filter_text_input('exp_time', 'post', '');
 if (preg_match("/^([\\d]{1,2})\\.([\\d]{1,2})\\.([\\d]{4})\$/", $post['exp_time'], $matches)) {
     $post['exp_time'] = mktime(23, 59, 59, $matches[2], $matches[1], $matches[3]);
 } else {
     $post['exp_time'] = 0;
 }
 $post['public'] = $nv_Request->get_int('public', 'post', 0);
 if ($post['public'] != 1) {
     $post['public'] = 0;
 }
 if (isset($post['id'])) {
     $query = "UPDATE `" . NV_GROUPS_GLOBALTABLE . "` SET \n                    `title`=" . $db->dbescape($post['title']) . ", \n                    `content`=" . $db->dbescape($post['content']) . ", \n                    `exp_time`='" . $post['exp_time'] . "', \n                    `public`= " . $post['public'] . " \n                    WHERE `group_id`=" . $post['id'] . " LIMIT 1";
     $ok = $db->sql_query($query);
 } else {
     $query = "INSERT INTO `" . NV_GROUPS_GLOBALTABLE . "` \n                VALUES (NULL, " . $db->dbescape($post['title']) . ", \n                " . $db->dbescape($post['content']) . ", \n                " . NV_CURRENTTIME . ", \n                " . $post['exp_time'] . ", \n                '', " . $post['public'] . ", " . ($groupcount + 1) . ", 1);";
示例#4
0
$result = $db->sql_query($sql);
$numrows = $db->sql_numrows($result);
if ($numrows) {
    $mode = "edit";
    $row = $db->sql_fetchrow($result);
} else {
    $mode = "add";
    $row = array('content' => '');
}
$error = "";
if ($nv_Request->get_int('save', 'post') == 1) {
    $content = nv_editor_filter_textarea('content', '', NV_ALLOWED_HTML_TAGS);
    if (empty($content)) {
        $error = $lang_module['error_content'];
    } else {
        $content = nv_editor_nl2br($content);
        if ($mode == "edit") {
            $query = "UPDATE `" . NV_USERS_GLOBALTABLE . "_config` SET \n            `content`=" . $db->dbescape($content) . ", \n            `edit_time`='" . NV_CURRENTTIME . "' \n            WHERE `config` ='siteterms_" . NV_LANG_DATA . "'";
        } else {
            $query = "INSERT INTO `" . NV_USERS_GLOBALTABLE . "_config` VALUES( \n            'siteterms_" . NV_LANG_DATA . "', " . $db->dbescape($content) . ", " . NV_CURRENTTIME . ")";
        }
        $db->sql_query($query);
        if ($db->sql_affectedrows() > 0) {
            $error = $lang_module['saveok'];
        } else {
            $error = $lang_module['errorsave'];
        }
    }
} else {
    $content = nv_editor_br2nl($row['content']);
}
示例#5
0
 }
 if (empty($array['title'])) {
     $is_error = true;
     $error = $lang_module['faq_error_title'];
 } elseif ($is_exists) {
     $is_error = true;
     $error = $lang_module['faq_title_exists'];
 } elseif (empty($array['question'])) {
     $is_error = true;
     $error = $lang_module['faq_error_question'];
 } elseif (empty($array['answer'])) {
     $is_error = true;
     $error = $lang_module['faq_error_answer'];
 } else {
     $array['question'] = nv_nl2br($array['question'], "<br />");
     $array['answer'] = nv_editor_nl2br($array['answer']);
     if (defined('IS_EDIT')) {
         if ($array['catid'] != $row['catid']) {
             $sql = "SELECT MAX(weight) AS new_weight FROM `" . NV_PREFIXLANG . "_" . $module_data . "` WHERE `catid`=" . $array['catid'];
             $result = $db->sql_query($sql);
             list($new_weight) = $db->sql_fetchrow($result);
             $new_weight = (int) $new_weight;
             $new_weight++;
         } else {
             $new_weight = $row['weight'];
         }
         $sql = "UPDATE `" . NV_PREFIXLANG . "_" . $module_data . "` SET \r\n                `catid`=" . $array['catid'] . ", \r\n                `title`=" . $db->dbescape($array['title']) . ", \r\n                `alias`=" . $db->dbescape($alias) . ", \r\n                `question`=" . $db->dbescape($array['question']) . ", \r\n                `answer`=" . $db->dbescape($array['answer']) . ", \r\n                `weight`=" . $new_weight . " \r\n                WHERE `id`=" . $id;
         $result = $db->sql_query($sql);
         if (!$result) {
             $is_error = true;
             $error = $lang_module['faq_error_notResult'];
示例#6
0
 $alias = filter_text_input('alias', 'post', '', 1);
 $parentid = $nv_Request->get_int('parentid', 'post', 0);
 $alias = $alias == "" ? change_alias($title) : change_alias($alias);
 $url = filter_text_input('url', 'post', '');
 $image = filter_text_input('image', 'post', '');
 if (!nv_is_url($image) and file_exists(NV_DOCUMENT_ROOT . $image)) {
     $lu = strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . "/");
     if (substr($image, 0, $lu) == NV_BASE_SITEURL . NV_UPLOADS_DIR . "/") {
         $image = substr($image, $lu);
     }
 }
 $admin_phone = "";
 $admin_email = "";
 $note = "";
 $description = filter_text_textarea('description', '', NV_ALLOWED_HTML_TAGS);
 $description = defined('NV_EDITOR') ? nv_editor_nl2br($description) : nv_nl2br($description, '<br />');
 $status = $nv_Request->get_int('status', 'post') == 1 ? 1 : 0;
 //check url
 if (empty($url) || !nv_is_url($url) || !check_url($id, $url)) {
     $error = $lang_module['error_url'];
 } elseif (empty($title)) {
     $error = $lang_module['error_title'];
 } elseif (strip_tags($description) == "") {
     $error = $lang_module['error_description'];
 } else {
     if ($id > 0) {
         $query = "UPDATE `" . NV_PREFIXLANG . "_" . $module_data . "_rows` SET `catid`=" . $catid . ", `title`=" . $db->dbescape($title) . ", `alias` =  " . $db->dbescape($alias) . ", `url` =  " . $db->dbescape($url) . ", `urlimg` =  " . $db->dbescape($image) . ", `description`=" . $db->dbescape($description) . ", `edit_time` = UNIX_TIMESTAMP(), `status`=" . $status . " WHERE `id` =" . $id . "";
         $db->sql_query($query);
         if ($db->sql_affectedrows() > 0) {
             nv_insert_logs(NV_LANG_DATA, $module_name, 'log_edit_content', "id " . $id, $admin_info['userid']);
             Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "");
示例#7
0
    $action = NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=" . $op;
}
$error = "";
if (defined('NV_EDITOR')) {
    require_once NV_ROOTDIR . '/' . NV_EDITORSDIR . '/' . NV_EDITOR . '/nv.php';
}
if ($nv_Request->get_int('save', 'post') == '1') {
    $title = filter_text_input('title', 'post', '', 1);
    $alias = filter_text_input('alias', 'post', '', 1);
    $bodytext = nv_editor_filter_textarea('bodytext', '', NV_ALLOWED_HTML_TAGS);
    if (empty($title)) {
        $error = $lang_module['aabout9'];
    } elseif (strip_tags($bodytext) == "") {
        $error = $lang_module['aabout10'];
    } else {
        $bodytext = nv_editor_nl2br($bodytext);
        $alias = empty($alias) ? change_alias($title) : change_alias($alias);
        if (defined('IS_EDIT')) {
            nv_insert_logs(NV_LANG_DATA, $module_name, 'log_edit_about', "aboutid " . $id, $admin_info['userid']);
            $query = "UPDATE`" . NV_PREFIXLANG . "_" . $module_data . "` SET \r\n            `title`=" . $db->dbescape($title) . ", `alias` =  " . $db->dbescape($alias) . ", \r\n            `bodytext`=" . $db->dbescape($bodytext) . ", `keywords`='', `edit_time`=" . NV_CURRENTTIME . " WHERE `id` =" . $id;
        } else {
            list($weight) = $db->sql_fetchrow($db->sql_query("SELECT MAX(`weight`) FROM `" . NV_PREFIXLANG . "_" . $module_data . "`"));
            $weight = intval($weight) + 1;
            $query = "INSERT INTO `" . NV_PREFIXLANG . "_" . $module_data . "` VALUES (\r\n            NULL, " . $db->dbescape($title) . ", " . $db->dbescape($alias) . ", " . $db->dbescape($bodytext) . ", '', \r\n            " . $weight . ", " . $admin_info['admin_id'] . ", " . NV_CURRENTTIME . ", " . NV_CURRENTTIME . ", 1);";
            nv_insert_logs(NV_LANG_DATA, $module_name, 'log_add_about', " ", $admin_info['userid']);
        }
        $db->sql_query($query);
        nv_del_moduleCache($module_name);
        Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=main");
        die;
    }
示例#8
0
     $error = $lang_module['file_error_title'];
 } elseif ($is_exists) {
     $is_error = true;
     $error = $lang_module['file_title_exists'];
 } elseif (!empty($array['author_email']) and ($check_valid_email = nv_check_valid_email($array['author_email'])) != "") {
     $is_error = true;
     $error = $check_valid_email;
 } elseif (!empty($array['author_url']) and !nv_is_url($array['author_url'])) {
     $is_error = true;
     $error = $lang_module['file_error_author_url'];
 } elseif (empty($array['fileupload']) and empty($array['linkdirect'])) {
     $is_error = true;
     $error = $lang_module['file_error_fileupload'];
 } else {
     $array['introtext'] = !empty($array['introtext']) ? nv_nl2br($array['introtext'], "<br />") : "";
     $array['description'] = !empty($array['description']) ? nv_editor_nl2br($array['description']) : $array['introtext'];
     $array['fileupload'] = !empty($array['fileupload']) ? implode("[NV]", $array['fileupload']) : "";
     if (!empty($array['linkdirect'])) {
         $array['linkdirect'] = array_map("nv_nl2br", $array['linkdirect']);
         $array['linkdirect'] = implode("[NV]", $array['linkdirect']);
     } else {
         $array['linkdirect'] = "";
     }
     if (!in_array($array['who_comment'], array_keys($array_who))) {
         $array['who_comment'] = 0;
     }
     if (!in_array($array['who_view'], array_keys($array_who))) {
         $array['who_view'] = 0;
     }
     if (!in_array($array['who_download'], array_keys($array_who))) {
         $array['who_download'] = 0;
示例#9
0
/**
 * nv_editor_filter_textarea()
 *
 * @param string $inputname
 * @param string $default
 * @param string $allowed_html_tags
 * @param bool $save
 * @param string $nl2br_replacement
 * @return
 */
function nv_editor_filter_textarea($inputname, $default = '', $allowed_html_tags = '', $save = false, $nl2br_replacement = '<br />')
{
    global $nv_Request;
    $value = $nv_Request->get_string($inputname, 'post', $default);
    if (empty($value)) {
        return '';
    }
    if (!empty($allowed_html_tags) and !defined('NV_EDITOR')) {
        $allowed_html_tags = array_map("trim", explode(",", $allowed_html_tags));
        $allowed_html_tags = "<" . implode("><", $allowed_html_tags) . ">";
        $value = strip_tags($value, $allowed_html_tags);
    }
    if (empty($value)) {
        return '';
    }
    if ((bool) $save) {
        $value = nv_editor_nl2br($value, $nl2br_replacement);
    }
    return $value;
}
示例#10
0
     $error = $lang_module['file_error_title'];
 } elseif ($is_exists) {
     $is_error = true;
     $error = $lang_module['file_title_exists'];
 } elseif (!empty($array['author_email']) and ($check_valid_email = nv_check_valid_email($array['author_email'])) != "") {
     $is_error = true;
     $error = $check_valid_email;
 } elseif (!empty($array['author_url']) and !nv_is_url($array['author_url'])) {
     $is_error = true;
     $error = $lang_module['file_error_author_url'];
 } elseif (empty($array['fileupload']) and empty($array['linkdirect']) and empty($array['fileupload2'])) {
     $is_error = true;
     $error = $lang_module['file_error_fileupload'];
 } else {
     $alias = change_alias($array['title']);
     $array['description'] = nv_editor_nl2br($array['description']);
     $array['introtext'] = nv_nl2br($array['introtext'], "<br />");
     if (!in_array($array['who_comment'], array_keys($array_who))) {
         $array['who_comment'] = 0;
     }
     if (!in_array($array['who_view'], array_keys($array_who))) {
         $array['who_view'] = 0;
     }
     if (!in_array($array['who_download'], array_keys($array_who))) {
         $array['who_download'] = 0;
     }
     $array['groups_comment'] = !empty($array['groups_comment']) ? implode(',', $array['groups_comment']) : '';
     $array['groups_view'] = !empty($array['groups_view']) ? implode(',', $array['groups_view']) : '';
     $array['groups_download'] = !empty($array['groups_download']) ? implode(',', $array['groups_download']) : '';
     if ($row['user_id']) {
         $array['user_name'] = $row['user_name'];
示例#11
0
     $value = strip_tags($value, $allowed_html_tags);
     $value = nv_nl2br($value, '<br />');
     if ($row_f['match_type'] == 'regex') {
         if (!preg_match("/" . $row_f['match_regex'] . "/", $value)) {
             $error = sprintf($lang_module['field_match_type_error'], $row_f['title']);
         }
     } elseif ($row_f['match_type'] == 'callback') {
         if (function_exists($row_f['func_callback'])) {
             if (!call_user_func($row_f['func_callback'], $value)) {
                 $error = sprintf($lang_module['field_match_type_error'], $row_f['title']);
             }
         } else {
             $error = "error function not exists " . $row_f['func_callback'];
         }
     }
     $value = $row_f['field_type'] == 'textarea' ? nv_nl2br($value, '<br />') : nv_editor_nl2br($value);
     $strlen = nv_strlen($value);
     if ($strlen < $row_f['min_length'] or $strlen > $row_f['max_length']) {
         $error = sprintf($lang_module['field_min_max_error'], $row_f['title'], $row_f['min_length'], $row_f['max_length']);
     }
 } elseif ($row_f['field_type'] == 'checkbox' or $row_f['field_type'] == 'multiselect') {
     $temp_value = array();
     foreach ($value as $value_i) {
         if (isset($row_f['field_choices'][$value_i])) {
             $temp_value[] = $value_i;
         }
     }
     $value = implode(',', $temp_value);
 } elseif ($row_f['field_type'] == 'select' or $row_f['field_type'] == 'radio') {
     if (!isset($row_f['field_choices'][$value])) {
         $error = sprintf($lang_module['field_match_type_error'], $row_f['title']);
示例#12
0
 }
 $link = nv_htmlspecialchars($link);
 $template = filter_text_input('template', 'post', "", 1);
 $typeblock = filter_text_input('typeblock', 'post', "", 1);
 $xmodule = filter_text_input('module', 'post', "", 1);
 $xfile = filter_text_input('file', 'post', "", 1);
 $xbanner = $nv_Request->get_int('banner', 'post');
 $xrss = filter_text_input('xrss', 'post', "", 0);
 $rss_setting_number = $nv_Request->get_int('rss_setting_number', 'post', 0);
 $rss_setting_description = $nv_Request->get_int('rss_setting_description', 'post', 0);
 $rss_setting_html = $nv_Request->get_int('rss_setting_html', 'post', 0);
 $rss_setting_pubdate = $nv_Request->get_int('rss_setting_pubdate', 'post', 0);
 $rss_setting_target = $nv_Request->get_int('rss_setting_target', 'post', 0);
 $leavegroup = $nv_Request->get_int('leavegroup', 'post');
 $xhtml = filter_text_textarea('htmlcontent', '', NV_ALLOWED_HTML_TAGS);
 $xhtml = defined('NV_EDITOR') ? nv_editor_nl2br($xhtml) : nv_nl2br($xhtml, '<br />');
 if ($typeblock == "banner") {
     $file_path = $xbanner;
 } elseif ($typeblock == "html") {
     $file_path = $xhtml;
 } elseif ($typeblock == "rss") {
     $file_path = $xrss . "#@#" . $rss_setting_number . "#@#" . $rss_setting_description . "#@#" . $rss_setting_html . "#@#" . $rss_setting_pubdate . "#@#" . $rss_setting_target;
     $template = filter_text_input('templaterss', 'post', "", 0);
 } else {
     $file_path = $xfile;
 }
 if (empty($xfile) && empty($typeblock)) {
     $error[] = $lang_module['error_empty_content'];
 } elseif ($typeblock == "rss" and !nv_is_url($xrss)) {
     $error[] = $lang_module['block_rss_url_error'];
 }
示例#13
0
     $emin = $nv_Request->get_int('emin', 'post', 0);
     $form_data['end_time'] = mktime($ehour, $emin, 0, $m[2], $m[1], $m[3]);
 } else {
     $form_data['end_time'] = 0;
 }
 $_groups_post = $nv_Request->get_array('groups_view', 'post', 6);
 $form_data['groups_view'] = !empty($_groups_post) ? implode(',', nv_groups_post(array_intersect($_groups_post, array_keys($groups_list)))) : '';
 if (empty($form_data['title'])) {
     $error = $lang_module['error_formtitle'];
 } elseif (!empty($form_data['start_time']) and !empty($form_data['end_time'])) {
     if ($form_data['start_time'] > $form_data['end_time']) {
         $error = $lang_module['error_formtime'];
     }
 }
 if (empty($error)) {
     $form_data['description'] = nv_editor_nl2br($form_data['description']);
     if ($id) {
         $sql = 'UPDATE ' . NV_PREFIXLANG . '_' . $module_data . ' SET title = :title, alias = :alias, description = :description, start_time = :start_time, end_time = :end_time, groups_view = :groups_view, question_display = :question_display WHERE id =' . $id;
     } else {
         $weight = $db->query("SELECT MAX(weight) FROM " . NV_PREFIXLANG . "_" . $module_data)->fetchColumn();
         $weight = intval($weight) + 1;
         $sql = 'INSERT INTO ' . NV_PREFIXLANG . '_' . $module_data . ' (title, alias, description, start_time, end_time, groups_view, question_display, weight, add_time, status) VALUES (:title, :alias, :description, :start_time, :end_time, :groups_view, :question_display, ' . $weight . ', ' . NV_CURRENTTIME . ', 1)';
     }
     $query = $db->prepare($sql);
     $query->bindParam(':title', $form_data['title'], PDO::PARAM_STR);
     $query->bindParam(':alias', $form_data['alias'], PDO::PARAM_STR);
     $query->bindParam(':description', $form_data['description'], PDO::PARAM_STR);
     $query->bindParam(':start_time', $form_data['start_time'], PDO::PARAM_STR);
     $query->bindParam(':end_time', $form_data['end_time'], PDO::PARAM_STR);
     $query->bindParam(':groups_view', $form_data['groups_view'], PDO::PARAM_STR);
     $query->bindParam(':question_display', $form_data['question_display'], PDO::PARAM_STR);
示例#14
0
 }
 if (!empty($obt_level)) {
     foreach ($obt_level as $admid) {
         $admins[$admid]['view_level'] = 1;
         if (!isset($admins[$admid]['reply_level'])) {
             $admins[$admid]['reply_level'] = 0;
         }
         $admins[$admid]['obt_level'] = 1;
     }
 }
 if (empty($full_name)) {
     $error = $lang_module['err_part_row_title'];
 } elseif (!empty($email) and !empty($check_valid_email)) {
     $error = $check_valid_email;
 } else {
     $note = nv_editor_nl2br($note);
     $admins_list = array();
     foreach ($adms as $admid => $values) {
         if ($values['level'] === 1) {
             $obt_level = isset($admins[$admid]) ? $admins[$admid]['obt_level'] : 0;
             $admins_list[] = $admid . '/1/1/' . $obt_level;
         } else {
             if (isset($admins[$admid])) {
                 $admins_list[] = $admid . '/' . $admins[$admid]['view_level'] . '/' . $admins[$admid]['reply_level'] . '/' . $admins[$admid]['obt_level'];
             }
         }
     }
     $admins_list = implode(";", $admins_list);
     if (defined('IS_EDIT')) {
         $query = "UPDATE`" . NV_PREFIXLANG . "_" . $module_data . "_rows` SET \r\n            `full_name`=" . $db->dbescape($full_name) . ", `phone` =  " . $db->dbescape($phone) . ", \r\n            `fax`=" . $db->dbescape($fax) . ", `email`=" . $db->dbescape($email) . ", \r\n            `note`=" . $db->dbescape($note) . ", `admins`=" . $db->dbescape($admins_list) . " WHERE `id` =" . $id;
         nv_insert_logs(NV_LANG_DATA, $module_name, 'log_edit_row', "rowid " . $id, $admin_info['userid']);
示例#15
0
                if ($id == 0) {
                    $num = $db->sql_numrows($adb->getAlbumImgs($data['albumid']));
                    if (empty($data['name'])) {
                        list($mo, $data['name']) = split('[/.]', $data['path']);
                        //
                    }
                    if ($adb->addNewImg($data['name'], $data['alias'], $data['path'], nv_editor_nl2br($data['description']), $thumb_name, $data['albumid'], $num + 1, $data['v_path'], $data['is_show'])) {
                        $adb->update_numphoto($data['albumid']);
                        $adb->freeResult();
                        Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=listimg&idb=" . $data['albumid']);
                        die;
                    } else {
                        $error = $lang_module['err_save_img'];
                    }
                } else {
                    if ($adb->updateImgInfo($data['pictureid'], $data['name'], $data['alias'], $data['path'], nv_editor_nl2br($data['description']), $thumb_name, $data['albumid'], $data['v_path'], $data['is_show'])) {
                        $adb->update_numphoto($data['albumid']);
                        $adb->freeResult();
                        Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=listimg&idb=" . $data['albumid']);
                        die;
                    } else {
                        $error = $lang_module['err_save_img'];
                    }
                }
            }
        }
    } else {
        $error = $lang_module['empt_album'];
    }
}
if (!empty($data['path']) and file_exists(NV_UPLOADS_REAL_DIR . "/" . $module_name . $data['path'])) {
示例#16
0
     }
     $array_config['site_keywords'] = !empty($array_config['site_keywords']) ? implode(", ", $array_config['site_keywords']) : "";
 }
 if (!nv_is_url($site_logo) and file_exists(NV_DOCUMENT_ROOT . $site_logo)) {
     $lu = strlen(NV_BASE_SITEURL);
     $array_config['site_logo'] = substr($site_logo, $lu);
 } elseif (!nv_is_url($site_logo)) {
     $array_config['site_logo'] = "images/logo.png";
 }
 $array_config['site_home_module'] = filter_text_input('site_home_module', 'post', '', 1, 255);
 $array_config['site_description'] = filter_text_input('site_description', 'post', '', 1, 255);
 $array_config['disable_site_content'] = nv_editor_filter_textarea('disable_site_content', '', NV_ALLOWED_HTML_TAGS);
 if (empty($array_config['disable_site_content'])) {
     $array_config['disable_site_content'] = $lang_global['disable_site_content'];
 }
 $array_config['disable_site_content'] = nv_editor_nl2br($array_config['disable_site_content']);
 foreach ($array_config as $config_name => $config_value) {
     $db->sql_query("REPLACE INTO `" . NV_CONFIG_GLOBALTABLE . "` (`lang`, `module`, `config_name`, `config_value`) VALUES('" . NV_LANG_DATA . "', 'global', " . $db->dbescape($config_name) . ", " . $db->dbescape($config_value) . ")");
 }
 nv_delete_all_cache();
 if (empty($errormess)) {
     Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_NAME_VARIABLE . '=' . $module_name . '&rand=' . nv_genpass());
     exit;
 } else {
     $sql = $db->constructQuery("SELECT `module`, `config_name`, `config_value` FROM `" . NV_CONFIG_GLOBALTABLE . "` \n        WHERE `lang`=[s] OR `lang`=[s] ORDER BY `module` ASC", 'sys', NV_LANG_DATA);
     $result = $db->sql_query($sql);
     while (list($c_module, $c_config_name, $c_config_value) = $db->sql_fetchrow($result)) {
         if ($c_module == "global") {
             $global_config[$c_config_name] = $c_config_value;
         } else {
             $module_config[$c_module][$c_config_name] = $c_config_value;