diff --git a/upload/admin/index.php b/upload/admin/index.php index 735dbbc4c..5d5bc57b4 100644 --- a/upload/admin/index.php +++ b/upload/admin/index.php @@ -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&" . 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", )); diff --git a/upload/ajax/edit_user_profile.php b/upload/ajax/edit_user_profile.php index 86793eee6..132fca4f4 100644 --- a/upload/ajax/edit_user_profile.php +++ b/upload/ajax/edit_user_profile.php @@ -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'])); } diff --git a/upload/config.php b/upload/config.php index 312b9f79f..761f0b12b 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'] = '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 diff --git a/upload/includes/datastore/build_stats.php b/upload/includes/datastore/build_stats.php index 0a24719b5..0bc7c90d3 100644 --- a/upload/includes/datastore/build_stats.php +++ b/upload/includes/datastore/build_stats.php @@ -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'], ); } } diff --git a/upload/includes/functions.php b/upload/includes/functions.php index f492e141c..c9678dfab 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -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']; diff --git a/upload/includes/ucp/usercp_register.php b/upload/includes/ucp/usercp_register.php index 4f438d6f2..3752c2c98 100644 --- a/upload/includes/ucp/usercp_register.php +++ b/upload/includes/ucp/usercp_register.php @@ -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++) { diff --git a/upload/index.php b/upload/index.php index 3d4f0bec0..02ee60335 100644 --- a/upload/index.php +++ b/upload/index.php @@ -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']), )); } diff --git a/upload/search.php b/upload/search.php index 943c08835..05c16eec8 100644 --- a/upload/search.php +++ b/upload/search.php @@ -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'], )); } } diff --git a/upload/templates/admin/index.tpl b/upload/templates/admin/index.tpl index f8e0544b5..f8ee94761 100644 --- a/upload/templates/admin/index.tpl +++ b/upload/templates/admin/index.tpl @@ -152,10 +152,10 @@ table.forumline { margin: 0 auto; }
{t.p.POSTER}
@@ -109,12 +109,12 @@ [{ICON_GOTOPOST}{L_GOTO_SHORT} {t.PAGINATION} ] - | {t.TOPIC_AUTHOR_NAME}{t.TOPIC_AUTHOR_NAME} | +{t.TOPIC_AUTHOR} | {t.REPLIES} |
{t.LAST_POST_TIME} - {t.LAST_POSTER_NAME}{t.LAST_POSTER_NAME} + {t.LAST_POSTER} {ICON_LATEST_REPLY} |
diff --git a/upload/tracker.php b/upload/tracker.php
index ee1b3e06f..5aa940aa5 100644
--- a/upload/tracker.php
+++ b/upload/tracker.php
@@ -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'),
));
}
}
---|