diff --git a/upload/ajax/edit_user_profile.php b/upload/ajax/edit_user_profile.php index 15b41855c..640f8d548 100644 --- a/upload/ajax/edit_user_profile.php +++ b/upload/ajax/edit_user_profile.php @@ -88,6 +88,23 @@ switch ($field) $this->response['new_value'] = $this->request['value']; break; + case 'user_icq': + $value = (int) $value; + if ($value && !preg_match('#^\d{6,15}$#', $value)) + { + $this->ajax_die('Поле "ICQ" может содержать только номер icq'); + } + $this->response['new_value'] = $this->request['value']; + break; + + case 'user_skype': + if ($value && !preg_match("#^[a-zA-Z0-9_.\-@,]{6,32}$#", $value)) + { + $this->ajax_die($lang['SKYPE_ERROR']); + } + $this->response['new_value'] = $this->request['value']; + break; + case 'user_from': case 'user_occ': case 'user_interests': diff --git a/upload/includes/functions_post.php b/upload/includes/functions_post.php index c8faf827a..84fa13d35 100644 --- a/upload/includes/functions_post.php +++ b/upload/includes/functions_post.php @@ -660,9 +660,6 @@ function insert_post ($mode, $topic_id, $forum_id = '', $old_forum_id = '', $new $post_username = $post_subject = $post_text = $poster_ip = ''; - $enable_bbcode = $enable_smilies = 0; - $enable_sig = 1; - $post_time = $current_time = time(); $username = $userdata['username']; $user_id = $userdata['user_id']; @@ -721,8 +718,8 @@ function insert_post ($mode, $topic_id, $forum_id = '', $old_forum_id = '', $new return; } - $post_columns = 'topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_smilies, enable_sig'; - $post_values = "$topic_id, $forum_id, $poster_id, '$post_username', $post_time, '$poster_ip', $enable_bbcode, $enable_smilies, $enable_sig"; + $post_columns = 'topic_id, forum_id, poster_id, post_username, post_time, poster_ip'; + $post_values = "$topic_id, $forum_id, $poster_id, '$post_username', $post_time, '$poster_ip'"; DB()->query("INSERT INTO ". BB_POSTS ." ($post_columns) VALUES ($post_values)"); diff --git a/upload/includes/ucp/usercp_viewprofile.php b/upload/includes/ucp/usercp_viewprofile.php index 1a2142926..852c17b09 100644 --- a/upload/includes/ucp/usercp_viewprofile.php +++ b/upload/includes/ucp/usercp_viewprofile.php @@ -1,10 +1,6 @@ get('ranks')) $ranks = $datastore->get('ranks'); } $poster_rank = $rank_image = $rank_select = ''; - if ($user_rank = $profiledata['user_rank'] AND isset($ranks[$user_rank])) { $rank_image = ($ranks[$user_rank]['rank_image']) ? '' : ''; $poster_rank = $ranks[$user_rank]['rank_title']; } - if (IS_ADMIN) { $rank_select = array($lang['NO'] => 0); @@ -70,54 +62,31 @@ if (IS_ADMIN) $rank_select = build_select('rank-sel', $rank_select, $user_rank); } -$temp_url = append_sid("privmsg.php?mode=post&" . POST_USERS_URL . "=" . $profiledata['user_id']); -$pm_img = '' . $lang['SEND_PRIVATE_MESSAGE'] . ''; - -$location = ($profiledata['user_from']) ? $profiledata['user_from'] : ''; - -$pm = '' . $lang['SEND_PRIVATE_MESSAGE'] . ''; - -if ( bf($profiledata['user_opt'], 'user_opt', 'viewemail') || IS_ADMIN ) +if (bf($profiledata['user_opt'], 'user_opt', 'viewemail') || IS_ADMIN) { - $email_uri = ( $bb_cfg['board_email_form'] ) ? append_sid("profile.php?mode=email&" . POST_USERS_URL .'=' . $profiledata['user_id']) : 'mailto:' . $profiledata['user_email']; - $email_img = '' . $lang['SEND_EMAIL'] . ''; - $email = '' . $lang['SEND_EMAIL'] . ''; + $email_uri = ($bb_cfg['board_email_form']) ? append_sid('profile.php?mode=email&'. POST_USERS_URL .'='. $profiledata['user_id']) : 'mailto:'. $profiledata['user_email']; + $email = ''. $profiledata['user_email'] .''; } else { - $email_img = ''; $email = ''; } -$www_img = ( $profiledata['user_website'] ) ? '' . $lang['VISIT_WEBSITE'] . '' : ''; -$www = ( $profiledata['user_website'] ) ? '' . $profiledata['user_website'] . '' : ''; -if ( !empty($profiledata['user_icq']) ) -{ - $icq_status_img = ''; - $icq_img = '' . $lang['ICQ'] . ''; - $icq = '' . $profiledata['user_icq'] . ''; -} -else -{ - $icq_status_img = ''; - $icq_img = ''; - $icq = ''; -} + $temp_url = append_sid("search.php?search_author=1&uid={$profiledata['user_id']}"); -$search_img = '' . $lang['SEARCH_USER_POSTS'] . ''; -$search = '' . sprintf($lang['SEARCH_USER_POSTS'], $profiledata['username']) . ''; +$search = ''. sprintf($lang['SEARCH_USER_POSTS'], $profiledata['username']) .''; // Report // // Get report user module and create report link // -include(INC_DIR . "functions_report.php"); +include(INC_DIR ."functions_report.php"); $report_user = report_modules('name', 'report_user'); if ($report_user && $report_user->auth_check('auth_write')) { $template->assign_block_vars('switch_report_user', array()); $template->assign_vars(array( - 'U_REPORT_USER' => append_sid("report.php?mode=" . $report_user->mode . '&id=' . $profiledata['user_id']), + 'U_REPORT_USER' => append_sid('report.php?mode='. $report_user->mode .'&id='. $profiledata['user_id']), 'L_REPORT_USER' => $report_user->lang['WRITE_REPORT']) ); } @@ -132,22 +101,6 @@ if ($profiledata['user_id'] == $userdata['user_id'] || IS_ADMIN) display_upload_attach_box_limits($profiledata['user_id']); } -// IP Mod (c) Pandora -// Не админ у админа инфу смотреть не может -if ($profiledata['user_level'] == ADMIN && !IS_ADMIN) -{ - $reg_ip = $last_ip = 'скрыт'; -// Модератор у модератора, ИП не может смотерть (шифруемся) -} elseif ($profiledata['user_level'] == MOD && IS_MOD) -{ - $reg_ip = $last_ip = 'скрыт'; -// В иных случаях может -} else { - $reg_ip = decode_ip($profiledata['user_reg_ip']); - $last_ip = decode_ip($profiledata['user_last_ip']); -} -// IP Mod End - $signature = ($bb_cfg['allow_sig'] && $profiledata['user_sig']) ? $profiledata['user_sig'] : ''; if(bf($profiledata['user_opt'], 'user_opt', 'allow_sig')) @@ -173,34 +126,26 @@ $template->assign_vars(array( 'RANK_SELECT' => $rank_select, 'POSTS_PER_DAY' => $posts_per_day, 'POSTS' => $profiledata['user_posts'], - 'PERCENTAGE' => $percentage . '%', + 'PERCENTAGE' => $percentage .'%', 'POST_DAY_STATS' => sprintf($lang['USER_POST_DAY_STATS'], $posts_per_day), 'POST_PERCENT_STATS' => sprintf($lang['USER_POST_PCT_STATS'], $percentage), - 'SEARCH_IMG' => $search_img, 'SEARCH' => $search, - 'PM_IMG' => $pm_img, - 'PM' => $pm, - 'EMAIL_IMG' => $email_img, + 'PM' => ''. $lang['SEND_PRIVATE_MESSAGE'] .'', 'EMAIL' => $email, - 'WWW_IMG' => $www_img, - 'WWW' => $www, - 'ICQ_STATUS_IMG' => $icq_status_img, - 'ICQ_IMG' => $icq_img, - 'ICQ' => $icq, + 'WWW' => $profiledata['user_website'], + 'ICQ' => $profiledata['user_icq'], 'LAST_VISIT_TIME' => ($profiledata['user_lastvisit']) ? bb_date($profiledata['user_lastvisit']) : $lang['NEVER'], 'LAST_ACTIVITY_TIME' => ($profiledata['user_session_time']) ? bb_date($profiledata['user_session_time']) : $lang['NEVER'], - 'LOCATION' => $location, - - 'REG_IP' => $reg_ip, - 'LAST_IP' => $last_ip, + 'LOCATION' => ($profiledata['user_from']) ? $profiledata['user_from'] : '', 'USER_ACTIVE' => $profiledata['user_active'], - 'OCCUPATION' => ( $profiledata['user_occ'] ) ? $profiledata['user_occ'] : '', - 'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : '', - 'GENDER' => ( $profiledata['user_gender'] ) ? $lang['GENDER_SELECT'][$profiledata['user_gender']] : '', - 'BIRTHDAY' => ( $profiledata['user_birthday'] ) ? realdate($profiledata['user_birthday'], 'Y-m-d') : '', - 'AGE' => ( $profiledata['user_birthday'] ) ? birthday_age($profiledata['user_birthday']) : '', + 'OCCUPATION' => $profiledata['user_occ'], + 'INTERESTS' => $profiledata['user_interests'], + 'SKYPE' => $profiledata['user_skype'], + 'GENDER' => $lang['GENDER_SELECT'][$profiledata['user_gender']], + 'BIRTHDAY' => ($profiledata['user_birthday']) ? realdate($profiledata['user_birthday'], 'Y-m-d') : '', + 'AGE' => ($profiledata['user_birthday']) ? birthday_age($profiledata['user_birthday']) : '', 'AVATAR_IMG' => $avatar_img, 'L_VIEWING_PROFILE' => sprintf($lang['VIEWING_USER_PROFILE'], $profiledata['username']), diff --git a/upload/language/lang_english/lang_main.php b/upload/language/lang_english/lang_main.php index 90cbdb3b4..cf37b4a96 100644 --- a/upload/language/lang_english/lang_main.php +++ b/upload/language/lang_english/lang_main.php @@ -526,7 +526,7 @@ $lang['WEBSITE'] = 'Website'; $lang['LOCATION'] = 'Location'; $lang['CONTACT'] = 'Contact'; $lang['EMAIL_ADDRESS'] = 'E-mail address'; -$lang['SEND_PRIVATE_MESSAGE'] = 'Send private message'; +$lang['SEND_PRIVATE_MESSAGE'] = 'Send pm'; $lang['HIDDEN_EMAIL'] = '[ Hidden ]'; $lang['INTERESTS'] = 'Interests'; $lang['OCCUPATION'] = 'Occupation'; diff --git a/upload/language/lang_russian/lang_main.php b/upload/language/lang_russian/lang_main.php index f07c9ae68..cffad2cc9 100644 --- a/upload/language/lang_russian/lang_main.php +++ b/upload/language/lang_russian/lang_main.php @@ -531,7 +531,7 @@ $lang['WEBSITE'] = 'Сайт'; $lang['LOCATION'] = 'Откуда'; $lang['CONTACT'] = 'Как связаться с'; // Как связаться с Vasya_Poopkin $lang['EMAIL_ADDRESS'] = 'Адрес e-mail'; -$lang['SEND_PRIVATE_MESSAGE'] = 'Отправить личное сообщение'; +$lang['SEND_PRIVATE_MESSAGE'] = 'Отправить ЛС'; $lang['HIDDEN_EMAIL'] = '[ скрыт ]'; $lang['INTERESTS'] = 'Интересы'; $lang['OCCUPATION'] = 'Род занятий'; diff --git a/upload/templates/default/usercp_viewprofile.tpl b/upload/templates/default/usercp_viewprofile.tpl index 6ad09e6c5..2a2315f38 100644 --- a/upload/templates/default/usercp_viewprofile.tpl +++ b/upload/templates/default/usercp_viewprofile.tpl @@ -72,12 +72,15 @@ $(document).ready(function(){ {action: "edit_user_profile", id: "username"} +{action: "edit_user_profile", id: "user_email"} {action: "edit_user_profile", id: "user_regdate"} {action: "edit_user_profile", id: "user_lastvisit"} {action: "edit_user_profile", id: "user_from"} {action: "edit_user_profile", id: "user_website"} {action: "edit_user_profile", id: "user_occ"} {action: "edit_user_profile", id: "user_interests"} +{action: "edit_user_profile", id: "user_icq"} +{action: "edit_user_profile", id: "user_skype"} {action: "edit_user_profile", id: "user_gender", editableType: "yesno-gender"} {action: "edit_user_profile", id: "user_birthday"} @@ -123,23 +126,38 @@ $(document).ready(function(){

{L_CONTACT} {USERNAME}

- - +
+ - + - + - + - + - + + + + + + + +
{L_EMAIL_ADDRESS}:{EMAIL_IMG}{EMAIL}
{L_PRIVATE_MESSAGE}:{PM_IMG}{PM}
{L_ICQ}:{ICQ_IMG} + {ICQ} + + +
{L_SKYPE}: + {SKYPE} + + +
@@ -219,7 +237,7 @@ $(document).ready(function(){ {L_WEBSITE}: - {WWW} + {WWW} @@ -265,16 +283,6 @@ $(document).ready(function(){ {L_ACCESS_SRV_LOAD}: {IGNORE_SRV_LOAD} - - - {L_REG_IP} - {REG_IP} - - - {L_LAST_IP} - {LAST_IP} - -