Приведение имени константы ANONYMOUS к GUEST_UID, по аналогии с именем константы BOT_UID. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@539 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
glix08 2013-08-06 20:17:47 +00:00
commit daf25c67ca
30 changed files with 116 additions and 116 deletions

View file

@ -1,6 +1,6 @@
<?php <?php
if (!defined('EXCLUDED_USERS_CSV')) { define('EXCLUDED_USERS_CSV', join(',', array(ANONYMOUS, BOT_UID,))); } if (!defined('EXCLUDED_USERS_CSV')) { define('EXCLUDED_USERS_CSV', join(',', array(GUEST_UID, BOT_UID,))); }
define('TB_USERS_TABLE', 'users'); define('TB_USERS_TABLE', 'users');
define('TB_CATEGORIES_TABLE', 'categories'); define('TB_CATEGORIES_TABLE', 'categories');
define('TB_TORRENTS_TABLE', 'torrents'); define('TB_TORRENTS_TABLE', 'torrents');

View file

@ -1,6 +1,6 @@
<?php <?php
if (!defined('EXCLUDED_USERS_CSV')) { define('EXCLUDED_USERS_CSV', join(',', array(ANONYMOUS, BOT_UID,))); } if (!defined('EXCLUDED_USERS_CSV')) { define('EXCLUDED_USERS_CSV', join(',', array(GUEST_UID, BOT_UID,))); }
define('TB_USERS_TABLE', 'users'); define('TB_USERS_TABLE', 'users');
define('TB_CATEGORIES_TABLE', 'categories'); define('TB_CATEGORIES_TABLE', 'categories');
define('TB_TORRENTS_TABLE', 'torrents'); define('TB_TORRENTS_TABLE', 'torrents');

View file

