diff --git a/upload/admin/index.php b/upload/admin/index.php index 8fe3df312..735dbbc4c 100644 --- a/upload/admin/index.php +++ b/upload/admin/index.php @@ -304,7 +304,7 @@ else if( isset($_GET['pane']) && $_GET['pane'] == 'right' ) "IP_ADDRESS" => $reg_ip, "U_WHOIS_IP" => "http://ip-whois.net/ip_geo.php?ip=$reg_ip", - "U_USER_PROFILE" => append_sid("profile.php?mode=editprofile&" . POST_USERS_URL . "=" . $onlinerow_reg[$i]['user_id']), + "U_USER_PROFILE" => append_sid("../profile.php?mode=editprofile&" . POST_USERS_URL . "=" . $onlinerow_reg[$i]['user_id']), )); } } diff --git a/upload/attach_mod/includes/functions_includes.php b/upload/attach_mod/includes/functions_includes.php index 4e94da285..ca53ee7ca 100644 --- a/upload/attach_mod/includes/functions_includes.php +++ b/upload/attach_mod/includes/functions_includes.php @@ -1,6 +1,9 @@ page = 0; - - // Get the assigned Quota Limit. For Groups, we are directly getting the value, because this Quota can change from user to user. - if ($group_id) - { - $sql = 'SELECT l.quota_limit - FROM ' . BB_QUOTA . ' q, ' . BB_QUOTA_LIMITS . ' l - WHERE q.group_id = ' . (int) $group_id . ' - AND q.quota_type = ' . QUOTA_UPLOAD_LIMIT . ' - AND q.quota_limit_id = l.quota_limit_id - LIMIT 1'; - - if ( !($result = DB()->sql_query($sql)) ) - { - message_die(GENERAL_ERROR, 'Could not get Group Quota', '', __LINE__, __FILE__, $sql); - } - - if (DB()->num_rows($result) > 0) - { - $row = DB()->sql_fetchrow($result); - $attach_config['upload_filesize_limit'] = intval($row['quota_limit']); - DB()->sql_freeresult($result); - } - else - { - DB()->sql_freeresult($result); - - // Set Default Quota Limit - $quota_id = intval($attach_config['default_upload_quota']); - - if ($quota_id == 0) - { - $attach_config['upload_filesize_limit'] = $attach_config['attachment_quota']; - } - else - { - $sql = 'SELECT quota_limit - FROM ' . BB_QUOTA_LIMITS . ' - WHERE quota_limit_id = ' . (int) $quota_id . ' - LIMIT 1'; - - if ( !($result = DB()->sql_query($sql)) ) - { - message_die(GENERAL_ERROR, 'Could not get Quota Limit', '', __LINE__, __FILE__, $sql); - } - - if (DB()->num_rows($result) > 0) - { - $row = DB()->sql_fetchrow($result); - $attach_config['upload_filesize_limit'] = $row['quota_limit']; - } - else - { - $attach_config['upload_filesize_limit'] = $attach_config['attachment_quota']; - } - DB()->sql_freeresult($result); - } - } - } - else - { - if (is_array($profiledata)) - { - $attachments->get_quota_limits($profiledata, $user_id); - } - else - { - $attachments->get_quota_limits($userdata, $user_id); - } - } - - if (!$attach_config['upload_filesize_limit']) - { - $upload_filesize_limit = $attach_config['attachment_quota']; - } - else - { - $upload_filesize_limit = $attach_config['upload_filesize_limit']; - } - - if ($upload_filesize_limit == 0) - { - $user_quota = $lang['UNLIMITED']; - } - else - { - $size_lang = ($upload_filesize_limit >= 1048576) ? $lang['MB'] : ( ($upload_filesize_limit >= 1024) ? $lang['KB'] : $lang['BYTES'] ); - - if ($upload_filesize_limit >= 1048576) - { - $user_quota = (round($upload_filesize_limit / 1048576 * 100) / 100) . ' ' . $size_lang; - } - else if ($upload_filesize_limit >= 1024) - { - $user_quota = (round($upload_filesize_limit / 1024 * 100) / 100) . ' ' . $size_lang; - } - else - { - $user_quota = ($upload_filesize_limit) . ' ' . $size_lang; - } - } - - // Get all attach_id's the specific user posted, but only uploads to the board and not Private Messages - $sql = 'SELECT attach_id - FROM ' . BB_ATTACHMENTS . ' - WHERE user_id_1 = ' . (int) $user_id . ' - GROUP BY attach_id'; - - if ( !($result = DB()->sql_query($sql)) ) - { - message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql); - } - - $attach_ids = DB()->sql_fetchrowset($result); - $num_attach_ids = DB()->num_rows($result); - DB()->sql_freeresult($result); - $attach_id = array(); - - for ($j = 0; $j < $num_attach_ids; $j++) - { - $attach_id[] = intval($attach_ids[$j]['attach_id']); - } - - $upload_filesize = (sizeof($attach_id) > 0) ? get_total_attach_filesize($attach_id) : 0; - - $size_lang = ($upload_filesize >= 1048576) ? $lang['MB'] : ( ($upload_filesize >= 1024) ? $lang['KB'] : $lang['BYTES'] ); - - if ($upload_filesize >= 1048576) - { - $user_uploaded = (round($upload_filesize / 1048576 * 100) / 100) . ' ' . $size_lang; - } - else if ($upload_filesize >= 1024) - { - $user_uploaded = (round($upload_filesize / 1024 * 100) / 100) . ' ' . $size_lang; - } - else - { - $user_uploaded = ($upload_filesize) . ' ' . $size_lang; - } - - $upload_limit_pct = ( $upload_filesize_limit > 0 ) ? round(( $upload_filesize / $upload_filesize_limit ) * 100) : 0; - $upload_limit_img_length = ( $upload_filesize_limit > 0 ) ? round(( $upload_filesize / $upload_filesize_limit ) * $bb_cfg['privmsg_graphic_length']) : 0; - if ($upload_limit_pct > 100) - { - $upload_limit_img_length = $bb_cfg['privmsg_graphic_length']; - } - $upload_limit_remain = ( $upload_filesize_limit > 0 ) ? $upload_filesize_limit - $upload_filesize : 100; - - $l_box_size_status = sprintf($lang['UPLOAD_PERCENT_PROFILE'], $upload_limit_pct); - - $template->assign_block_vars('switch_upload_limits', array()); - - $template->assign_vars(array( - 'U_UACP' => BB_ROOT ."profile.php?mode=attachcp&u=$user_id&sid={$userdata['session_id']}", - 'UPLOADED' => sprintf($lang['USER_UPLOADED_PROFILE'], $user_uploaded), - 'QUOTA' => sprintf($lang['USER_QUOTA_PROFILE'], $user_quota), - 'UPLOAD_LIMIT_IMG_WIDTH' => $upload_limit_img_length, - 'UPLOAD_LIMIT_PERCENT' => $upload_limit_pct, - 'PERCENT_FULL' => $l_box_size_status, - )); -} - -/** -* Prune Attachments (includes/prune.php) -*/ -function prune_attachments($sql_post) -{ - delete_attachment($sql_post); } \ No newline at end of file diff --git a/upload/config.php b/upload/config.php index ec3f5c40e..1ee6d9788 100644 --- a/upload/config.php +++ b/upload/config.php @@ -57,7 +57,7 @@ $bb_cfg['css_ver'] = 1; // Increase number of revision after update $bb_cfg['tp_version'] = '2.1 Beta'; -$bb_cfg['tp_release_state'] = 'R205'; +$bb_cfg['tp_release_state'] = 'R206'; $bb_cfg['tp_release_date'] = '12-08-2011'; $bb_cfg['board_disabled_msg'] = 'форум временно отключен'; // 'forums temporarily disabled'; // show this msg if board has been disabled via ON/OFF trigger diff --git a/upload/includes/ucp/usercp_viewprofile.php b/upload/includes/ucp/usercp_viewprofile.php index 86d32abef..8c55c64f4 100644 --- a/upload/includes/ucp/usercp_viewprofile.php +++ b/upload/includes/ucp/usercp_viewprofile.php @@ -21,24 +21,6 @@ if(bf($profiledata['user_opt'], 'user_opt', 'view_profile') && IS_GUEST) { meta_refresh(append_sid("login.php?redirect={$_SERVER['REQUEST_URI']}", true)); bb_die("{$profiledata['username']} " . $lang['FORBADE_VIEWING']); } -// -// Calculate the number of days this user has been a member ($memberdays) -// Then calculate their posts per day -// -$regdate = $profiledata['user_regdate']; -$memberdays = max(1, round((TIMENOW - $regdate) / 86400)); -$posts_per_day = $profiledata['user_posts'] / $memberdays; - -// Get the users percentage of total posts -if ($profiledata['user_posts'] != 0) -{ - $total_posts = get_db_stat('postcount'); - $percentage = ($total_posts) ? min(100, ($profiledata['user_posts'] / $total_posts) * 100) : 0; -} -else -{ - $percentage = 0; -} $avatar_img = get_avatar($profiledata['user_avatar'], $profiledata['user_avatar_type'], !bf($profiledata['user_opt'], 'user_opt', 'allow_avatar')); if (!$ranks = $datastore->get('ranks')) @@ -62,7 +44,7 @@ if (IS_ADMIN) $rank_select = build_select('rank-sel', $rank_select, $user_rank); } -if (bf($profiledata['user_opt'], 'user_opt', 'viewemail') || IS_ADMIN) +if (bf($profiledata['user_opt'], 'user_opt', 'viewemail') || IS_AM) { $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'] .''; @@ -72,9 +54,6 @@ else $email = ''; } -$temp_url = append_sid("search.php?search_author=1&uid={$profiledata['user_id']}"); -$search = ''. sprintf($lang['SEARCH_USER_POSTS'], $profiledata['username']) .''; - // Report // // Get report user module and create report link @@ -95,11 +74,6 @@ if ($report_user && $report_user->auth_check('auth_write')) // // Generate page // -if ($profiledata['user_id'] == $userdata['user_id'] || IS_ADMIN) -{ - require(BB_ROOT .'attach_mod/attachment_mod.php'); - display_upload_attach_box_limits($profiledata['user_id']); -} $signature = ($bb_cfg['allow_sig'] && $profiledata['user_sig']) ? $profiledata['user_sig'] : ''; @@ -124,12 +98,7 @@ $template->assign_vars(array( 'POSTER_RANK' => $poster_rank, 'RANK_IMAGE' => $rank_image, 'RANK_SELECT' => $rank_select, - 'POSTS_PER_DAY' => $posts_per_day, 'POSTS' => $profiledata['user_posts'], - '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' => $search, 'PM' => ''. $lang['SEND_PRIVATE_MESSAGE'] .'', 'EMAIL' => $email, 'WWW' => $profiledata['user_website'], diff --git a/upload/language/lang_english/lang_main.php b/upload/language/lang_english/lang_main.php index c1b8614b1..3531bbdae 100644 --- a/upload/language/lang_english/lang_main.php +++ b/upload/language/lang_english/lang_main.php @@ -548,8 +548,6 @@ $lang['OCCUPATION'] = 'Occupation'; $lang['POSTER_RANK'] = 'Poster rank'; $lang['TOTAL_POSTS'] = 'Total posts'; -$lang['USER_POST_PCT_STATS'] = '%.2f%% of total'; // 1.25% of total -$lang['USER_POST_DAY_STATS'] = '%.2f posts per day'; // 1.5 posts per day $lang['SEARCH_USER_POSTS'] = 'Find posts'; // Find all posts by username $lang['SEARCH_USER_POSTS_SHORT'] = 'Find user posts'; $lang['SEARCH_USER_TOPICS'] = 'Find user topics'; // Find all topics by username @@ -1137,14 +1135,6 @@ $lang['NOTE_USER_EMPTY_GROUP_PERMISSIONS'] = 'NOTE:
You are normally allowe // Quota Variables $lang['UPLOAD_QUOTA'] = 'Upload Quota'; $lang['PM_QUOTA'] = 'PM Quota'; -$lang['USER_UPLOAD_QUOTA_REACHED'] = 'Sorry, you have reached your maximum Upload Quota Limit of %d %s'; // replace %d with Size, %s with Size Lang (MB for example) - -// User Attachment Control Panel -$lang['USER_ACP_TITLE'] = 'User ACP'; -$lang['UACP'] = 'User Attachment Control Panel'; -$lang['USER_UPLOADED_PROFILE'] = 'Uploaded: %s'; -$lang['USER_QUOTA_PROFILE'] = 'Quota: %s'; -$lang['UPLOAD_PERCENT_PROFILE'] = '%d%% of total'; // Common Variables $lang['BYTES'] = 'Bytes'; diff --git a/upload/language/lang_russian/lang_main.php b/upload/language/lang_russian/lang_main.php index 579c41f6d..d070ba6d5 100644 --- a/upload/language/lang_russian/lang_main.php +++ b/upload/language/lang_russian/lang_main.php @@ -553,8 +553,6 @@ $lang['OCCUPATION'] = 'Род занятий'; $lang['POSTER_RANK'] = 'Звание'; $lang['TOTAL_POSTS'] = 'Всего сообщений'; -$lang['USER_POST_PCT_STATS'] = '%.2f%% от общего числа'; // 15% of total -$lang['USER_POST_DAY_STATS'] = '%.2f сообщений в день'; // 1.5 posts per day $lang['SEARCH_USER_POSTS'] = 'Найти сообщения'; // Find all posts by username $lang['SEARCH_USER_POSTS_SHORT'] = 'Найти сообщения пользователя'; $lang['SEARCH_USER_TOPICS'] = 'Начатые темы'; // Find all topics by username @@ -1144,14 +1142,6 @@ $lang['NOTE_USER_EMPTY_GROUP_PERMISSIONS'] = 'ВНИМАНИЕ:
Вы мож // Quota Variables $lang['UPLOAD_QUOTA'] = 'Квота'; $lang['PM_QUOTA'] = 'Квота ЛС'; -$lang['USER_UPLOAD_QUOTA_REACHED'] = 'К сожалению, вы достигли максимального общего объема закачанных файлов - %d %s'; // replace %d with Size, %s with Size Lang (MB for example) - -// User Attachment Control Panel -$lang['USER_ACP_TITLE'] = 'Управление вложениями';//'Панель управления вложениями пользователя'; -$lang['UACP'] = 'Управление вложениями'; -$lang['USER_UPLOADED_PROFILE'] = 'Закачано: %s'; -$lang['USER_QUOTA_PROFILE'] = 'Квота: %s'; -$lang['UPLOAD_PERCENT_PROFILE'] = '%d%% от общего'; // Common Variables $lang['BYTES'] = 'Байт'; diff --git a/upload/memberlist.php b/upload/memberlist.php index b23d27b7e..0002ed34b 100644 --- a/upload/memberlist.php +++ b/upload/memberlist.php @@ -152,7 +152,7 @@ $template->assign_vars(array( )); // per-letter selection end -$sql = "SELECT username, user_id, user_opt, user_posts, user_regdate, user_from, user_website, user_email, user_avatar, user_avatar_type +$sql = "SELECT username, user_id, user_opt, user_posts, user_regdate, user_from, user_website, user_email FROM ". BB_USERS ." WHERE user_id NOT IN(". EXCLUDED_USERS_CSV .")"; if ( $username ) @@ -171,17 +171,13 @@ if ( $row = DB()->sql_fetchrow($result) ) do { $username = $row['username']; - $user_id = $row['user_id']; - $from = $row['user_from']; - - $joined = bb_date($row['user_regdate'], $lang['DATE_FORMAT']); - $posts = $row['user_posts']; - - $poster_avatar = get_avatar($row['user_avatar'], $row['user_avatar_type'], !bf($row['user_opt'], 'user_opt', 'allow_avatar')); - - $pm = ($bb_cfg['text_buttons']) ? ''. $lang['SEND_PM_TXTB'] .'' : '' . $lang['SEND_PRIVATE_MESSAGE'] . ''; - - if (bf($row['user_opt'], 'user_opt', 'viewemail') || IS_ADMIN) + $user_id = $row['user_id']; + $from = $row['user_from']; + $joined = bb_date($row['user_regdate'], $lang['DATE_FORMAT']); + $posts = $row['user_posts']; + $pm = ($bb_cfg['text_buttons']) ? ''. $lang['SEND_PM_TXTB'] .'' : '' . $lang['SEND_PRIVATE_MESSAGE'] . ''; + + if (bf($row['user_opt'], 'user_opt', 'viewemail') || IS_AM) { $email_uri = ($bb_cfg['board_email_form']) ? append_sid("profile.php?mode=email&". POST_USERS_URL ."=$user_id") : 'mailto:'. $row['user_email']; $email = ''. $row['user_email'] .''; @@ -200,12 +196,7 @@ if ( $row = DB()->sql_fetchrow($result) ) $www = ''; } - $temp_url = append_sid("search.php?search_author=1&uid=$user_id"); - $search_img = '' . $lang['SEARCH_USER_POSTS'] . ''; - $search = '' . $lang['SEARCH_USER_POSTS'] . ''; - $row_class = !($i % 2) ? 'row1' : 'row2'; - $template->assign_block_vars('memberrow', array( 'ROW_NUMBER' => $i + ( $start + 1 ), 'ROW_CLASS' => $row_class, @@ -214,10 +205,7 @@ if ( $row = DB()->sql_fetchrow($result) ) 'JOINED_RAW' => $row['user_regdate'], 'JOINED' => $joined, 'POSTS' => $posts, - 'AVATAR_IMG' => $poster_avatar, - 'SEARCH' => $search, 'PM' => $pm, - 'U_SEARCH_USER' => append_sid("search.php?mode=searchuser"), 'EMAIL' => $email, 'WWW' => $www, 'U_VIEWPROFILE' => append_sid("profile.php?mode=viewprofile&". POST_USERS_URL ."=$user_id")) diff --git a/upload/profile.php b/upload/profile.php index 682039247..4d74963c9 100644 --- a/upload/profile.php +++ b/upload/profile.php @@ -42,10 +42,6 @@ switch ($mode) require(INC_DIR .'ucp/usercp_email.php'); break; - case 'attachcp': - require(INC_DIR .'ucp/usercp_attachcp.php'); - break; - default: bb_die('Invalid mode'); } diff --git a/upload/templates/default/css/main.css b/upload/templates/default/css/main.css index f0616e7b4..2a34c8116 100644 --- a/upload/templates/default/css/main.css +++ b/upload/templates/default/css/main.css @@ -488,8 +488,8 @@ table.smilies td { padding: 3px; text-align: center; } TopMenu, Quick Login, PM Info, Loguot.. * ---------------------------------- */ .topmenu { - background: #EFEFEF; border: solid #CFD4D8; border-width: 1px 0px; - margin: 3px 4px 0; padding: 0 8px; overflow: hidden; + background: #EFEFEF; border: 1px solid #CFD4D8; + margin: 3px 4px 0; padding: 0 3px; overflow: hidden; } .topmenu a:link, .topmenu a:visited { text-decoration: none; } .topmenu td { padding: 4px; font-size: 11px; white-space: nowrap; } diff --git a/upload/templates/default/usercp_viewprofile.tpl b/upload/templates/default/usercp_viewprofile.tpl index 65d4c905e..2f363473c 100644 --- a/upload/templates/default/usercp_viewprofile.tpl +++ b/upload/templates/default/usercp_viewprofile.tpl @@ -232,8 +232,8 @@ $(document).ready(function(){ {POSTS}  [ {L_SEARCH_USER_POSTS} ] [ {L_SEARCH_USER_TOPICS} ] - [ {L_SEARCH_RELEASES} ] -

