git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@233 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
nanosimbiot 2011-08-21 04:33:25 +00:00
commit 42e507435f
11 changed files with 48 additions and 118 deletions

View file

@ -90,7 +90,7 @@ else if( isset($_GET['pane']) && $_GET['pane'] == 'right' )
}
@closedir($avatar_dir);
if($avatar_dir_size >= 1048576)
{
$avatar_dir_size = round($avatar_dir_size / 1048576 * 100) / 100 . " MB";
@ -132,62 +132,7 @@ else if( isset($_GET['pane']) && $_GET['pane'] == 'right' )
// This code is heavily influenced by a similar routine
// in phpMyAdmin 2.2.0
//
/*
if( preg_match("/^mysql/", SQL_LAYER) )
{
$sql = "SELECT VERSION() AS mysql_version";
if($result = DB()->sql_query($sql))
{
$row = DB()->sql_fetchrow($result);
$version = $row['mysql_version'];
if( preg_match("/^(3\.23|4\.|5\.)/", $version) )
{
$db_name = ( preg_match("/^(3\.23\.[6-9])|(3\.23\.[1-9][1-9])|(4\.)|(5\.)/", $version) ) ? "`".DBNAME."`" : DBNAME;
$sql = "SHOW TABLE STATUS FROM " . $db_name;
if($result = DB()->sql_query($sql))
{
$tabledata_ary = DB()->sql_fetchrowset($result);
$dbsize = 0;
for($i = 0; $i < count($tabledata_ary); $i++)
{
if( @$tabledata_ary[$i]['Type'] != "MRG_MyISAM" )
{
$dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length'];
}
}
} // Else we couldn't get the table status.
}
else
{
$dbsize = $lang['NOT_AVAILABLE'];
}
}
else
{
$dbsize = $lang['NOT_AVAILABLE'];
}
}
else if( preg_match("/^mssql/", SQL_LAYER) )
{
$sql = "SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize
FROM sysfiles";
if( $result = DB()->sql_query($sql) )
{
$dbsize = ( $row = DB()->sql_fetchrow($result) ) ? intval($row['dbsize']) : $lang['NOT_AVAILABLE'];
}
else
{
$dbsize = $lang['NOT_AVAILABLE'];
}
}
else
{
$dbsize = $lang['NOT_AVAILABLE'];
}
*/
$dbsize = $lang['NOT_AVAILABLE'];
if ( is_integer($dbsize) )
@ -229,7 +174,7 @@ else if( isset($_GET['pane']) && $_GET['pane'] == 'right' )
//
// Get users online information.
//
$sql = "SELECT u.user_id, u.username, s.session_time AS user_session_time, u.user_opt, s.session_logged_in, s.session_ip, s.session_start
$sql = "SELECT u.user_id, u.username, u.user_rank, s.session_time AS user_session_time, u.user_opt, s.session_logged_in, s.session_ip, s.session_start
FROM " . BB_USERS . " u, " . BB_SESSIONS . " s
WHERE s.session_logged_in = 1
AND u.user_id = s.session_user_id
@ -253,20 +198,6 @@ else if( isset($_GET['pane']) && $_GET['pane'] == 'right' )
}
$onlinerow_guest = DB()->sql_fetchrowset($result);
$sql = "SELECT forum_name, forum_id
FROM " . BB_FORUMS;
if($forums_result = DB()->sql_query($sql))
{
while($forumsrow = DB()->sql_fetchrow($forums_result))
{
$forum_data[$forumsrow['forum_id']] = $forumsrow['forum_name'];
}
}
else
{
message_die(GENERAL_ERROR, "Couldn't obtain user/online forums information.", "", __LINE__, __FILE__, $sql);
}
$reg_userid_ary = array();
if( count($onlinerow_reg) )
@ -297,14 +228,13 @@ else if( isset($_GET['pane']) && $_GET['pane'] == 'right' )
$reg_ip = decode_ip($onlinerow_reg[$i]['session_ip']);
$template->assign_block_vars("reg_user_row", array(
"ROW_CLASS" => $row_class,
"USERNAME" => $username,
"STARTED" => bb_date($onlinerow_reg[$i]['session_start'], 'H:i'),
"LASTUPDATE" => bb_date($onlinerow_reg[$i]['user_session_time'], 'H:i'),
"ROW_CLASS" => $row_class,
"USER" => profile_url($onlinerow_reg[$i]),
"STARTED" => bb_date($onlinerow_reg[$i]['session_start'], 'H:i', 'false'),
"LASTUPDATE" => bb_date($onlinerow_reg[$i]['user_session_time'], 'H:i', 'false'),
"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&amp;" . POST_USERS_URL . "=" . $onlinerow_reg[$i]['user_id']),
));
}
}
@ -334,10 +264,10 @@ else if( isset($_GET['pane']) && $_GET['pane'] == 'right' )
$guest_ip = decode_ip($onlinerow_guest[$i]['session_ip']);
$template->assign_block_vars("guest_user_row", array(
"ROW_CLASS" => $row_class,
"USERNAME" => $lang['GUEST'],
"STARTED" => bb_date($onlinerow_guest[$i]['session_start'], 'H:i'),
"LASTUPDATE" => bb_date($onlinerow_guest[$i]['session_time'], 'H:i'),
"ROW_CLASS" => $row_class,
"USERNAME" => $lang['GUEST'],
"STARTED" => bb_date($onlinerow_guest[$i]['session_start'], 'H:i', 'false'),
"LASTUPDATE" => bb_date($onlinerow_guest[$i]['session_time'], 'H:i' , 'false'),
"IP_ADDRESS" => $guest_ip,
"U_WHOIS_IP" => "http://ip-whois.net/ip_geo.php?ip=$guest_ip",
));