@ -75,7 +75,7 @@ if ($submit && $mode == 'user')
// Make user an admin (if already user) // Make user an admin (if already user)
if (@$_POST['userlevel'] === 'admin') if (@$_POST['userlevel'] === 'admin')
{ {
if ($userdata['user_id'] == $user_id || $user_id == ANONYMOUS || $user_id == BOT_UID) if ($userdata['user_id'] == $user_id || $user_id == GUEST_UID || $user_id == BOT_UID)
{ {
bb_die("Couldn't update admin status"); bb_die("Couldn't update admin status");
} }

View file

@ -309,7 +309,7 @@ else
FROM " . BB_BANLIST . " b, " . BB_USERS . " u FROM " . BB_BANLIST . " b, " . BB_USERS . " u
WHERE u.user_id = b.ban_userid WHERE u.user_id = b.ban_userid
AND b.ban_userid <> 0 AND b.ban_userid <> 0
AND u.user_id <> " . ANONYMOUS . " AND u.user_id <> " . GUEST_UID . "
ORDER BY u.username ASC"; ORDER BY u.username ASC";
if ( !($result = DB()->sql_query($sql)) ) if ( !($result = DB()->sql_query($sql)) )
{ {

View file

@ -379,20 +379,20 @@ else
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE REGEXP_LIKE(username, '".DB()->escape($username)."') WHERE REGEXP_LIKE(username, '".DB()->escape($username)."')
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE REGEXP_LIKE(u.username, '".DB()->escape($username)."') $select_sql .= " WHERE REGEXP_LIKE(u.username, '".DB()->escape($username)."')
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
} }
else else
{ {
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE {$lower_b}username{$lower_e} $op '".DB()->escape($username)."' WHERE {$lower_b}username{$lower_e} $op '".DB()->escape($username)."'
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE {$lower_b}u.username{$lower_e} $op '".DB()->escape($username)."' $select_sql .= " WHERE {$lower_b}u.username{$lower_e} $op '".DB()->escape($username)."'
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
} }
break; break;
case 'search_email': case 'search_email':
@ -428,20 +428,20 @@ else
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE REGEXP_LIKE(user_email, '".DB()->escape($email)."') WHERE REGEXP_LIKE(user_email, '".DB()->escape($email)."')
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE REGEXP_LIKE(u.user_email, '".DB()->escape($email)."') $select_sql .= " WHERE REGEXP_LIKE(u.user_email, '".DB()->escape($email)."')
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
} }
else else
{ {
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE {$lower_b}user_email{$lower_e} $op '".DB()->escape($email)."' WHERE {$lower_b}user_email{$lower_e} $op '".DB()->escape($email)."'
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE {$lower_b}u.user_email{$lower_e} $op '".DB()->escape($email)."' $select_sql .= " WHERE {$lower_b}u.user_email{$lower_e} $op '".DB()->escape($email)."'
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
} }
break; break;
case 'search_ip': case 'search_ip':
@ -570,7 +570,7 @@ else
$ip_users_sql = ''; $ip_users_sql = '';
$sql = "SELECT poster_id $sql = "SELECT poster_id
FROM ".BB_POSTS." FROM ".BB_POSTS."
WHERE poster_id <> ".ANONYMOUS." WHERE poster_id <> ".GUEST_UID."
AND ($where_sql) AND ($where_sql)
GROUP BY poster_id"; GROUP BY poster_id";
@ -605,7 +605,7 @@ else
$where_sql .= ( $ip_like_sql_flylast != '' ) ? ( $where_sql != "" ) ? " OR $ip_like_sql_flylast" : "$ip_like_sql_flylast": ""; $where_sql .= ( $ip_like_sql_flylast != '' ) ? ( $where_sql != "" ) ? " OR $ip_like_sql_flylast" : "$ip_like_sql_flylast": "";
$sql = "SELECT user_id $sql = "SELECT user_id
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE user_id <> ".ANONYMOUS." WHERE user_id <> ".GUEST_UID."
AND ($where_sql) AND ($where_sql)
GROUP BY user_id"; GROUP BY user_id";
if(!$result = DB()->sql_query($sql)) if(!$result = DB()->sql_query($sql))
@ -628,7 +628,7 @@ else
$where_sql .= ( $ip_like_sql_flyreg != '' ) ? ( $where_sql != "" ) ? " OR $ip_like_sql_flyreg" : "$ip_like_sql_flyreg": ""; $where_sql .= ( $ip_like_sql_flyreg != '' ) ? ( $where_sql != "" ) ? " OR $ip_like_sql_flyreg" : "$ip_like_sql_flyreg": "";
$sql = "SELECT user_id $sql = "SELECT user_id
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE user_id <> ".ANONYMOUS." WHERE user_id <> ".GUEST_UID."
AND ($where_sql) AND ($where_sql)
GROUP BY user_id"; GROUP BY user_id";
if(!$result = DB()->sql_query($sql)) if(!$result = DB()->sql_query($sql))
@ -701,10 +701,10 @@ else
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE user_regdate $arg $time WHERE user_regdate $arg $time
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE u.user_regdate $arg $time $select_sql .= " WHERE u.user_regdate $arg $time
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
break; break;
case 'search_group': case 'search_group':
@ -740,12 +740,12 @@ else
FROM ".BB_USERS." AS u, ".BB_USER_GROUP." AS ug FROM ".BB_USERS." AS u, ".BB_USER_GROUP." AS ug
WHERE u.user_id = ug.user_id WHERE u.user_id = ug.user_id
AND ug.group_id = $group_id AND ug.group_id = $group_id
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
$select_sql .= ", ".BB_USER_GROUP." AS ug $select_sql .= ", ".BB_USER_GROUP." AS ug
WHERE u.user_id = ug.user_id WHERE u.user_id = ug.user_id
AND ug.group_id = $group_id AND ug.group_id = $group_id
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
break; break;
case 'search_rank': case 'search_rank':
@ -780,10 +780,10 @@ else
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE user_rank = $rank_id WHERE user_rank = $rank_id
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE u.user_rank = $rank_id $select_sql .= " WHERE u.user_rank = $rank_id
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
break; break;
case 'search_postcount': case 'search_postcount':
@ -802,10 +802,10 @@ else
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE user_posts > $postcount_value WHERE user_posts > $postcount_value
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE u.user_posts > $postcount_value $select_sql .= " WHERE u.user_posts > $postcount_value
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
break; break;
case 'lesser': case 'lesser':
$postcount_value = intval($postcount_value); $postcount_value = intval($postcount_value);
@ -815,10 +815,10 @@ else
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE user_posts < $postcount_value WHERE user_posts < $postcount_value
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE u.user_posts < $postcount_value $select_sql .= " WHERE u.user_posts < $postcount_value
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
break; break;
case 'equals': case 'equals':
// looking for a - // looking for a -
@ -840,11 +840,11 @@ else
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE user_posts >= $range_begin WHERE user_posts >= $range_begin
AND user_posts <= $range_end AND user_posts <= $range_end
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE u.user_posts >= $range_begin $select_sql .= " WHERE u.user_posts >= $range_begin
AND u.user_posts <= $range_end AND u.user_posts <= $range_end
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
} }
else else
{ {
@ -855,10 +855,10 @@ else
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE user_posts = $postcount_value WHERE user_posts = $postcount_value
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE u.user_posts = $postcount_value $select_sql .= " WHERE u.user_posts = $postcount_value
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
} }
break; break;
default: default:
@ -931,20 +931,20 @@ else
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE REGEXP_LIKE($field, '".DB()->escape($userfield_value)."') WHERE REGEXP_LIKE($field, '".DB()->escape($userfield_value)."')
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE REGEXP_LIKE(u.$field, '".DB()->escape($userfield_value)."') $select_sql .= " WHERE REGEXP_LIKE(u.$field, '".DB()->escape($userfield_value)."')
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
} }
else else
{ {
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE {$lower_b}$field{$lower_e} $op '".DB()->escape($userfield_value)."' WHERE {$lower_b}$field{$lower_e} $op '".DB()->escape($userfield_value)."'
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE {$lower_b}u.$field{$lower_e} $op '".DB()->escape($userfield_value)."' $select_sql .= " WHERE {$lower_b}u.$field{$lower_e} $op '".DB()->escape($userfield_value)."'
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
} }
break; break;
@ -964,10 +964,10 @@ else
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE user_lastvisit >= $lastvisited_seconds WHERE user_lastvisit >= $lastvisited_seconds
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE u.user_lastvisit >= $lastvisited_seconds $select_sql .= " WHERE u.user_lastvisit >= $lastvisited_seconds
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
break; break;
case 'after': case 'after':
$text = sprintf($lang['SEARCH_FOR_LASTVISITED_AFTERTHELAST'], $lastvisited_days, ( ( $lastvisited_days > 1 ) ? $lang['DAYS'] : $lang['DAY'] )); $text = sprintf($lang['SEARCH_FOR_LASTVISITED_AFTERTHELAST'], $lastvisited_days, ( ( $lastvisited_days > 1 ) ? $lang['DAYS'] : $lang['DAY'] ));
@ -975,10 +975,10 @@ else
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE user_lastvisit < $lastvisited_seconds WHERE user_lastvisit < $lastvisited_seconds
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE u.user_lastvisit < $lastvisited_seconds $select_sql .= " WHERE u.user_lastvisit < $lastvisited_seconds
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
break; break;
default: default:
@ -1001,10 +1001,10 @@ else
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE user_lang = '".DB()->escape($language_type)."' WHERE user_lang = '".DB()->escape($language_type)."'
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE u.user_lang = '".DB()->escape($language_type)."' $select_sql .= " WHERE u.user_lang = '".DB()->escape($language_type)."'
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
break; break;
case 'search_timezone': case 'search_timezone':
@ -1016,10 +1016,10 @@ else
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE user_timezone = $timezone_type WHERE user_timezone = $timezone_type
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE u.user_timezone = $timezone_type $select_sql .= " WHERE u.user_timezone = $timezone_type
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
break; break;
case 'search_style': case 'search_style':
@ -1055,7 +1055,7 @@ else
AND g.group_id = aa.group_id AND g.group_id = aa.group_id
AND aa.forum_id = ". $moderators_forum ." AND aa.forum_id = ". $moderators_forum ."
AND aa.forum_perm & ". BF_AUTH_MOD ." AND aa.forum_perm & ". BF_AUTH_MOD ."
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
$select_sql .= ", ".BB_GROUPS." AS g, ".BB_USER_GROUP." AS ug, ".BB_AUTH_ACCESS." AS aa $select_sql .= ", ".BB_GROUPS." AS g, ".BB_USER_GROUP." AS ug, ".BB_AUTH_ACCESS." AS aa
WHERE u.user_id = ug.user_id WHERE u.user_id = ug.user_id
@ -1063,7 +1063,7 @@ else
AND g.group_id = aa.group_id AND g.group_id = aa.group_id
AND aa.forum_id = ". $moderators_forum ." AND aa.forum_id = ". $moderators_forum ."
AND aa.forum_perm & ". BF_AUTH_MOD ." AND aa.forum_perm & ". BF_AUTH_MOD ."
AND u.user_id <> ".ANONYMOUS." AND u.user_id <> ".GUEST_UID."
GROUP BY u.user_id, u.username, u.user_email, u.user_posts, u.user_regdate, u.user_level, u.user_active, u.user_lastvisit"; GROUP BY u.user_id, u.username, u.user_email, u.user_posts, u.user_regdate, u.user_level, u.user_active, u.user_lastvisit";
break; break;
case 'search_misc': case 'search_misc':
@ -1080,10 +1080,10 @@ else
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE user_level = ".ADMIN." WHERE user_level = ".ADMIN."
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE u.user_level = ".ADMIN." $select_sql .= " WHERE u.user_level = ".ADMIN."
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
break; break;
case 'mods': case 'mods':
$text = $lang['SEARCH_FOR_MODS']; $text = $lang['SEARCH_FOR_MODS'];
@ -1091,10 +1091,10 @@ else
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE user_level = ".MOD." WHERE user_level = ".MOD."
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE u.user_level = ".MOD." $select_sql .= " WHERE u.user_level = ".MOD."
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
break; break;
case 'banned': case 'banned':
$text = $lang['SEARCH_FOR_BANNED']; $text = $lang['SEARCH_FOR_BANNED'];
@ -1102,11 +1102,11 @@ else
$total_sql .= "SELECT COUNT(u.user_id) AS total $total_sql .= "SELECT COUNT(u.user_id) AS total
FROM ".BB_USERS." AS u, ".BB_BANLIST." AS b FROM ".BB_USERS." AS u, ".BB_BANLIST." AS b
WHERE u.user_id = b.ban_userid WHERE u.user_id = b.ban_userid
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
$select_sql .= ", ".BB_BANLIST." AS b $select_sql .= ", ".BB_BANLIST." AS b
WHERE u.user_id = b.ban_userid WHERE u.user_id = b.ban_userid
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
break; break;
case 'disabled': case 'disabled':
@ -1115,10 +1115,10 @@ else
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE user_active = 0 WHERE user_active = 0
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE u.user_active = 0 $select_sql .= " WHERE u.user_active = 0
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
break; break;
case 'disabled_pms': case 'disabled_pms':
@ -1127,10 +1127,10 @@ else
$total_sql .= "SELECT COUNT(user_id) AS total $total_sql .= "SELECT COUNT(user_id) AS total
FROM ".BB_USERS." FROM ".BB_USERS."
WHERE user_allow_pm = 0 WHERE user_allow_pm = 0
AND user_id <> ".ANONYMOUS; AND user_id <> ".GUEST_UID;
$select_sql .= " WHERE u.user_allow_pm = 0 $select_sql .= " WHERE u.user_allow_pm = 0
AND u.user_id <> ".ANONYMOUS; AND u.user_id <> ".GUEST_UID;
break; break;
default: default:

