diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql
index 9da87cd9f..f3bb0ce54 100644
--- a/install/sql/mysql.sql
+++ b/install/sql/mysql.sql
@@ -660,6 +660,7 @@ INSERT INTO `bb_config` VALUES ('network_news_count', '5');
INSERT INTO `bb_config` VALUES ('network_news_forum_id', '2');
INSERT INTO `bb_config` VALUES ('whois_info', 'http://ip-whois.net/ip_geo.php?ip=');
INSERT INTO `bb_config` VALUES ('show_mod_index', '1');
+INSERT INTO `bb_config` VALUES ('premod', '0');
-- --------------------------------------------------------
diff --git a/upload/admin/admin_board.php b/upload/admin/admin_board.php
index 4a6b14742..7402aed73 100644
--- a/upload/admin/admin_board.php
+++ b/upload/admin/admin_board.php
@@ -97,7 +97,8 @@ switch($mode)
'L_BIRTHDAY_YEARS' => $lang['DELTA_TIME']['INTERVALS']['year'][2],
'BIRTHDAY_MAX_AGE' => $new['birthday_max_age'],
'BIRTHDAY_MIN_AGE' => $new['birthday_min_age'],
- 'BIRTHDAY_CHECK_DAY' => $new['birthday_check_day'],
+ 'BIRTHDAY_CHECK_DAY' => $new['birthday_check_day'],
+ 'PREMOD' => $new['premod'],
));
break;
diff --git a/upload/ajax.php b/upload/ajax.php
index c38623cb4..d462b05b5 100644
--- a/upload/ajax.php
+++ b/upload/ajax.php
@@ -80,14 +80,12 @@ class ajax_common
'gen_passkey' => array('user'),
'change_torrent' => array('user'),
- 'change_tz' => array('user'),
'view_post' => array('guest'),
'view_torrent' => array('guest'),
'user_register' => array('guest'),
'posts' => array('guest'),
- 'birthday_list' => array('guest'),
- 'get_forum_mods' => array('guest'),
+ 'index_data' => array('guest'),
);
@@ -378,93 +376,10 @@ class ajax_common
else $this->ajax_die($lang['NOT_AUTHORISED']);
}
- function birthday_list()
- {
- global $bb_cfg, $lang, $datastore;
-
- if (!$stats = $datastore->get('stats'))
- {
- $datastore->update('stats');
- $stats = $datastore->get('stats');
- }
-
- $mode = (string) $this->request['mode'];
- switch($mode)
- {
- case 'week':
- if ($stats['birthday_week_list'])
- {
- foreach($stats['birthday_week_list'] as $week)
- {
- $html[] = profile_url($week) .' ('. birthday_age($week['age']) .')';
- }
- $html = sprintf($lang['BIRTHDAY_WEEK'], $bb_cfg['birthday']['check_day'], join(', ', $html));
- }
- else $html = sprintf($lang['NOBIRTHDAY_WEEK'], $bb_cfg['birthday']['check_day']);
- break;
-
- case 'today':
- if ($stats['birthday_today_list'])
- {
- foreach($stats['birthday_today_list'] as $today)
- {
- $html[] = profile_url($today) .' ('. birthday_age($today['age'], 1) .')';
- }
- $html = $lang['BIRTHDAY_TODAY'] . join(', ', $html);
- }
- else $html = $lang['NOBIRTHDAY_TODAY'];
- break;
-
- default:
- $html = '';
- break;
- }
-
- $this->response['html'] = $html;
- $this->response['mode'] = $mode;
- }
-
- function get_forum_mods()
- {
- global $lang, $datastore;
-
- $forum_id = (int) $this->request['forum_id'];
-
- $datastore->enqueue(array(
- 'moderators',
- ));
-
- $moderators = array();
- $mod = $datastore->get('moderators');
-
- if (isset($mod['mod_users'][$forum_id]))
- {
- foreach ($mod['mod_users'][$forum_id] as $user_id)
- {
- $moderators[] = ''. $mod['name_users'][$user_id] .'';
- }
- }
-
- if (isset($mod['mod_groups'][$forum_id]))
- {
- foreach ($mod['mod_groups'][$forum_id] as $group_id)
- {
- $moderators[] = ''. $mod['name_groups'][$group_id] .'';
- }
- }
-
- $html = ': ';
- $html .= ($moderators) ? join(', ', $moderators) : $lang['NONE'];
-
- $this->response['html'] = ''.$html.'';
- unset($moderators, $mod);
- $datastore->rm('moderators');
- }
-
// User groups membership
function group_membership ()
{
- global $user;
+ global $lang, $user;
if (!$user_id = intval($this->request['user_id']) OR !$profiledata = get_userdata($user_id))
{
@@ -521,7 +436,7 @@ class ajax_common
}
else
{
- $this->response['group_list_html'] = 'не член, либо у вас нет прав на просмотр скрытых групп';
+ $this->response['group_list_html'] = $lang['GROUP_HIDDEN'];
}
break;
@@ -574,19 +489,9 @@ class ajax_common
{
require(AJAX_DIR .'topic_tpl.php');
}
-
- function change_tz()
- {
- global $bb_cfg, $userdata;
- $tz = (int) $this->request['tz'];
- if ($tz < -12) $tz = -12;
- if ($tz > 13) $tz = 13;
- if ($tz != $bb_cfg['board_timezone'])
- {
- // Set current user timezone
- DB()->query("UPDATE ". BB_USERS ." SET user_timezone = $tz WHERE user_id = ". $userdata['user_id'] ." LIMIT 1");
- $bb_cfg['board_timezone'] = $tz;
- cache_rm_user_sessions ($userdata['user_id']);
- }
+
+ function index_data()
+ {
+ require(AJAX_DIR .'index_data.php');
}
}
diff --git a/upload/ajax/index_data.php b/upload/ajax/index_data.php
new file mode 100644
index 000000000..80cfce59d
--- /dev/null
+++ b/upload/ajax/index_data.php
@@ -0,0 +1,98 @@
+request['mode'];
+$html = '';
+
+switch($mode)
+{
+ case 'birthday_week':
+ $stats = $datastore->get('stats');
+ $datastore->enqueue(array(
+ 'stats',
+ ));
+
+ if ($stats['birthday_week_list'])
+ {
+ foreach($stats['birthday_week_list'] as $week)
+ {
+ $html[] = profile_url($week) .' ('. birthday_age($week['age']) .')';
+ }
+ $html = sprintf($lang['BIRTHDAY_WEEK'], $bb_cfg['birthday_check_day'], join(', ', $html));
+ }
+ else $html = sprintf($lang['NOBIRTHDAY_WEEK'], $bb_cfg['birthday_check_day']);
+ break;
+
+ case 'birthday_today':
+ $stats = $datastore->get('stats');
+ $datastore->enqueue(array(
+ 'stats',
+ ));
+
+ if ($stats['birthday_today_list'])
+ {
+ foreach($stats['birthday_today_list'] as $today)
+ {
+ $html[] = profile_url($today) .' ('. birthday_age($today['age'], 1) .')';
+ }
+ $html = $lang['BIRTHDAY_TODAY'] . join(', ', $html);
+ }
+ else $html = $lang['NOBIRTHDAY_TODAY'];
+ break;
+
+ case 'get_forum_mods':
+ $forum_id = (int) $this->request['forum_id'];
+
+ $datastore->enqueue(array(
+ 'moderators',
+ ));
+
+ $moderators = array();
+ $mod = $datastore->get('moderators');
+
+ if (isset($mod['mod_users'][$forum_id]))
+ {
+ foreach ($mod['mod_users'][$forum_id] as $user_id)
+ {
+ $moderators[] = ''. $mod['name_users'][$user_id] .'';
+ }
+ }
+
+ if (isset($mod['mod_groups'][$forum_id]))
+ {
+ foreach ($mod['mod_groups'][$forum_id] as $group_id)
+ {
+ $moderators[] = ''. $mod['name_groups'][$group_id] .'';
+ }
+ }
+
+ $html = ': ';
+ $html .= ($moderators) ? join(', ', $moderators) : $lang['NONE'];
+ unset($moderators, $mod);
+ $datastore->rm('moderators');
+
+ break;
+
+ case 'change_tz':
+ $tz = (int) $this->request['tz'];
+ if ($tz < -12) $tz = -12;
+ if ($tz > 13) $tz = 13;
+ if ($tz != $bb_cfg['board_timezone'])
+ {
+ // Set current user timezone
+ DB()->query("UPDATE ". BB_USERS ." SET user_timezone = $tz WHERE user_id = ". $userdata['user_id'] ." LIMIT 1");
+ $bb_cfg['board_timezone'] = $tz;
+ cache_rm_user_sessions ($userdata['user_id']);
+ }
+ break;
+
+ default:
+ $html = '';
+ break;
+}
+
+$this->response['html'] = $html;
+$this->response['mode'] = $mode;
diff --git a/upload/ajax/manage_user.php b/upload/ajax/manage_user.php
index 936a1362c..3b3cf13e7 100644
--- a/upload/ajax/manage_user.php
+++ b/upload/ajax/manage_user.php
@@ -25,7 +25,7 @@ switch($mode)
case 'delete_topics':
if (empty($this->request['confirmed']) && $userdata['user_id'] == $user_id) $this->prompt_for_confirm($lang['DELETE_USER_POSTS_ME']);
- if (empty($this->request['confirmed'])) $this->prompt_for_confirm('Удалить все сообщения и все начатые юзером топики целиком?');
+ if (empty($this->request['confirmed'])) $this->prompt_for_confirm($lang['DELETE_USER_ALL_POSTS_CONFIRM']);
if (IS_ADMIN)
{
@@ -40,7 +40,7 @@ switch($mode)
case 'delete_message':
if (empty($this->request['confirmed']) && $userdata['user_id'] == $user_id) $this->prompt_for_confirm($lang['DELETE_USER_POSTS_ME']);
- if (empty($this->request['confirmed'])) $this->prompt_for_confirm('Удалить все сообщения, кроме заглавных?');
+ if (empty($this->request['confirmed'])) $this->prompt_for_confirm($lang['DELETE_USER_POSTS_CONFIRM']);
if (IS_ADMIN)
{
diff --git a/upload/ajax/mod_action.php b/upload/ajax/mod_action.php
index 891c8d7f4..1ce57855f 100644
--- a/upload/ajax/mod_action.php
+++ b/upload/ajax/mod_action.php
@@ -113,11 +113,6 @@ switch ($mode)
}
$this->response['ip_list_html'] = '
-
'. $lang['REG_IP'] .' | diff --git a/upload/config.php b/upload/config.php index 6bb1d062c..7ab094a62 100644 --- a/upload/config.php +++ b/upload/config.php @@ -52,8 +52,8 @@ $bb_cfg = $tr_cfg = $page_cfg = array(); // Increase number of revision after update $bb_cfg['tp_version'] = '2.4 (beta)'; -$bb_cfg['tp_release_state'] = 'R376'; -$bb_cfg['tp_release_date'] = '22-02-2012'; +$bb_cfg['tp_release_state'] = 'R377'; +$bb_cfg['tp_release_date'] = '25-02-2012'; // Database $charset = 'utf8'; diff --git a/upload/includes/functions_torrent.php b/upload/includes/functions_torrent.php index 6e29ede12..9bed0c95a 100644 --- a/upload/includes/functions_torrent.php +++ b/upload/includes/functions_torrent.php @@ -567,7 +567,7 @@ function send_torrent_with_passkey ($filename) } else { - $announce = strval($ann_url . "?$passkey_key=$passkey_val&"); + $announce = strval($ann_url . "?$passkey_key=$passkey_val"); } // Replace original announce url with tracker default diff --git a/upload/includes/init_bb.php b/upload/includes/init_bb.php index 9d9f2ba54..11904510f 100644 --- a/upload/includes/init_bb.php +++ b/upload/includes/init_bb.php @@ -529,6 +529,11 @@ function htmlCHR ($txt, $double_encode = false, $quote_style = ENT_QUOTES, $char return (string) htmlspecialchars($txt, $quote_style, $charset, $double_encode); } +function html_ent_decode ($txt, $quote_style = ENT_QUOTES, $charset = 'UTF-8') +{ + return (string) html_entity_decode($txt, $quote_style, $charset); +} + function make_url ($path) { return FULL_URL . preg_replace('#^\/?(.*?)\/?$#', '\1', $path); diff --git a/upload/index.php b/upload/index.php index d0ef9c479..4cab40324 100644 --- a/upload/index.php +++ b/upload/index.php @@ -382,7 +382,7 @@ if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled']) $week_list[] = profile_url($week) .' ('. birthday_age($week['age']) .')'; } - $week_all = ($week_all) ? ' ...' : ''; + $week_all = ($week_all) ? ' ...' : ''; $week_list = sprintf($lang['BIRTHDAY_WEEK'], $bb_cfg['birthday_check_day'], join(', ', $week_list)) . $week_all; } else $week_list = sprintf($lang['NOBIRTHDAY_WEEK'], $bb_cfg['birthday_check_day']); @@ -400,7 +400,7 @@ if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled']) $today_list[] = profile_url($today) .' ('. birthday_age($today['age'], 1) .')'; } - $today_all = ($today_all) ? ' ...' : ''; + $today_all = ($today_all) ? ' ...' : ''; $today_list = $lang['BIRTHDAY_TODAY'] . join(', ', $today_list) . $today_all; } else $today_list = $lang['NOBIRTHDAY_TODAY']; diff --git a/upload/language/lang_english/lang_admin.php b/upload/language/lang_english/lang_admin.php index 2f83701bd..15a85d839 100644 --- a/upload/language/lang_english/lang_admin.php +++ b/upload/language/lang_english/lang_admin.php @@ -669,3 +669,5 @@ $lang['PIC_GALLERY'] = 'Directory for the images'; $lang['PIC_SIZE'] = 'The maximum size of images'; $lang['AUTO_DELETE_POSTED_PICS'] = 'Delete Images hosted in remote positions'; $lang['SHOW_MOD_HOME_PAGE'] = 'Show on moderators the index.php'; +$lang['PREMOD_HELP'] = '|
{L_PREMOD_HELP} | ++ + + | +
{L_LATEST_NEWS} | diff --git a/upload/templates/default/css/main.css b/upload/templates/default/css/main.css index e0e085ffb..6cb0e72b5 100644 --- a/upload/templates/default/css/main.css +++ b/upload/templates/default/css/main.css @@ -254,8 +254,8 @@ a.small, a.gensmall { color: #006699; text-decoration: none; } /* ---------------------------------- * Spoiler * ---------------------------------- */ -.sp-wrap { padding: 0; background: #E9E9E6; } -.sp-head { border-width: 0; font-size: 11px; padding: 1px 14px 3px; margin-left: 6px; line-height: 15px; font-weight: bold; color: #2A2A2A; cursor: pointer; } +.sp-wrap { padding: 0; background: #E9E9E6; width:auto;} +.sp-head { border-width: 0; font-size: 11px; padding: 1px 14px 3px; margin-left: 6px; line-height: 15px; font-weight: bold; color: #2A2A2A; cursor: pointer; width:auto;} .sp-body { border-width: 1px 0 0 0; display: none; font-weight: normal; background: #F5F5F5; border-bottom: 1px solid #C3CBD1;} .sp-fold { width: 98%; margin: 0 auto; text-align: right; font-size: 10px; color: #444444; } /* ---------------------------------- * @@ -593,7 +593,11 @@ table.smilies td { padding: 3px; text-align: center; } a.selfMod, a.selfMod:visited { color: #0000FF; } .view-message { border: 1px #A5AFB4 solid; padding: 4px; margin: 6px; overflow: auto; } - +.birthday { margin: 3px 0; padding: 2px 4px; max-height: 200px; overflow: auto;} + +table.mod_ip { background: #F9F9F9; border: 1px solid #A5AFB4; border-collapse: separate;} +table.mod_ip td { padding: 2px 5px; white-space: normal; font-size: 11px; } +table.mod_ip div { max-height: 150px; overflow: auto;} /* ---------------------------------- * Forums on home page * ---------------------------------- */ diff --git a/upload/templates/default/index.tpl b/upload/templates/default/index.tpl index 4609b9a8a..b10509e7c 100644 --- a/upload/templates/default/index.tpl +++ b/upload/templates/default/index.tpl @@ -180,13 +180,13 @@ -