View file

@ -64,11 +64,11 @@ switch ($field)
if($b_day || $b_md || $b_year)
{
if((bb_date(TIMENOW, 'Y', '', false) - $b_year) > $bb_cfg['birthday']['max_user_age'])
if((bb_date(TIMENOW, 'Y', 'false') - $b_year) > $bb_cfg['birthday']['max_user_age'])
{
$this->ajax_die(sprintf($lang['BIRTHDAY_TO_HIGH'], $bb_cfg['birthday']['max_user_age']));
}
else if((bb_date(TIMENOW, 'Y', '', false) - $b_year) < $bb_cfg['birthday']['min_user_age'])
else if((bb_date(TIMENOW, 'Y', 'false') - $b_year) < $bb_cfg['birthday']['min_user_age'])
{
$this->ajax_die(sprintf($lang['BIRTHDAY_TO_LOW'], $bb_cfg['birthday']['min_user_age']));
}

View file

@ -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'] = 'R232';
$bb_cfg['tp_release_state'] = 'R233';
$bb_cfg['tp_release_date'] = '21-08-2011';
$bb_cfg['board_disabled_msg'] = 'форум временно отключен'; // 'forums temporarily disabled'; // show this msg if board has been disabled via ON/OFF trigger

View file

@ -49,9 +49,9 @@ if ($bb_cfg['gender'])
if ($bb_cfg['birthday']['check_day'] && $bb_cfg['birthday']['enabled'])
{
$sql = DB()->fetch_rowset("SELECT user_id, username, user_birthday, user_birthday, user_rank FROM ". BB_USERS ." WHERE user_id NOT IN(". EXCLUDED_USERS_CSV .") ORDER BY user_level DESC, username");
$this_year = bb_date(TIMENOW, 'Y', '', false);
$date_today = bb_date(TIMENOW, 'Ymd', '', false);
$date_forward = bb_date(TIMENOW + ($bb_cfg['birthday']['check_day']*86400), 'Ymd', '', false);
$this_year = bb_date(TIMENOW, 'Y', 'false');
$date_today = bb_date(TIMENOW, 'Ymd', 'false');
$date_forward = bb_date(TIMENOW + ($bb_cfg['birthday']['check_day']*86400), 'Ymd', 'false');
$birthday_today_list = $birthday_week_list = array();
@ -66,21 +66,20 @@ if ($bb_cfg['birthday']['check_day'] && $bb_cfg['birthday']['enabled'])
{
// user are having birthday within the next days
$birthday_week_list[] = array(
'user_id' => $row['user_id'],
'username' => $row['username'],
'rank' => $row['user_rank'],
'age' => $row['user_birthday'],
'user_id' => $row['user_id'],
'username' => $row['username'],
'user_rank' => $row['user_rank'],
'age' => $row['user_birthday'],
);
}
elseif ($user_birthday2 == $date_today)
{
//user have birthday today
$birthday_today_list[] = array(
'user_id' => $row['user_id'],
'username' => $row['username'],
'level' => $row['user_level'],
'rank' => $row['user_rank'],
'age' => $row['user_birthday'],
'user_id' => $row['user_id'],
'username' => $row['username'],
'user_rank' => $row['user_rank'],
'age' => $row['user_birthday'],
);
}
}

View file

@ -1558,14 +1558,17 @@ function setup_style ()
}
// Create date/time from format and timezone
function bb_date ($gmepoch, $format = false, $tz = null, $replace = true)
function bb_date ($gmepoch, $format = false, $tz = null)
{
global $bb_cfg, $lang;
if (is_null($tz))
{
$tz = $bb_cfg['board_timezone'];
$replace = true;
}
else $replace = false;
if (!$format)
{
$format = $bb_cfg['default_dateformat'];

View file

@ -730,7 +730,7 @@ if($bb_cfg['birthday']['enabled'] && $mode != 'register')
}
$s_birthday .= build_select('b_md', $months, $b_md);
$year = bb_date(TIMENOW, 'Y', '', false);
$year = bb_date(TIMENOW, 'Y', 'false');
$years = array($lang['DELTA_TIME']['INTERVALS']['year'][0] => 0);
for($i=$year-$bb_cfg['birthday']['max_user_age']; $i<=$year-$bb_cfg['birthday']['min_user_age']; $i++)
{

View file

@ -331,7 +331,7 @@ if ($bb_cfg['show_latest_news'])
$template->assign_block_vars('news', array(
'NEWS_TOPIC_ID' => $news['topic_id'],
'NEWS_TITLE' => $news['topic_title'],
'NEWS_TIME' => bb_date($news['topic_time'], 'd-M', '', false),
'NEWS_TIME' => bb_date($news['topic_time'], 'd-M', 'false'),
'NEWS_IS_NEW' => is_unread($news['topic_time'], $news['topic_id'], $news['forum_id']),
));
}

View file

@ -489,7 +489,7 @@ if ($post_mode)
t.*,
p.*,
h.post_html, IF(h.post_html IS NULL, pt.post_text, NULL) AS post_text,
IF(p.poster_id = $anon_id, p.post_username, u.username) AS username, u.user_id
IF(p.poster_id = $anon_id, p.post_username, u.username) AS username, u.user_id, u.user_rank
FROM $posts_tbl
INNER JOIN $topics_tbl ON(t.topic_id = p.topic_id)
INNER JOIN $posts_text_tbl ON(pt.post_id = p.post_id)
@ -550,7 +550,7 @@ if ($post_mode)
$template->assign_block_vars('t.p', array(
'ROW_NUM' => $row_num,
'POSTER_ID' => $post['poster_id'],
'POSTER_NAME' => ($post['username']) ? wbr($post['username']) : $lang['GUEST'],
'POSTER' => profile_url($post),
'POST_ID' => $post['post_id'],
'POST_DATE' => bb_date($post['post_time'], $bb_cfg['post_date_format']),
'IS_UNREAD' => is_unread($post['post_time'], $topic_id, $forum_id),
@ -668,9 +668,9 @@ else
$join_dl = ($bb_cfg['show_dl_status_in_search'] && !IS_GUEST);
$SQL['SELECT'][] = "
t.*, t.topic_poster AS first_user_id,
t.*, t.topic_poster AS first_user_id, u1.user_rank AS first_user_rank,
IF(t.topic_poster = $anon_id, p1.post_username, u1.username) AS first_username,
p2.poster_id AS last_user_id,
p2.poster_id AS last_user_id, u2.user_rank AS last_user_rank,
IF(p2.poster_id = $anon_id, p2.post_username, u2.username) AS last_username
";
if ($join_dl) $SQL['SELECT'][] = "dl.user_status AS dl_status";
@ -735,12 +735,10 @@ else
'POLL' => $topic['topic_vote'],
'DL_CLASS' => isset($topic['dl_status']) ? $dl_link_css[$topic['dl_status']] : '',
'TOPIC_AUTHOR_HREF' => ($topic['first_user_id'] != ANONYMOUS) ? $topic['first_user_id'] : '',
'TOPIC_AUTHOR_NAME' => ($topic['first_username']) ? wbr($topic['first_username']) : $lang['GUEST'],
'LAST_POSTER_HREF' => ($topic['last_user_id'] != ANONYMOUS) ? $topic['last_user_id'] : '',
'LAST_POSTER_NAME' => ($topic['last_username']) ? str_short($topic['last_username'], 15) : $lang['GUEST'],
'LAST_POST_TIME' => bb_date($topic['topic_last_post_time']),
'LAST_POST_ID' => $topic['topic_last_post_id'],
'TOPIC_AUTHOR' => profile_url(array('username' => $topic['first_username'], 'user_id' => $topic['first_user_id'], 'user_rank' => $topic['first_user_rank'])),
'LAST_POSTER' => profile_url(array('username' => $topic['last_username'], 'user_id' => $topic['last_user_id'], 'user_rank' => $topic['last_user_rank'])),
'LAST_POST_TIME' => bb_date($topic['topic_last_post_time']),
'LAST_POST_ID' => $topic['topic_last_post_id'],
));
}
}