View file

@ -188,7 +188,7 @@ else if( isset($_GET['pane']) && $_GET['pane'] == 'right' )
FROM " . BB_USERS . " u, " . BB_SESSIONS . " s FROM " . BB_USERS . " u, " . BB_SESSIONS . " s
WHERE s.session_logged_in = 1 WHERE s.session_logged_in = 1
AND u.user_id = s.session_user_id AND u.user_id = s.session_user_id
AND u.user_id <> " . ANONYMOUS . " AND u.user_id <> " . GUEST_UID . "
AND s.session_time >= " . ( TIMENOW - 300 ) . " AND s.session_time >= " . ( TIMENOW - 300 ) . "
ORDER BY s.session_ip ASC, s.session_time DESC"; ORDER BY s.session_ip ASC, s.session_time DESC";
if(!$result = DB()->sql_query($sql)) if(!$result = DB()->sql_query($sql))

View file

@ -68,7 +68,7 @@ $tor_reged = (bool) $tracker_status;
$show_peers = (bool) $bb_cfg['bt_show_peers']; $show_peers = (bool) $bb_cfg['bt_show_peers'];
$locked = ($t_data['forum_status'] == FORUM_LOCKED || $t_data['topic_status'] == TOPIC_LOCKED); $locked = ($t_data['forum_status'] == FORUM_LOCKED || $t_data['topic_status'] == TOPIC_LOCKED);
$tor_auth = ($bt_user_id != ANONYMOUS && (($bt_user_id == $poster_id && !$locked) || $is_auth['auth_mod'])); $tor_auth = ($bt_user_id != GUEST_UID && (($bt_user_id == $poster_id && !$locked) || $is_auth['auth_mod']));
$tor_auth_reg = ($tor_auth && $t_data['allow_reg_tracker'] && $post_id == $t_data['topic_first_post_id']); $tor_auth_reg = ($tor_auth && $t_data['allow_reg_tracker'] && $post_id == $t_data['topic_first_post_id']);
$tor_auth_del = ($tor_auth && $tor_reged); $tor_auth_del = ($tor_auth && $tor_reged);
@ -353,7 +353,7 @@ if ($tor_reged && $tor_info)
$sp_up_tot[$x] += $peer['speed_up']; $sp_up_tot[$x] += $peer['speed_up'];
$sp_down_tot[$x] += $peer['speed_down']; $sp_down_tot[$x] += $peer['speed_down'];
$guest = ($peer['user_id'] == ANONYMOUS || is_null($peer['username'])); $guest = ($peer['user_id'] == GUEST_UID || is_null($peer['username']));
$p_max_up = $peer['uploaded']; $p_max_up = $peer['uploaded'];
$p_max_down = $peer['downloaded']; $p_max_down = $peer['downloaded'];

