diff --git a/upload/admin/admin_user_search.php b/upload/admin/admin_user_search.php index 009810c86..11eba184d 100644 --- a/upload/admin/admin_user_search.php +++ b/upload/admin/admin_user_search.php @@ -106,7 +106,7 @@ if(!isset($_POST['dosearch'])&&!isset($_GET['dosearch'])) $template->assign_vars(array( 'TPL_ADMIN_USER_SEARCH_MAIN' => true, - + 'YEAR' => date("Y"), 'MONTH' => date("m"), 'DAY' => date("d"), @@ -316,8 +316,8 @@ else $base_url = "admin_user_search.php?dosearch=true"; - $select_sql = "SELECT u.user_id, u.username, u.user_email, u.user_posts, u.user_regdate, u.user_level, u.user_active, u.user_lastvisit - FROM ".BB_USERS." AS u"; + $select_sql = "SELECT u.user_id, u.username, u.user_rank, u.user_email, u.user_posts, u.user_regdate, u.user_level, u.user_active, u.user_lastvisit + FROM ". BB_USERS ." AS u"; $lower_b = 'LOWER('; $lower_e = ')'; @@ -1271,7 +1271,7 @@ else } $sql = "SELECT ban_userid AS user_id - FROM ".BB_BANLIST." + FROM ". BB_BANLIST ." WHERE ban_userid IN ($users_sql)"; if(!$result = DB()->sql_query($sql)) @@ -1294,7 +1294,7 @@ else $template->assign_block_vars('userrow', array( 'ROW_CLASS' => $row_class, - 'USERNAME' => $rowset[$i]['username'], + 'USER' => profile_url($rowset[$i]), 'EMAIL' => $rowset[$i]['user_email'], 'JOINDATE' => bb_date($rowset[$i]['user_regdate']), 'LASTVISIT' => bb_date($rowset[$i]['user_lastvisit']), @@ -1302,7 +1302,6 @@ else 'BAN' => ( ( !isset($banned[$rowset[$i]['user_id']]) ) ? $lang['NOT_BANNED'] : $lang['BANNED'] ), 'ABLED' => ( ( $rowset[$i]['user_active'] ) ? $lang['ENABLED'] : $lang['DISABLED'] ), - 'U_VIEWPROFILE' => append_sid("../profile.php?mode=viewprofile&".POST_USERS_URL."=".$rowset[$i]['user_id']), 'U_VIEWPOSTS' => append_sid("../search.php?search_author=1&uid={$rowset[$i]['user_id']}"), 'U_MANAGE' => append_sid("../profile.php?mode=editprofile&".POST_USERS_URL."=".$rowset[$i]['user_id']), 'U_PERMISSIONS' => append_sid("admin_ug_auth.php?mode=user&".POST_USERS_URL."=".$rowset[$i]['user_id']), diff --git a/upload/attach_mod/displaying_torrent.php b/upload/attach_mod/displaying_torrent.php index c88669bfc..2a587c37f 100644 --- a/upload/attach_mod/displaying_torrent.php +++ b/upload/attach_mod/displaying_torrent.php @@ -306,7 +306,7 @@ if ($tor_reged && $tor_info) } else if ($s_mode == 'names') { - $sql = "SELECT tr.user_id, tr.ip, tr.port, tr.remain, tr.seeder, u.username + $sql = "SELECT tr.user_id, tr.ip, tr.port, tr.remain, tr.seeder, u.username, u.user_rank FROM ". BB_BT_TRACKER ." tr, ". BB_USERS ." u WHERE tr.topic_id = $tor_id AND u.user_id = tr.user_id @@ -319,7 +319,7 @@ if ($tor_reged && $tor_info) $sql = "SELECT tr.user_id, tr.ip, tr.port, tr.uploaded, tr.downloaded, tr.remain, tr.seeder, tr.releaser, tr.speed_up, tr.speed_down, tr.update_time, - u.username + u.username, u.user_rank FROM ". BB_BT_TRACKER ." tr LEFT JOIN ". BB_USERS ." u ON u.user_id = tr.user_id WHERE tr.topic_id = $tor_id @@ -415,12 +415,7 @@ if ($tor_reged && $tor_info) { $ip = bt_show_ip($peer['ip']); $port = bt_show_port($peer['port']); - $guest = ($peer['user_id'] == ANONYMOUS || is_null($peer['username'])); - if (isset($peer['user_id']) && $guest) - { - $peer['username'] = 'Guest'; - } // peer max/current up/down $p_max_up = $peer['uploaded']; $p_max_down = $peer['downloaded']; @@ -432,7 +427,6 @@ if ($tor_reged && $tor_info) $x = 's'; $x_row = 'srow'; $x_full = 'sfull'; - $link_class = 'seedmed'; if (!defined('SEEDER_EXIST')) { @@ -460,7 +454,6 @@ if ($tor_reged && $tor_info) $x = 'l'; $x_row = 'lrow'; $x_full = 'lfull'; - $link_class = 'leechmed'; if (!defined('LEECHER_EXIST')) { @@ -486,9 +479,8 @@ if ($tor_reged && $tor_info) $compl_perc = ($compl_size) ? floor($compl_size * 100 / $tor_size) : 0; } - if($userdata['user_id'] == $peer['user_id']) $link_class = 'itsme'; - $rel_sign = (!$guest && $peer['releaser']) ? ' ® ' : ''; - $name = ''. wbr($peer['username']) .''. $rel_sign; + $rel_sign = (!$guest && $peer['releaser']) ? ' ®' : ''; + $name = profile_url($peer). $rel_sign; $up_tot = ($p_max_up) ? humn_size($p_max_up) : '-'; $down_tot = ($p_max_down) ? humn_size($p_max_down) : '-'; $up_ratio = ($p_max_down) ? round(($p_max_up / $p_max_down), 2) : ''; diff --git a/upload/includes/functions_post.php b/upload/includes/functions_post.php index 1285b6793..306ec9787 100644 --- a/upload/includes/functions_post.php +++ b/upload/includes/functions_post.php @@ -713,7 +713,7 @@ function topic_review ($topic_id) $review_posts = DB()->fetch_rowset(" SELECT p.*, h.post_html, IF(h.post_html IS NULL, pt.post_text, NULL) AS post_text, - IF(p.poster_id = ". ANONYMOUS .", p.post_username, u.username) AS username, u.user_id + IF(p.poster_id = ". ANONYMOUS .", p.post_username, u.username) AS username, u.user_rank FROM ". BB_POSTS ." p LEFT JOIN ". BB_USERS ." u ON(u.user_id = p.poster_id) LEFT JOIN ". BB_POSTS_TEXT ." pt ON(pt.post_id = p.post_id) @@ -726,12 +726,10 @@ function topic_review ($topic_id) // Topic posts block foreach ($review_posts as $i => $post) { - $poster_name = ($post['username']) ? wbr($post['username']) : $lang['GUEST']; - $template->assign_block_vars('review', array( 'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2', - 'POSTER_NAME' => $poster_name, - 'POSTER_NAME_JS' => addslashes($poster_name), + 'POSTER' => profile_url($post), + 'POSTER_NAME_JS' => addslashes($post['username']), 'POST_DATE' => bb_date($post['post_time'], $bb_cfg['post_date_format']), 'MESSAGE' => get_parsed_post($post), )); diff --git a/upload/includes/functions_report.php b/upload/includes/functions_report.php index 6f8eb7f00..997b82a83 100644 --- a/upload/includes/functions_report.php +++ b/upload/includes/functions_report.php @@ -404,7 +404,7 @@ function report_notify($mode) // Obtain report information // $sql = 'SELECT r.report_id, r.report_module_id, r.report_subject, r.report_subject_data, r.report_title, r.report_desc, - rc.report_change_time, rc.report_change_comment, u.username + rc.report_change_time, rc.report_change_comment, u.username, u.user_rank FROM ' . BB_REPORTS . ' r INNER JOIN ' . BB_REPORTS_CHANGES . ' rc ON rc.report_change_id = r.report_last_change @@ -732,7 +732,7 @@ function reports_obtain($module_id = null, $auth_check = true) { $where_sql = (isset($module_id)) ? 'AND r.report_module_id = ' . (int) $module_id : ''; $sql = 'SELECT r.report_id, r.user_id, r.report_time, r.report_module_id, r.report_status, r.report_subject, - r.report_subject_data, r.report_title, u.username + r.report_subject_data, r.report_title, u.username, u.user_rank FROM ' . BB_REPORTS . ' r LEFT JOIN ' . BB_USERS . ' u ON u.user_id = r.user_id @@ -792,7 +792,7 @@ function reports_obtain($module_id = null, $auth_check = true) function reports_open_obtain($module_id, $report_subject, $auth_check = true) { $sql = 'SELECT r.report_id, r.user_id, r.report_time, r.report_module_id, r.report_status, r.report_subject, - r.report_subject_data, r.report_title, u.username + r.report_subject_data, r.report_title, u.username, u.user_rank FROM ' . BB_REPORTS . ' r LEFT JOIN ' . BB_USERS . ' u ON u.user_id = r.user_id @@ -839,7 +839,7 @@ function reports_open_obtain($module_id, $report_subject, $auth_check = true) function reports_deleted_obtain($auth_check = true) { $sql = 'SELECT r.report_id, r.user_id, r.report_time, r.report_module_id, r.report_subject, - r.report_subject_data, r.report_title, u.username + r.report_subject_data, r.report_title, u.username, u.user_rank FROM ' . BB_REPORTS . ' r LEFT JOIN ' . BB_USERS . ' u ON u.user_id = r.user_id @@ -886,7 +886,7 @@ function report_obtain($report_id, $auth_check = true) global $bb_cfg, $lang; $sql = 'SELECT r.report_id, r.user_id, r.report_time, r.report_module_id, r.report_status, r.report_subject, - r.report_subject_data, r.report_title, r.report_desc, rr.report_reason_desc, u.username + r.report_subject_data, r.report_title, r.report_desc, rr.report_reason_desc, u.username, u.user_rank FROM ' . BB_REPORTS . ' r LEFT JOIN ' . BB_REPORTS_REASONS . ' rr ON rr.report_reason_id = r.report_reason_id @@ -940,7 +940,7 @@ function report_obtain($report_id, $auth_check = true) // function report_changes_obtain($report_id) { - $sql = 'SELECT rc.user_id, rc.report_change_time, rc.report_status, rc.report_change_comment, u.username + $sql = 'SELECT rc.user_id, rc.report_change_time, rc.report_status, rc.report_change_comment, u.username, u.user_rank FROM ' . BB_REPORTS_CHANGES . ' rc LEFT JOIN ' . BB_USERS . ' u ON u.user_id = rc.user_id diff --git a/upload/includes/torrent_show_dl_list.php b/upload/includes/torrent_show_dl_list.php index d5953b07f..93ec3c10c 100644 --- a/upload/includes/torrent_show_dl_list.php +++ b/upload/includes/torrent_show_dl_list.php @@ -44,7 +44,7 @@ if ($show_dl_list) } else { - $sql = "SELECT d.user_status, d.user_id, DATE_FORMAT(d.last_modified_dlstatus, '%Y-%m-%d') AS last_modified_dlstatus, u.username + $sql = "SELECT d.user_status, d.user_id, DATE_FORMAT(d.last_modified_dlstatus, '%Y-%m-%d') AS last_modified_dlstatus, u.username, u.user_rank FROM ". BB_BT_DLSTATUS ." d, ". BB_USERS ." u WHERE d.topic_id = $topic_id AND d.user_id = u.user_id @@ -76,7 +76,7 @@ if ($show_dl_list) else { $u_prof_href = ($u['user_id'] == ANONYMOUS) ? '#' : append_sid("profile.php?mode=viewprofile&u=". $u['user_id']) .'#torrent'; - $dl_cat[$u['user_status']] .= ''. $u['username'] .', '; + $dl_cat[$u['user_status']] .= ''. profile_url(array('username' => $u['username'], 'user_rank' => $u['user_rank'])) .', '; $dl_count[$u['user_status']]++; } } diff --git a/upload/posting.php b/upload/posting.php index 44d4e0dba..9e4d1e5e5 100644 --- a/upload/posting.php +++ b/upload/posting.php @@ -341,7 +341,7 @@ if (!IS_GUEST && $mode != 'newtopic' && ($submit || $preview || $mode == 'quote' { if ($topic_last_read = max(intval(@$tracking_topics[$topic_id]), intval(@$tracking_forums[$forum_id]))) { - $sql = "SELECT p.*, pt.post_text, u.username + $sql = "SELECT p.*, pt.post_text, u.username, u.user_rank FROM ". BB_POSTS ." p, ". BB_POSTS_TEXT ." pt, ". BB_USERS ." u WHERE p.topic_id = ". (int) $topic_id ." AND u.user_id = p.poster_id @@ -356,19 +356,10 @@ if (!IS_GUEST && $mode != 'newtopic' && ($submit || $preview || $mode == 'quote' foreach ($rowset as $i => $row) { - if ($row['poster_id'] == ANONYMOUS) - { - $new_post_username = (!$row['post_username']) ? $lang['GUEST'] : $row['post_username']; - } - else - { - $new_post_username = $row['username']; - } - $template->assign_block_vars('new_posts', array( 'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2', - 'POSTER_NAME' => $new_post_username, - 'POSTER_NAME_JS' => addslashes($new_post_username), + 'POSTER' => profile_url($row), + 'POSTER_NAME_JS' => addslashes($row['username']), 'POST_DATE' => bb_date($row['post_time'], $bb_cfg['post_date_format']), 'MESSAGE' => get_parsed_post($row), )); diff --git a/upload/report.php b/upload/report.php index 0c4f2d3fd..ab3390733 100644 --- a/upload/report.php +++ b/upload/report.php @@ -408,7 +408,7 @@ else $template->assign_vars(array( 'S_REPORT_ACTION', append_sid("report.php"), - + 'L_STATUS_CLEARED' => $lang['REPORT_STATUS'][REPORT_CLEARED], 'L_STATUS_IN_PROCESS' => $lang['REPORT_STATUS'][REPORT_IN_PROCESS], 'L_STATUS_OPEN' => $lang['REPORT_STATUS'][REPORT_OPEN]) @@ -421,11 +421,10 @@ else { $template->assign_block_vars('open_reports', array( 'U_SHOW' => append_sid("report.php?" . POST_REPORT_URL . '=' . $report['report_id']), - 'U_AUTHOR' => append_sid("profile.php?mode=viewprofile&" . POST_USERS_URL . '=' . $report['user_id']), 'ID' => $report['report_id'], 'TITLE' => $report['report_title'], - 'AUTHOR' => $report['username'], + 'AUTHOR' => profile_url($report), 'TIME' => bb_date($report['report_time'])) ); } @@ -445,7 +444,7 @@ else 'S_REPORT_ACTION' => append_sid("report.php"), 'U_REPORT_INDEX' => append_sid("report.php"), - + 'L_STATUS_CLEARED' => $lang['REPORT_STATUS'][REPORT_CLEARED], 'L_STATUS_IN_PROCESS' => $lang['REPORT_STATUS'][REPORT_IN_PROCESS], 'L_STATUS_OPEN' => $lang['REPORT_STATUS'][REPORT_OPEN]) @@ -506,12 +505,11 @@ else { $template->assign_block_vars('report_modules.reports', array( 'U_SHOW' => append_sid("report.php?" . POST_REPORT_URL . '=' . $report['report_id'] . $cat_url), - 'U_AUTHOR' => append_sid("profile.php?mode=viewprofile&" . POST_USERS_URL . '=' . $report['user_id']), 'ROW_CLASS' => $report_status_classes[$report['report_status']], 'ID' => $report['report_id'], 'TITLE' => (strlen($report['report_title'] > 53)) ? substr($report['report_title'], 0, 50) . '...' : $report['report_title'], - 'AUTHOR' => $report['username'], + 'AUTHOR' => profile_url($report), 'TIME' => bb_date($report['report_time']), 'STATUS' => $lang['REPORT_STATUS'][$report['report_status']]) ); @@ -645,8 +643,7 @@ else foreach ($report_changes as $report_change) { - $u_report_change_user = append_sid("profile.php?mode=viewprofile&" . POST_USERS_URL . '=' . $report_change['user_id']); - $report_change_user = '' . $report_change['username'] . ''; + $report_change_user = profile_url($report_change); $report_change_status = $lang['REPORT_STATUS'][$report_change['report_status']]; $report_change_time = bb_date($report_change['report_change_time']); @@ -668,11 +665,9 @@ else } $template->assign_block_vars('switch_report_changes.report_changes', array( - 'U_USER' => $u_report_change_user, - 'ROW_CLASS' => $report_status_classes[$report_change['report_status']], 'STATUS' => $report_change_status, - 'USER' => $report_change['username'], + 'USER' => $report_change_user, 'TIME' => $report_change_time, 'TEXT' => $report_change_text) @@ -683,10 +678,8 @@ else // Assign last change information // $template->assign_vars(array( - 'U_REPORT_LAST_CHANGE_USER' => $u_report_change_user, - 'REPORT_LAST_CHANGE_TIME' => $report_change_time, - 'REPORT_LAST_CHANGE_USER' => $report_change['username']) + 'REPORT_LAST_CHANGE_USER' => profile_url($report_change)) ); } @@ -701,12 +694,11 @@ else $template->assign_vars(array( 'S_HIDDEN_FIELDS' => '', - 'U_REPORT_AUTHOR' => append_sid("profile.php?mode=viewprofile&" . POST_USERS_URL . '=' . $report['user_id']), 'U_REPORT_AUTHOR_PRIVMSG' => append_sid("privmsg.php?mode=post&" . POST_USERS_URL . '=' . $report['user_id']), 'REPORT_TYPE' => $report_module->lang['REPORT_TYPE'], 'REPORT_TITLE' => $report['report_title'], - 'REPORT_AUTHOR' => $report['username'], + 'REPORT_AUTHOR' => profile_url($report), 'REPORT_TIME' => bb_date($report['report_time']), 'REPORT_DESC' => bbcode2html($report['report_desc']), 'REPORT_STATUS' => $lang['REPORT_STATUS'][$report['report_status']], @@ -748,12 +740,11 @@ else $template->assign_block_vars('switch_deleted_reports.deleted_reports', array( 'U_SHOW' => append_sid("report.php?" . POST_REPORT_URL . '=' . $report['report_id'] . $cat_url), - 'U_AUTHOR' => append_sid("profile.php?mode=viewprofile&" . POST_USERS_URL . '=' . $report['user_id']), 'ID' => $report['report_id'], 'TITLE' => $report['report_title'], 'TYPE' => $report_module->lang['REPORT_TYPE'], - 'AUTHOR' => $report['username'], + 'AUTHOR' => profile_url($report), 'TIME' => bb_date($report['report_time']), 'STATUS' => $lang['REPORT_STATUS'][REPORT_DELETE]) ); diff --git a/upload/templates/admin/admin_user_search.tpl b/upload/templates/admin/admin_user_search.tpl index 70da1ec8f..e811f151b 100644 --- a/upload/templates/admin/admin_user_search.tpl +++ b/upload/templates/admin/admin_user_search.tpl @@ -176,16 +176,16 @@ {L_ACCOUNT_STATUS} - -  {userrow.USERNAME}  -  {userrow.EMAIL}  -  {userrow.JOINDATE}  -  {userrow.POSTS}  -  {userrow.LASTVISIT}  -  {L_MANAGE}  -  {L_PERMISSIONS}  -  {userrow.BAN}  -  {userrow.ABLED}  + +  {userrow.USER}  +  {userrow.EMAIL}  +  {userrow.JOINDATE}  +  {userrow.POSTS}  +  {userrow.LASTVISIT}  +  {L_MANAGE}  +  {L_PERMISSIONS}  +  {userrow.BAN}  +  {userrow.ABLED}  diff --git a/upload/templates/default/posting.tpl b/upload/templates/default/posting.tpl index 48c9335ee..5e82f92d4 100644 --- a/upload/templates/default/posting.tpl +++ b/upload/templates/default/posting.tpl @@ -15,13 +15,13 @@

- {new_posts.POSTER_NAME} + {new_posts.POSTER}

{MINIPOST_IMG_NEW} {new_posts.POST_DATE}
-
{new_posts.MESSAGE}
+
{new_posts.MESSAGE}
@@ -41,7 +41,7 @@ {L_PREVIEW} -
{PREVIEW_MSG}
+
{PREVIEW_MSG}
@@ -170,13 +170,13 @@

- {review.POSTER_NAME} + {review.POSTER}

{MINIPOST_IMG} {review.POST_DATE}
-
{review.MESSAGE}
+
{review.MESSAGE}
diff --git a/upload/templates/default/report_list_body.tpl b/upload/templates/default/report_list_body.tpl index 7dfce5056..a305a5168 100644 --- a/upload/templates/default/report_list_body.tpl +++ b/upload/templates/default/report_list_body.tpl @@ -39,7 +39,7 @@ function checked_toggle(form, status) - +
@@ -71,7 +71,7 @@ function checked_toggle(form, status) - {L_REPORT_BY} {report_modules.reports.AUTHOR} + {L_REPORT_BY} {report_modules.reports.AUTHOR} diff --git a/upload/templates/default/report_view_body.tpl b/upload/templates/default/report_view_body.tpl index d075b2e8f..d6cff2567 100644 --- a/upload/templates/default/report_view_body.tpl +++ b/upload/templates/default/report_view_body.tpl @@ -45,7 +45,7 @@ {L_REPORTED_BY}: - {REPORT_AUTHOR}  + {REPORT_AUTHOR}  [ {L_SEND_PRIVATE_MESSAGE} ] @@ -79,7 +79,7 @@ {L_LAST_CHANGED_BY}: - {REPORT_LAST_CHANGE_USER} ({REPORT_LAST_CHANGE_TIME}) + {REPORT_LAST_CHANGE_USER} ({REPORT_LAST_CHANGE_TIME})