View file

@ -152,10 +152,10 @@ table.forumline { margin: 0 auto; }
<th>{L_IP_ADDRESS}</th>
</tr>
<!-- BEGIN reg_user_row -->
<tr>
<td nowrap="nowrap" class="{reg_user_row.ROW_CLASS}"><a href="{reg_user_row.U_USER_PROFILE}" class="gen">{reg_user_row.USERNAME}</a></td>
<td align="center" nowrap="nowrap" class="{reg_user_row.ROW_CLASS}">{reg_user_row.STARTED}-{reg_user_row.LASTUPDATE}</td>
<td class="{reg_user_row.ROW_CLASS} tCenter"><a href="{reg_user_row.U_WHOIS_IP}" class="gen" target="_blank">{reg_user_row.IP_ADDRESS}</a></td>
<tr class="{reg_user_row.ROW_CLASS}">
<td nowrap="nowrap">{reg_user_row.USER}</td>
<td align="center" nowrap="nowrap">{reg_user_row.STARTED}-{reg_user_row.LASTUPDATE}</td>
<td class="tCenter"><a href="{reg_user_row.U_WHOIS_IP}" class="gen" target="_blank">{reg_user_row.IP_ADDRESS}</a></td>
</tr>
<!-- END reg_user_row -->
<tr>