View file

@ -38,7 +38,7 @@ define('DL_STATUS_WILL', 4);
define('TOR_TYPE_GOLD', 1); define('TOR_TYPE_GOLD', 1);
define('TOR_TYPE_SILVER', 2); define('TOR_TYPE_SILVER', 2);
define('ANONYMOUS', -1); define('GUEST_UID', -1);
define('BOT_UID', -746); define('BOT_UID', -746);
// DBS // DBS

View file

@ -55,8 +55,8 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do
// Increase number of revision after update // Increase number of revision after update
$bb_cfg['tp_version'] = '2.5 (unstable)'; $bb_cfg['tp_version'] = '2.5 (unstable)';
$bb_cfg['tp_release_date'] = '06-08-2013'; $bb_cfg['tp_release_date'] = '07-08-2013';
$bb_cfg['tp_release_state'] = 'R538'; $bb_cfg['tp_release_state'] = 'R539';
// Database // Database
$charset = 'utf8'; $charset = 'utf8';

View file

@ -7,7 +7,7 @@ $users_per_cycle = 1000;
require_once(INC_DIR .'functions_admin.php'); require_once(INC_DIR .'functions_admin.php');
$excluded_users = join(',', array( $excluded_users = join(',', array(
ANONYMOUS, GUEST_UID,
BOT_UID, BOT_UID,
)); ));

View file