+ [ {L_SEARCH_RELEASES} ] +

diff --git a/upload/templates/default/viewonline.tpl b/upload/templates/default/viewonline.tpl index 483ae55d3..ca087c076 100644 --- a/upload/templates/default/viewonline.tpl +++ b/upload/templates/default/viewonline.tpl @@ -14,7 +14,7 @@ {reg_user_row.USERNAME} - {reg_user_row.LASTUPDATE} + {reg_user_row.LASTUPDATE_RAW}{reg_user_row.LASTUPDATE} {reg_user_row.USERIP} diff --git a/upload/viewonline.php b/upload/viewonline.php index fe4faa5ee..4a7556c8b 100644 --- a/upload/viewonline.php +++ b/upload/viewonline.php @@ -114,6 +114,7 @@ while ( $row = DB()->sql_fetchrow($result) ) 'ROW_CLASS' => $row_class, 'USERNAME' => $username, 'LASTUPDATE' => bb_date($row['session_time']), + 'LASTUPDATE_RAW' => $row['session_time'], 'USERIP' => $user_ip, 'U_WHOIS_IP' => "http://ip-whois.net/ip_geo.php?ip=$user_ip", 'U_USER_PROFILE' => ((isset($user_id)) ? append_sid("profile.php?mode=viewprofile&" . POST_USERS_URL . '=' . $user_id) : ''),