View file

@ -28,7 +28,7 @@
<tr class="<!-- IF t.p.ROW_NUM is even -->row1<!-- ELSE -->row2<!-- ENDIF -->">
<td class="poster_info td1">
<p class="nick"><a href="{PROFILE_URL}{t.p.POSTER_ID}">{t.p.POSTER_NAME}</a></p>
<p class="nick">{t.p.POSTER}</p>
<p><img src="{SPACER}" width="{TOPIC_LEFT_COL_SPACER_WITDH}" height="<!-- IF t.p.AVATAR -->2<!-- ELSE -->30<!-- ENDIF -->" alt="" /></p>
</td>
@ -74,9 +74,9 @@
<table class="forumline forum">
<col class="row1">
<col class="row1" width="25%">
<col class="row4" width="75%">
<col class="row2" width="75%">
<col class="row1">
<col class="row4">
<col class="row2">
<col class="row1">
<tr>
<th>&nbsp;</th>
@ -109,12 +109,12 @@
<!-- IF t.PAGINATION --><span class="topicPG">[{ICON_GOTOPOST}{L_GOTO_SHORT} {t.PAGINATION} ]</span><!-- ENDIF -->
</div>
</td>
<td class="med"><!-- IF t.TOPIC_AUTHOR_HREF --><a href="{PROFILE_URL}{t.TOPIC_AUTHOR_HREF}">{t.TOPIC_AUTHOR_NAME}</a><!-- ELSE -->{t.TOPIC_AUTHOR_NAME}<!-- ENDIF --></td>
<td class="med">{t.TOPIC_AUTHOR}</td>
<td class="small">{t.REPLIES}</td>
<td class="small nowrap" style="padding: 1px 4px 3px 4px;">
<p>{t.LAST_POST_TIME}</p>
<p>
<!-- IF t.LAST_POSTER_HREF --><a href="{PROFILE_URL}{t.LAST_POSTER_HREF}">{t.LAST_POSTER_NAME}</a><!-- ELSE -->{t.LAST_POSTER_NAME}<!-- ENDIF -->
{t.LAST_POSTER}
<span onmousedown="$p('tid_{t.TOPIC_ID}').className='opened'"><a href="{POST_URL}{t.LAST_POST_ID}#{t.LAST_POST_ID}">{ICON_LATEST_REPLY}</a></span>
</p>
</td>

View file

@ -780,7 +780,7 @@ if ($allowed_forums)
'VIEWS' => $tor['topic_views'],
'ADDED_RAW' => $tor['reg_time'],
'ADDED_TIME' => bb_date($tor['reg_time'], $time_format),
'ADDED_DATE' => bb_date($tor['reg_time'], $date_format, '', false),
'ADDED_DATE' => bb_date($tor['reg_time'], $date_format, 'false'),
));
}
}