Example #1
0
     $error_messages .= getpart('addnews_err', array(lang('Some fields can not be blank') . ': ' . implode(', ', $optfields)));
 }
 if (trim($title) == false) {
     $error_messages .= getpart('addnews_err', array(lang("The title can not be blank")));
 }
 if (trim($short_story) == false) {
     $error_messages .= getpart('addnews_err', array(lang("The story can not be blank")));
 }
 if ($member_db[UDB_CBYEMAIL] == 1) {
     $added_by_email = $member_db[UDB_EMAIL];
 } else {
     $added_by_email = "none";
 }
 // avatar check
 if ($manual_avatar) {
     $manual_avatar = check_avatar($manual_avatar);
     if ($manual_avatar == false) {
         $error_messages .= getpart('addnews_err', array(lang('Avatar not uploaded!')));
     }
 }
 // Additional fields ---
 foreach ($cfg['more_fields'] as $i => $v) {
     $pack = edit_option($pack, $i, $_REQUEST[$i]);
 }
 // Preview tool
 $preview_hmtl = false;
 if (isset($preview) && $preview == 'preview') {
     $new[NEW_ID] = time();
     $new[NEW_USER] = $member_db[2];
     $new[NEW_TITLE] = $title;
     $new[NEW_SHORT] = $short_story;
Example #2
0
     $error_messages .= getpart('addnews_err', array(lang('Some fields cannot be blank') . ': ' . implode(', ', $optfields)));
 }
 if (trim($title) == false) {
     $error_messages .= getpart('addnews_err', array(lang("The title cannot be blank")));
 }
 if (trim($short_story) == false) {
     $error_messages .= getpart('addnews_err', array(lang("The story cannot be blank")));
 }
 if ($member_db[UDB_CBYEMAIL] == 1) {
     $added_by_email = $member_db[UDB_EMAIL];
 } else {
     $added_by_email = "none";
 }
 // avatar check
 if ($manual_avatar) {
     $check_result = check_avatar($manual_avatar);
     if ($check_result['is_loaded'] == false) {
         $error_messages .= getpart('addnews_err', array(lang('Avatar not uploaded!') . ' ' . $check_result['error_msg']));
     }
     $manual_avatar = $check_result['path'];
 }
 if ($config_use_avatar == 'yes') {
     if (!create_avatar_size_in_mf($_avatar_width, '_avatar_width', 'Avatar width')) {
         $error_messages .= getpart('addnews_err', array(lang('Avatar width may consist only digits and % or px on the end')));
     }
     if (!create_avatar_size_in_mf($_avatar_height, '_avatar_height', 'Avatar height')) {
         $error_messages .= getpart('addnews_err', array(lang('Avatar height may consist only digits and % or px on the end')));
     }
 }
 // Additional fields ---
 foreach ($cfg['more_fields'] as $i => $v) {
Example #3
0
         }
         generate_users_info_cache();
         // Check if the bans table was updated and regenerate the bans cache when needed
         if (isset($bans_updated)) {
             generate_bans_cache();
         }
     }
     !empty($_GET['id']) ? redirect('settings.php?id=' . $id) : redirect('settings.php');
 }
 if ($luna_user['g_set_title'] == '1') {
     $title_field = '<input type="text" class="form-control" name="title" value="' . luna_htmlspecialchars($user['title']) . '" maxlength="50" />';
 }
 $avatar_field = '<a class="btn btn-primary" href="#" data-toggle="modal" data-target="#newavatar">' . __('Change avatar', 'luna') . '</a>';
 $avatar_user = draw_user_avatar($id, true, 'visible-lg-inline');
 $avatar_user_card = draw_user_avatar($id);
 $avatar_set = check_avatar($id);
 if ($avatar_user && $avatar_set) {
     $avatar_field .= ' <a class="btn btn-primary" href="settings.php?action=delete_avatar&amp;id=' . $id . '">' . __('Delete avatar', 'luna') . '</a>';
 } else {
     $avatar_field = '<a class="btn btn-primary" href="#" data-toggle="modal" data-target="#newavatar">' . __('Upload avatar', 'luna') . '</a>';
 }
 if ($user['signature'] != '') {
     $signature_preview = $parsed_signature;
 } else {
     $signature_preview = __('No signature currently stored in profile.', 'luna');
 }
 $user_username = luna_htmlspecialchars($user['username']);
 $user_usertitle = get_title($user);
 $page_title = array(luna_htmlspecialchars($luna_config['o_board_title']), __('Profile', 'luna'), __('Settings', 'luna'));
 define('FORUM_ACTIVE_PAGE', 'me');
 require load_page('header.php');
     */
    if (!preg_match("/^(http|https|ftp):\\/\\//i", $url)) {
        return $default;
    }
    /*
     * done all we can at this point!
     */
    $url = str_replace(' ', '%20', $url);
    return $url;
}
$action = isset($_POST["action"]) ? $_POST["action"] : '';
$updateset = array();
if ($action == "avatar") {
    // ///////////avatar check
    $avatars = $_POST['avatars'] != '' ? 'yes' : 'no';
    $avatar = check_avatar($_POST['avatar']);
    $updateset[] = 'avatars = ' . sqlesc($avatars);
    $updateset[] = 'avatar = ' . sqlesc($avatar);
    // //////custom-title check/////////////////
    if (isset($_POST["title"]) && $CURUSER["class"] >= UC_VIP && ($title = $_POST["title"]) != $CURUSER["title"]) {
        $ctnotallow = array("sysop", "administrator", "admin", "mod", "moderator", "vip", "m**********r");
        if (in_array(strtolower($title), $ctnotallow)) {
            bark("Error, Invalid custom title!");
        }
        $updateset[] = "title = " . sqlesc($title);
    }
    /*
    if(isset($_POST["title"]) && ($CURUSER["donor"] === "yes" || $CURUSER["class"] >= UC_MODERATOR) && ($title = $_POST["title"]) != $CURUSER["title"]) {
    $ctnotallow = array("sysop", "administrator", "admin", "mod", "moderator", "vip", "m**********r");
    if (in_array(strtolower($title), ($ctnotallow)))
    bark("Error, Invalid custom title!");
Example #5
0
 }
 if (trim($title) == "" and $ifdelete != "yes") {
     $error_messages .= getpart('addnews_err', array(lang("The title can not be blank"), "#GOBACK"));
 }
 if ($short_story == "" and $ifdelete != "yes") {
     $error_messages .= getpart('addnews_err', array(lang("The story can not be blank"), "#GOBACK"));
 }
 // Some replaces
 $use_html = $if_use_html == "yes" || $use_wysiwyg ? 1 : 0;
 $short_story = replace_news("add", $short_story, $use_html);
 $full_story = replace_news("add", $full_story, $use_html);
 $title = stripslashes(preg_replace(array("'\\|'", "'\n'", "''"), array("I", "<br />", ""), $title));
 $avatar = stripslashes(preg_replace(array("'\\|'", "'\n'", "''"), array("I", "<br />", ""), $avatar));
 // Check avatar
 if ($editavatar) {
     $editavatar = check_avatar($editavatar);
     if ($editavatar == false) {
         $error_messages .= getpart('addnews_err', array(lang('Avatar not uploaded'), '#GOBACK'));
     }
 }
 // *************************************************
 // EDIT ONLY IF ALL CORRECT!
 // *************************************************
 if ($error_messages == false) {
     // select news and comment files
     if ($source == "") {
         $news_file = SERVDIR . "/cdata/news.txt";
         $com_file = SERVDIR . "/cdata/comments.txt";
     } elseif ($source == "postponed") {
         $news_file = SERVDIR . "/cdata/postponed_news.txt";
         $com_file = SERVDIR . "/cdata/comments.txt";
Example #6
0
     $error_messages .= getpart('addnews_err', array(lang("The story cannot be blank"), "#GOBACK"));
 }
 // Some replaces
 $use_html = $if_use_html == "yes" || $use_wysiwyg ? 1 : 0;
 $short_story = replace_news("add", $short_story, $use_html);
 $full_story = replace_news("add", $full_story, $use_html);
 $title = stripslashes(preg_replace(array("'\\|'", "'\n'", "''"), array("I", "<br />", ""), $title));
 $avatar = stripslashes(preg_replace(array("'\\|'", "'\n'", "''"), array("I", "<br />", ""), $avatar));
 // HTML saved if force or use wysiwig
 if ($if_use_html == "yes" || $use_wysiwyg) {
     $use_html = true;
     $options = edit_option($options, 'use_html', true);
 }
 // Check avatar
 if ($editavatar) {
     $check_result = check_avatar($editavatar);
     if ($check_result['is_loaded'] == false) {
         $error_messages .= getpart('addnews_err', array(lang('Avatar not uploaded!') . ' ' . $check_result['error_msg'], '#GOBACK'));
     }
     $editavatar = $check_result['path'];
 }
 // Preview tool
 $preview_hmtl = false;
 if (isset($preview) && $preview == 'preview') {
     $new[NEW_ID] = time() + $config_date_adjust * 60;
     $new[NEW_USER] = $member_db[2];
     $new[NEW_TITLE] = $title;
     $new[NEW_SHORT] = $short_story;
     $new[NEW_FULL] = $full_story;
     $new[NEW_AVATAR] = $manual_avatar;
     $new[NEW_CAT] = $nice_category;