@ -23,7 +23,7 @@ DB()->query("
u.user_session_time = IF(u.user_session_time < s.session_time, s.session_time, u.user_session_time) u.user_session_time = IF(u.user_session_time < s.session_time, s.session_time, u.user_session_time)
WHERE WHERE
u.user_id = s.session_user_id u.user_id = s.session_user_id
AND s.session_user_id != ". ANONYMOUS ." AND s.session_user_id != ". GUEST_UID ."
AND ( AND (
(s.session_time < $user_session_expire_time AND s.session_admin = 0) (s.session_time < $user_session_expire_time AND s.session_admin = 0)
OR OR

View file

@ -123,7 +123,7 @@ if ($bb_cfg['torhelp_enabled'])
SELECT DISTINCT session_user_id AS uid SELECT DISTINCT session_user_id AS uid
FROM ". BB_SESSIONS ." FROM ". BB_SESSIONS ."
WHERE session_time > (UNIX_TIMESTAMP() - $user_last_seen_online*60) WHERE session_time > (UNIX_TIMESTAMP() - $user_last_seen_online*60)
AND session_user_id != ". ANONYMOUS ." AND session_user_id != ". GUEST_UID ."
ORDER BY session_time DESC ORDER BY session_time DESC
LIMIT $users_limit LIMIT $users_limit
"; ";

View file

@ -1312,7 +1312,7 @@ function get_db_stat($mode)
case 'newestuser': case 'newestuser':
$sql = "SELECT user_id, username $sql = "SELECT user_id, username
FROM " . BB_USERS . " FROM " . BB_USERS . "
WHERE user_id <> " . ANONYMOUS . " WHERE user_id <> " . GUEST_UID . "
ORDER BY user_id DESC ORDER BY user_id DESC
LIMIT 1"; LIMIT 1";
break; break;
@ -1422,7 +1422,7 @@ function get_userdata ($u, $force_name = false, $allow_anon = false)
{ {
if (!$u) return false; if (!$u) return false;
if (intval($u) == ANONYMOUS && $allow_anon) if (intval($u) == GUEST_UID && $allow_anon)
{ {
if ($userdata = CACHE('bb_cache')->get('anonymous_userdata')) if ($userdata = CACHE('bb_cache')->get('anonymous_userdata'))
{ {
@ -1432,7 +1432,7 @@ function get_userdata ($u, $force_name = false, $allow_anon = false)
$userdata = array(); $userdata = array();
$name_search = false; $name_search = false;
$anon_sql = (!$allow_anon) ? "AND user_id != ". ANONYMOUS : ''; $anon_sql = (!$allow_anon) ? "AND user_id != ". GUEST_UID : '';
if ($force_name || !is_numeric($u)) if ($force_name || !is_numeric($u))
{ {
@ -1456,7 +1456,7 @@ function get_userdata ($u, $force_name = false, $allow_anon = false)
} }
} }
if ($userdata['user_id'] == ANONYMOUS) if ($userdata['user_id'] == GUEST_UID)
{ {
CACHE('bb_cache')->set('anonymous_userdata', $userdata); CACHE('bb_cache')->set('anonymous_userdata', $userdata);
} }
@ -2866,11 +2866,11 @@ function profile_url($data)
if(!$bb_cfg['color_nick']) $style = ''; if(!$bb_cfg['color_nick']) $style = '';
$username = !empty($data['username']) ? $data['username'] : $lang['GUEST']; $username = !empty($data['username']) ? $data['username'] : $lang['GUEST'];
$user_id = (!empty($data['user_id']) && $username != $lang['GUEST']) ? $data['user_id'] : ANONYMOUS; $user_id = (!empty($data['user_id']) && $username != $lang['GUEST']) ? $data['user_id'] : GUEST_UID;
$profile = '<span title="'. $title .'" class="'. $style .'">'. $username .'</span>'; $profile = '<span title="'. $title .'" class="'. $style .'">'. $username .'</span>';
if(!in_array($user_id, array('', ANONYMOUS, BOT_UID)) && $username) if(!in_array($user_id, array('', GUEST_UID, BOT_UID)) && $username)
{ {
$profile = '<a href="'. make_url(PROFILE_URL . $user_id) .'">'. $profile .'</a>'; $profile = '<a href="'. make_url(PROFILE_URL . $user_id) .'">'. $profile .'</a>';
} }

View file

@ -155,12 +155,12 @@ function sync ($type, $id)
REPLACE INTO $tmp_user_posts REPLACE INTO $tmp_user_posts
SELECT user_id, 0 SELECT user_id, 0
FROM ". BB_USERS ." FROM ". BB_USERS ."
WHERE user_id != ". ANONYMOUS ." WHERE user_id != ". GUEST_UID ."
$where_user_sql $where_user_sql
UNION UNION
SELECT poster_id, COUNT(*) SELECT poster_id, COUNT(*)
FROM ". BB_POSTS ." FROM ". BB_POSTS ."
WHERE poster_id != ". ANONYMOUS ." WHERE poster_id != ". GUEST_UID ."
$where_post_sql $where_post_sql
GROUP BY poster_id GROUP BY poster_id
"); ");
@ -269,7 +269,7 @@ function topic_delete ($mode_or_topic_id, $forum_id = null, $prune_time = 0, $pr
SELECT p.poster_id, COUNT(p.post_id) SELECT p.poster_id, COUNT(p.post_id)
FROM ". $tmp_delete_topics ." del, ". BB_POSTS ." p FROM ". $tmp_delete_topics ." del, ". BB_POSTS ." p
WHERE p.topic_id = del.topic_id WHERE p.topic_id = del.topic_id
AND p.poster_id != ". ANONYMOUS ." AND p.poster_id != ". GUEST_UID ."
GROUP BY p.poster_id GROUP BY p.poster_id
"); ");

View file

@ -594,7 +594,7 @@ function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topi
$sql = "SELECT u.user_id, u.user_email, u.user_lang $sql = "SELECT u.user_id, u.user_email, u.user_lang
FROM " . BB_TOPICS_WATCH . " tw, " . BB_USERS . " u FROM " . BB_TOPICS_WATCH . " tw, " . BB_USERS . " u
WHERE tw.topic_id = $topic_id WHERE tw.topic_id = $topic_id
AND tw.user_id NOT IN (" . $userdata['user_id'] . ", " . BOT_UID . ", " . ANONYMOUS . $user_id_sql . ") AND tw.user_id NOT IN (" . $userdata['user_id'] . ", " . BOT_UID . ", " . GUEST_UID . $user_id_sql . ")
AND tw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . " AND tw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . "
AND u.user_id = tw.user_id"; AND u.user_id = tw.user_id";
if (!($result = DB()->sql_query($sql))) if (!($result = DB()->sql_query($sql)))
@ -808,7 +808,7 @@ function topic_review ($topic_id)
$review_posts = DB()->fetch_rowset(" $review_posts = DB()->fetch_rowset("
SELECT SELECT
p.*, h.post_html, IF(h.post_html IS NULL, pt.post_text, NULL) AS post_text, 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_rank IF(p.poster_id = ". GUEST_UID .", p.post_username, u.username) AS username, u.user_rank
FROM ". BB_POSTS ." p FROM ". BB_POSTS ." p
LEFT JOIN ". BB_USERS ." u ON(u.user_id = p.poster_id) 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) LEFT JOIN ". BB_POSTS_TEXT ." pt ON(pt.post_id = p.post_id)

View file

@ -135,7 +135,7 @@ define('GROUP_MEMBER', 20);
define('CP_HOLDER', 25); define('CP_HOLDER', 25);
$excluded_users = array( $excluded_users = array(
ANONYMOUS, GUEST_UID,
BOT_UID, BOT_UID,
); );
define('EXCLUDED_USERS_CSV', implode(',', $excluded_users)); define('EXCLUDED_USERS_CSV', implode(',', $excluded_users));

View file

@ -69,7 +69,7 @@ class report_module
global $userdata; global $userdata;
} }
if ($userdata['user_id'] == ANONYMOUS) if ($userdata['user_id'] == GUEST_UID)
{ {
return false; return false;
} }

View file

@ -102,7 +102,7 @@ class user_common
else else
{ {
$SQL['WHERE'][] = "s.session_ip = '". USER_IP ."'"; $SQL['WHERE'][] = "s.session_ip = '". USER_IP ."'";
$SQL['WHERE'][] = "s.session_user_id = ". ANONYMOUS; $SQL['WHERE'][] = "s.session_user_id = ". GUEST_UID;
$userdata_cache_id = USER_IP; $userdata_cache_id = USER_IP;
} }
@ -151,7 +151,7 @@ class user_common
if ($ip_check_s == $ip_check_u) if ($ip_check_s == $ip_check_u)
{ {
if ($this->data['user_id'] != ANONYMOUS && defined('IN_ADMIN')) if ($this->data['user_id'] != GUEST_UID && defined('IN_ADMIN'))
{ {
define('SID_GET', "sid={$this->data['session_id']}"); define('SID_GET', "sid={$this->data['session_id']}");
} }
@ -179,11 +179,11 @@ class user_common
if (!$this->data) if (!$this->data)
{ {
$login = false; $login = false;
$user_id = ($bb_cfg['allow_autologin'] && $this->sessiondata['uk'] && $this->sessiondata['uid']) ? $this->sessiondata['uid'] : ANONYMOUS; $user_id = ($bb_cfg['allow_autologin'] && $this->sessiondata['uk'] && $this->sessiondata['uid']) ? $this->sessiondata['uid'] : GUEST_UID;
if ($userdata = get_userdata(intval($user_id), false, true)) if ($userdata = get_userdata(intval($user_id), false, true))
{ {
if ($userdata['user_id'] != ANONYMOUS && $userdata['user_active']) if ($userdata['user_id'] != GUEST_UID && $userdata['user_active'])
{ {
if (verify_id($this->sessiondata['uk'], LOGIN_KEY_LENGTH) && $this->verify_autologin_id($userdata, true, false)) if (verify_id($this->sessiondata['uk'], LOGIN_KEY_LENGTH) && $this->verify_autologin_id($userdata, true, false))
{ {
@ -191,9 +191,9 @@ class user_common
} }
} }
} }
if (!$userdata || ($userdata['user_id'] != ANONYMOUS && !$login)) if (!$userdata || ($userdata['user_id'] != GUEST_UID && !$login))
{ {
$userdata = get_userdata(ANONYMOUS, false, true); $userdata = get_userdata(GUEST_UID, false, true);
} }
$this->session_create($userdata, true); $this->session_create($userdata, true);
@ -230,7 +230,7 @@ class user_common
$this->data = $userdata; $this->data = $userdata;
$session_id = $this->sessiondata['sid']; $session_id = $this->sessiondata['sid'];
$login = (int) ($this->data['user_id'] != ANONYMOUS); $login = (int) ($this->data['user_id'] != GUEST_UID);
$is_user = ($this->data['user_level'] != ADMIN); $is_user = ($this->data['user_level'] != ADMIN);
$user_id = (int) $this->data['user_id']; $user_id = (int) $this->data['user_id'];
$mod_admin_session = ($this->data['user_level'] == ADMIN || $this->data['user_level'] == MOD); $mod_admin_session = ($this->data['user_level'] == ADMIN || $this->data['user_level'] == MOD);
@ -377,7 +377,7 @@ class user_common
if ($set_cookie) if ($set_cookie)
{ {
$this->set_session_cookies(ANONYMOUS); $this->set_session_cookies(GUEST_UID);
} }
} }
@ -400,13 +400,13 @@ class user_common
WHERE username = '$username_sql' WHERE username = '$username_sql'
AND user_password = '$password_sql' AND user_password = '$password_sql'
AND user_active = 1 AND user_active = 1
AND user_id != ". ANONYMOUS ." AND user_id != ". GUEST_UID ."
LIMIT 1 LIMIT 1
"; ";
if ($userdata = DB()->fetch_row($sql)) if ($userdata = DB()->fetch_row($sql))
{ {
if (!$userdata['username'] || !$userdata['user_password'] || $userdata['user_id'] == ANONYMOUS || md5(md5($password)) !== $userdata['user_password'] || !$userdata['user_active']) if (!$userdata['username'] || !$userdata['user_password'] || $userdata['user_id'] == GUEST_UID || md5(md5($password)) !== $userdata['user_password'] || !$userdata['user_active'])
{ {
trigger_error('invalid userdata', E_USER_ERROR); trigger_error('invalid userdata', E_USER_ERROR);
} }
@ -431,7 +431,7 @@ class user_common
DB()->query(" DB()->query("
DELETE FROM ". BB_SESSIONS ." DELETE FROM ". BB_SESSIONS ."
WHERE session_ip = '". USER_IP ."' WHERE session_ip = '". USER_IP ."'
AND session_user_id = ". ANONYMOUS ." AND session_user_id = ". GUEST_UID ."
"); ");
return $new_session_userdata; return $new_session_userdata;
@ -477,7 +477,7 @@ class user_common
{ {
global $bb_cfg; global $bb_cfg;
if ($user_id == ANONYMOUS) if ($user_id == GUEST_UID)
{ {
$delete_cookies = array( $delete_cookies = array(
COOKIE_DATA, COOKIE_DATA,
@ -568,7 +568,7 @@ class user_common
define('DEFAULT_LANG_DIR', LANG_ROOT_DIR .'lang_'. $bb_cfg['default_lang'] .'/'); define('DEFAULT_LANG_DIR', LANG_ROOT_DIR .'lang_'. $bb_cfg['default_lang'] .'/');
define('ENGLISH_LANG_DIR', LANG_ROOT_DIR .'lang_english/'); define('ENGLISH_LANG_DIR', LANG_ROOT_DIR .'lang_english/');
if ($this->data['user_id'] != ANONYMOUS) if ($this->data['user_id'] != GUEST_UID)
{ {
if ($this->data['user_lang'] && $this->data['user_lang'] != $bb_cfg['default_lang']) if ($this->data['user_lang'] && $this->data['user_lang'] != $bb_cfg['default_lang'])
{ {
@ -804,7 +804,7 @@ function cache_set_userdata ($userdata, $force = false)
if (!$userdata || (ignore_cached_userdata() && !$force)) return false; if (!$userdata || (ignore_cached_userdata() && !$force)) return false;
$id = ($userdata['user_id'] == ANONYMOUS) ? $userdata['session_ip'] : $userdata['session_id']; $id = ($userdata['user_id'] == GUEST_UID) ? $userdata['session_ip'] : $userdata['session_id'];
return CACHE('session_cache')->set($id, $userdata, $bb_cfg['session_update_intrv']); return CACHE('session_cache')->set($id, $userdata, $bb_cfg['session_update_intrv']);
} }
@ -812,7 +812,7 @@ function cache_rm_userdata ($userdata)
{ {
if (!$userdata) return false; if (!$userdata) return false;
$id = ($userdata['user_id'] == ANONYMOUS) ? $userdata['session_ip'] : $userdata['session_id']; $id = ($userdata['user_id'] == GUEST_UID) ? $userdata['session_ip'] : $userdata['session_id'];
return CACHE('session_cache')->rm($id); return CACHE('session_cache')->rm($id);
} }

View file

@ -75,7 +75,7 @@ if ($show_dl_list)
} }
else else
{ {
$u_prof_href = ($u['user_id'] == ANONYMOUS) ? '#' : "profile.php?mode=viewprofile&amp;u=". $u['user_id'] ."#torrent"; $u_prof_href = ($u['user_id'] == GUEST_UID) ? '#' : "profile.php?mode=viewprofile&amp;u=". $u['user_id'] ."#torrent";
$dl_cat[$u['user_status']] .= '<nobr><a class="'. $u_link_class .'" href="'. $u_prof_href .'" title="'. $u['last_modified_dlstatus'] .'">'. profile_url(array('username' => $u['username'], 'user_rank' => $u['user_rank'])) .'</a></nobr>, '; $dl_cat[$u['user_status']] .= '<nobr><a class="'. $u_link_class .'" href="'. $u_prof_href .'" title="'. $u['last_modified_dlstatus'] .'">'. profile_url(array('username' => $u['username'], 'user_rank' => $u['user_rank'])) .'</a></nobr>, ';
$dl_count[$u['user_status']]++; $dl_count[$u['user_status']]++;
} }

View file

@ -86,7 +86,7 @@ switch ($mode)
); );
$pr_data = array( $pr_data = array(
'user_id' => ANONYMOUS, 'user_id' => GUEST_UID,
'username' => '', 'username' => '',
'user_password' => '', 'user_password' => '',
'user_email' => '', 'user_email' => '',

View file

@ -2,7 +2,7 @@
if (!defined('BB_ROOT')) die(basename(__FILE__)); if (!defined('BB_ROOT')) die(basename(__FILE__));
if (empty($_GET[POST_USERS_URL]) || $_GET[POST_USERS_URL] == ANONYMOUS) bb_die($lang['NO_USER_ID_SPECIFIED']); if (empty($_GET[POST_USERS_URL]) || $_GET[POST_USERS_URL] == GUEST_UID) bb_die($lang['NO_USER_ID_SPECIFIED']);
if (!$profiledata = get_userdata($_GET[POST_USERS_URL])) bb_die($lang['NO_USER_ID_SPECIFIED']); if (!$profiledata = get_userdata($_GET[POST_USERS_URL])) bb_die($lang['NO_USER_ID_SPECIFIED']);

View file

@ -8,7 +8,7 @@ $datastore->enqueue(array(
'ranks', 'ranks',
)); ));
if (empty($_GET[POST_USERS_URL]) || $_GET[POST_USERS_URL] == ANONYMOUS) if (empty($_GET[POST_USERS_URL]) || $_GET[POST_USERS_URL] == GUEST_UID)
{ {
bb_die($lang['NO_USER_ID_SPECIFIED']); bb_die($lang['NO_USER_ID_SPECIFIED']);
} }

View file

@ -65,7 +65,7 @@ if (!$forums = $datastore->get('cat_forums'))
$cat_title_html = $forums['cat_title_html']; $cat_title_html = $forums['cat_title_html'];
$forum_name_html = $forums['forum_name_html']; $forum_name_html = $forums['forum_name_html'];
$anon = ANONYMOUS; $anon = GUEST_UID;
$excluded_forums_csv = $user->get_excluded_forums(AUTH_VIEW); $excluded_forums_csv = $user->get_excluded_forums(AUTH_VIEW);
$only_new = $user->opt_js['only_new']; $only_new = $user->opt_js['only_new'];

View file

@ -646,7 +646,7 @@ switch ($mode)
break; break;
case 'ip': case 'ip':
$anon = ANONYMOUS; $anon = GUEST_UID;
$rdns_ip_num = ( isset($_GET['rdns']) ) ? $_GET['rdns'] : ""; $rdns_ip_num = ( isset($_GET['rdns']) ) ? $_GET['rdns'] : "";
@ -755,7 +755,7 @@ switch ($mode)
'ROW_CLASS' => !($i % 2) ? 'row4' : 'row5', 'ROW_CLASS' => !($i % 2) ? 'row4' : 'row5',
'USERNAME' => wbr($username), 'USERNAME' => wbr($username),
'POSTS' => $row['postings'], 'POSTS' => $row['postings'],
'U_PROFILE' => ($id == ANONYMOUS) ? "modcp.php?mode=ip&amp;p=$post_id&amp;t=$topic_id" : PROFILE_URL . $id, 'U_PROFILE' => ($id == GUEST_UID) ? "modcp.php?mode=ip&amp;p=$post_id&amp;t=$topic_id" : PROFILE_URL . $id,
'U_SEARCHPOSTS' => "search.php?search_author=1&amp;uid=$id", 'U_SEARCHPOSTS' => "search.php?search_author=1&amp;uid=$id",
)); ));

View file

@ -726,7 +726,7 @@ else
} }
else else
{ {
$username = ( $post_info['user_id'] == ANONYMOUS && !empty($post_info['post_username']) ) ? $post_info['post_username'] : ''; $username = ( $post_info['user_id'] == GUEST_UID && !empty($post_info['post_username']) ) ? $post_info['post_username'] : '';
} }
} }
} }
@ -738,7 +738,7 @@ if ($error_msg)
)); ));
} }
if (IS_GUEST || ($mode == 'editpost' && $post_info['poster_id'] == ANONYMOUS)) if (IS_GUEST || ($mode == 'editpost' && $post_info['poster_id'] == GUEST_UID))
{ {
$template->assign_var('POSTING_USERNAME'); $template->assign_var('POSTING_USERNAME');
} }
@ -748,7 +748,7 @@ if (IS_GUEST || ($mode == 'editpost' && $post_info['poster_id'] == ANONYMOUS))
// //
if (!IS_GUEST) if (!IS_GUEST)
{ {
if ($mode != 'editpost' || ($mode == 'editpost' && $post_info['poster_id'] != ANONYMOUS)) if ($mode != 'editpost' || ($mode == 'editpost' && $post_info['poster_id'] != GUEST_UID))
{ {
$template->assign_var('SHOW_NOTIFY_CHECKBOX'); $template->assign_var('SHOW_NOTIFY_CHECKBOX');
} }

View file

@ -956,7 +956,7 @@ else if ( $submit || $refresh || $mode != '' )
$to_userdata = get_userdata ($to_username_sql); $to_userdata = get_userdata ($to_username_sql);
if (!$to_userdata || $to_userdata['user_id'] == ANONYMOUS) if (!$to_userdata || $to_userdata['user_id'] == GUEST_UID)
{ {
$error = TRUE; $error = TRUE;
$error_msg = $lang['NO_SUCH_USER']; $error_msg = $lang['NO_SUCH_USER'];
@ -1199,7 +1199,7 @@ else if ( $submit || $refresh || $mode != '' )
$sql = "SELECT username $sql = "SELECT username
FROM " . BB_USERS . " FROM " . BB_USERS . "
WHERE user_id = $user_id WHERE user_id = $user_id
AND user_id <> " . ANONYMOUS; AND user_id <> " . GUEST_UID;
if ( !($result = DB()->sql_query($sql)) ) if ( !($result = DB()->sql_query($sql)) )
{ {
$error = TRUE; $error = TRUE;

View file

@ -85,7 +85,7 @@ $poster_name_max_len = 25;
$start = isset($_REQUEST['start']) ? abs(intval($_REQUEST['start'])) : 0; $start = isset($_REQUEST['start']) ? abs(intval($_REQUEST['start'])) : 0;
$url = basename(__FILE__); $url = basename(__FILE__);
$anon_id = ANONYMOUS; $anon_id = GUEST_UID;
$user_id = $userdata['user_id']; $user_id = $userdata['user_id'];
$lastvisit = (IS_GUEST) ? TIMENOW : $userdata['user_lastvisit']; $lastvisit = (IS_GUEST) ? TIMENOW : $userdata['user_lastvisit'];
$search_id = (isset($_GET['id']) && verify_id($_GET['id'], SEARCH_ID_LENGTH)) ? $_GET['id'] : ''; $search_id = (isset($_GET['id']) && verify_id($_GET['id'], SEARCH_ID_LENGTH)) ? $_GET['id'] : '';
@ -930,7 +930,7 @@ function username_search ($search_match)
SELECT username SELECT username
FROM ". BB_USERS ." FROM ". BB_USERS ."
WHERE username LIKE '". DB()->escape($username_search) . "' WHERE username LIKE '". DB()->escape($username_search) . "'
AND user_id <> ". ANONYMOUS ." AND user_id <> ". GUEST_UID ."
ORDER BY username ORDER BY username
LIMIT 200 LIMIT 200
"; ";

View file

@ -410,9 +410,9 @@ if (!$set_default)
if ($req_poster_id) if ($req_poster_id)
{ {
if ($req_poster_id == ANONYMOUS) if ($req_poster_id == GUEST_UID)
{ {
$poster_id_val = ANONYMOUS; $poster_id_val = GUEST_UID;
$poster_name_val = $lang['GUEST']; $poster_name_val = $lang['GUEST'];
} }
else if ($poster_name_val = get_username($req_poster_id)) else if ($poster_name_val = get_username($req_poster_id))

View file

@ -22,7 +22,7 @@ $forum_id = (int) request_var('f', '');
$start = abs(intval(request_var('start', ''))); $start = abs(intval(request_var('start', '')));
$mark_read = (request_var('mark', '') === 'topics'); $mark_read = (request_var('mark', '') === 'topics');
$anon = ANONYMOUS; $anon = GUEST_UID;
// Start session // Start session
$user->session_start(); $user->session_start();

View file

@ -802,17 +802,17 @@ $this_date = bb_date(TIMENOW ,'md', 'false');
for($i = 0; $i < $total_posts; $i++) for($i = 0; $i < $total_posts; $i++)
{ {
$poster_id = $postrow[$i]['user_id']; $poster_id = $postrow[$i]['user_id'];
$poster = ( $poster_id == ANONYMOUS ) ? $lang['GUEST'] : $postrow[$i]['username']; $poster = ( $poster_id == GUEST_UID ) ? $lang['GUEST'] : $postrow[$i]['username'];
$poster_birthday = ($postrow[$i]['user_id'] != ANONYMOUS) ? date('md', strtotime($postrow[$i]['user_birthday'])) : ''; $poster_birthday = ($postrow[$i]['user_id'] != GUEST_UID) ? date('md', strtotime($postrow[$i]['user_birthday'])) : '';
$post_date = bb_date($postrow[$i]['post_time'], $bb_cfg['post_date_format']); $post_date = bb_date($postrow[$i]['post_time'], $bb_cfg['post_date_format']);
$max_post_time = max($max_post_time, $postrow[$i]['post_time']); $max_post_time = max($max_post_time, $postrow[$i]['post_time']);
$poster_posts = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $postrow[$i]['user_posts'] : ''; $poster_posts = ( $postrow[$i]['user_id'] != GUEST_UID ) ? $postrow[$i]['user_posts'] : '';
$poster_from = ( $postrow[$i]['user_from'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? $postrow[$i]['user_from'] : ''; $poster_from = ( $postrow[$i]['user_from'] && $postrow[$i]['user_id'] != GUEST_UID ) ? $postrow[$i]['user_from'] : '';
$poster_joined = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['JOINED'] . ': ' . bb_date($postrow[$i]['user_regdate'], $lang['DATE_FORMAT']) : ''; $poster_joined = ( $postrow[$i]['user_id'] != GUEST_UID ) ? $lang['JOINED'] . ': ' . bb_date($postrow[$i]['user_regdate'], $lang['DATE_FORMAT']) : '';
$poster_longevity = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? delta_time($postrow[$i]['user_regdate']) : ''; $poster_longevity = ( $postrow[$i]['user_id'] != GUEST_UID ) ? delta_time($postrow[$i]['user_regdate']) : '';
$poster_avatar = ''; $poster_avatar = '';
if ( !$user->opt_js['h_av'] && $poster_id != ANONYMOUS ) if ( !$user->opt_js['h_av'] && $poster_id != GUEST_UID )
{ {
$poster_avatar = get_avatar($postrow[$i]['user_avatar'], $postrow[$i]['user_avatar_type'], !bf($postrow[$i]['user_opt'], 'user_opt', 'allow_avatar')); $poster_avatar = get_avatar($postrow[$i]['user_avatar'], $postrow[$i]['user_avatar_type'], !bf($postrow[$i]['user_opt'], 'user_opt', 'allow_avatar'));
} }
@ -826,7 +826,7 @@ for($i = 0; $i < $total_posts; $i++)
} }
// Handle anon users posting with usernames // Handle anon users posting with usernames
if ($poster_id == ANONYMOUS && $postrow[$i]['post_username'] != '') if ($poster_id == GUEST_UID && $postrow[$i]['post_username'] != '')
{ {
$poster = $postrow[$i]['post_username']; $poster = $postrow[$i]['post_username'];
} }
@ -834,7 +834,7 @@ for($i = 0; $i < $total_posts; $i++)
// Buttons // Buttons
$pm_btn = $profile_btn = $delpost_btn = $edit_btn = $ip_btn = $quote_btn = ''; $pm_btn = $profile_btn = $delpost_btn = $edit_btn = $ip_btn = $quote_btn = '';
if ($poster_id != ANONYMOUS) if ($poster_id != GUEST_UID)
{ {
$profile_btn = true; $profile_btn = true;
$pm_btn = true; $pm_btn = true;