diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql
index 44ed519a7..2f1976222 100644
--- a/install/sql/mysql.sql
+++ b/install/sql/mysql.sql
@@ -1339,7 +1339,6 @@ CREATE TABLE IF NOT EXISTS `bb_users` (
`avatar_ext_id` tinyint(4) NOT NULL,
`user_gender` tinyint(1) NOT NULL DEFAULT '0',
`user_birthday` date NOT NULL DEFAULT '0000-00-00',
- `user_next_birthday_greeting` int(11) NOT NULL DEFAULT '0',
`user_email` varchar(255) NOT NULL DEFAULT '',
`user_skype` varchar(32) NOT NULL DEFAULT '',
`user_twitter` varchar(15) NOT NULL DEFAULT '',
@@ -1365,9 +1364,9 @@ CREATE TABLE IF NOT EXISTS `bb_users` (
-- Дамп данных таблицы `bb_users`
--
-INSERT INTO `bb_users` VALUES (-1, 0, 'Guest', 'd41d8cd98f00b204e9800998ecf8427e', 0, 0, '0', 0, '0', 0, 0, 0.00, '', 0, 0, 0, 0, 0, '', 0, 0, 0, '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default');
-INSERT INTO `bb_users` VALUES (2, 1, 'admin', 'c3284d0f94606de1fd2af172aba15bf3', 0, 0, '0', 0, '0', 1, 1, 4.00, '', 0, 0, 0, 304, 1, '', 0, 0, 0, 'admin@admin.com', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default');
-INSERT INTO `bb_users` VALUES (-746, 0, 'bot', 'd41d8cd98f00b204e9800998ecf8427e', 0, 0, '0', 0, '0', 0, 0, 0.00, '', 0, 0, 0, 144, 0, '', 0, 0, 0, 'bot@bot.bot', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default');
+INSERT INTO `bb_users` VALUES (-1, 0, 'Guest', 'd41d8cd98f00b204e9800998ecf8427e', 0, 0, '0', 0, '0', 0, 0, 0.00, '', 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default');
+INSERT INTO `bb_users` VALUES (2, 1, 'admin', 'c3284d0f94606de1fd2af172aba15bf3', 0, 0, '0', 0, '0', 1, 1, 4.00, '', 0, 0, 0, 304, 1, '', 0, 0, 'admin@admin.com', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default');
+INSERT INTO `bb_users` VALUES (-746, 0, 'bot', 'd41d8cd98f00b204e9800998ecf8427e', 0, 0, '0', 0, '0', 0, 0, 0.00, '', 0, 0, 0, 144, 0, '', 0, 0, 'bot@bot.bot', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default');
-- --------------------------------------------------------
diff --git a/readme.txt b/readme.txt
index 17f4a57ec..070633c1f 100644
--- a/readme.txt
+++ b/readme.txt
@@ -13,23 +13,14 @@
************************************
Устанавливаем права доступа на данные папки 777, на файлы внутри этих папок (кроме .htaccess) 666:
-- ajax
- ajax/html
- cache
- cache/filecache
-- cache/filecache/bb_cache
-- cache/filecache/bb_cap_sid
-- cache/filecache/bb_login_err
-- cache/filecache/bb_poll_data
-- cache/filecache/datastore
-- cache/filecache/session_cache
-- cache/filecache/tr_cache
- files
- files/thumbs
- images
- images/avatars
- images/captcha
-- images/logo
- images/ranks
- images/smiles
- log
@@ -47,7 +38,6 @@ magic_quotes_gpc = Off
************************************
php5-tidy
-php5-sqlite
************************************
** Необходимый запуск cron.php **
diff --git a/upload/admin/index.php b/upload/admin/index.php
index 8266bd411..6b8555cf4 100644
--- a/upload/admin/index.php
+++ b/upload/admin/index.php
@@ -194,25 +194,25 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right')
if( count($onlinerow_reg) )
{
- $registered_users = 0;
+ $registered_users = $hidden_users = 0;
for($i=0, $cnt=count($onlinerow_reg); $i < $cnt; $i++)
{
- if( !inarray($onlinerow_reg[$i]['user_id'], $reg_userid_ary) )
+ if (!in_array($onlinerow_reg[$i]['user_id'], $reg_userid_ary))
{
$reg_userid_ary[] = $onlinerow_reg[$i]['user_id'];
$username = $onlinerow_reg[$i]['username'];
- if( !bf($onlinerow_reg[$i]['user_opt'], 'user_opt', 'allow_viewonline'))
+ if (bf($onlinerow_reg[$i]['user_opt'], 'user_opt', 'user_viewonline'))
{
- $registered_users++;
- $hidden = FALSE;
+ $hidden_users++;
+ $hidden = TRUE;
}
else
{
- @$hidden_users++;
- $hidden = TRUE;
+ $registered_users++;
+ $hidden = FALSE;
}
$row_class = 'row1';
diff --git a/upload/ajax.php b/upload/ajax.php
index 5a7bd9e73..afc893ef0 100644
--- a/upload/ajax.php
+++ b/upload/ajax.php
@@ -87,7 +87,6 @@ class ajax_common
'gen_passkey' => array('user'),
'change_torrent' => array('user'),
'change_tor_status' => array('user'),
- 'view_profile' => array('user'),
'view_post' => array('guest'),
'view_torrent' => array('guest'),
@@ -396,11 +395,6 @@ class ajax_common
require(AJAX_DIR . 'index_data.php');
}
- function view_profile()
- {
- require(AJAX_DIR . 'view_profile.php');
- }
-
function avatar()
{
require(AJAX_DIR . 'avatar.php');
diff --git a/upload/ajax/change_tor_status.php b/upload/ajax/change_tor_status.php
index 135bb2826..e978a8049 100644
--- a/upload/ajax/change_tor_status.php
+++ b/upload/ajax/change_tor_status.php
@@ -65,7 +65,7 @@ switch($mode)
if (empty($this->request['confirmed']))
{
$msg = $lang['TOR_STATUS_OF'] ." {$lang['TOR_STATUS_NAME'][$tor['tor_status']]}\n\n";
- $msg .= ($username = get_username($tor['checked_user_id'])) ? $lang['TOR_STATUS_CHANGED'] . html_entity_decode($username) .", ". delta_time($tor['checked_time']) . $lang['BACK'] ."\n\n" : "";
+ $msg .= ($username = get_username($tor['checked_user_id'])) ? $lang['TOR_STATUS_CHANGED'] . html_entity_decode($username) .", ". delta_time($tor['checked_time']) . $lang['TOR_BACK'] ."\n\n" : "";
$msg .= $lang['PROCEED'] .'?';
$this->prompt_for_confirm($msg);
}
@@ -73,7 +73,7 @@ switch($mode)
change_tor_status($attach_id, $new_status);
- $this->response['status'] = $bb_cfg['tor_icons'][$new_status] .' '. $lang['TOR_STATUS_NAME'][$new_status]. ' · '. profile_url($userdata) .' · '. delta_time(TIMENOW) . $lang['BACK']. '';
+ $this->response['status'] = $bb_cfg['tor_icons'][$new_status] .' '. $lang['TOR_STATUS_NAME'][$new_status]. ' · '. profile_url($userdata) .' · '. delta_time(TIMENOW) . $lang['TOR_BACK']. '';
if ($bb_cfg['tor_comment'] && (($comment && $comment != $lang['COMMENT']) || in_array($new_status, $bb_cfg['tor_reply'])))
{
diff --git a/upload/ajax/edit_user_profile.php b/upload/ajax/edit_user_profile.php
index ee088e569..46b7645d0 100644
--- a/upload/ajax/edit_user_profile.php
+++ b/upload/ajax/edit_user_profile.php
@@ -57,43 +57,28 @@ switch ($field)
case 'user_birthday':
if (!$bb_cfg['birthday_enabled']) $this->ajax_die($lang['MODULE_OFF']);
- $data = explode('-', $value);
- $b_day = (isset($data[2])) ? (int) $data[2] : '';
- $b_md = (isset($data[1])) ? (int) $data[1] : '';
- $b_year = (isset($data[0])) ? (int) $data[0] : '';
+ $birthday_date = date_parse($value);
- if ($b_day || $b_md || $b_year)
+ if (!empty($birthday_date['year']))
{
- if ((bb_date(TIMENOW, 'Y', 'false') - $b_year) > $bb_cfg['birthday_max_age'])
- {
- $this->ajax_die(sprintf($lang['BIRTHDAY_TO_HIGH'], $bb_cfg['birthday_max_age']));
- }
- elseif ((bb_date(TIMENOW, 'Y', 'false') - $b_year) < $bb_cfg['birthday_min_age'])
- {
- $this->ajax_die(sprintf($lang['BIRTHDAY_TO_LOW'], $bb_cfg['birthday_min_age']));
- }
- if (!checkdate($b_md, $b_day, $b_year))
+ if (strtotime($value) >= TIMENOW)
{
$this->ajax_die($lang['WRONG_BIRTHDAY_FORMAT']);
}
- else
+ elseif (bb_date(TIMENOW, 'Y', 'false') - $birthday_date['year'] > $bb_cfg['birthday_max_age'])
{
- $value = "$b_year-$b_md-$b_day";
- $next_birthday_greeting = (date('md') < $b_md . (($b_day <= 9) ? '0' : '') . $b_day) ? date('Y') : date('Y')+1;
+ $this->ajax_die(sprintf($lang['BIRTHDAY_TO_HIGH'], $bb_cfg['birthday_max_age']));
+ }
+ elseif (bb_date(TIMENOW, 'Y', 'false') - $birthday_date['year'] < $bb_cfg['birthday_min_age'])
+ {
+ $this->ajax_die(sprintf($lang['BIRTHDAY_TO_LOW'], $bb_cfg['birthday_min_age']));
}
}
- else
- {
- $value = '';
- $next_birthday_greeting = 0;
- }
- DB()->query("UPDATE $table SET user_next_birthday_greeting = $next_birthday_greeting WHERE user_id = $user_id LIMIT 1");
- $this->response['new_value'] = $this->request['value'];
+ $this->response['new_value'] = $this->request['value'];
break;
case 'user_icq':
- $value = (int) $value;
if ($value && !preg_match('#^\d{6,15}$#', $value))
{
$this->ajax_die($lang['ICQ_ERROR']);
@@ -131,7 +116,7 @@ switch ($field)
{
$this->ajax_die($lang['INVALID_DATE'] . $this->request['value']);
}
- $this->response['new_value'] = bb_date($value);
+ $this->response['new_value'] = bb_date($value, 'Y-m-d H:i', 'false');
break;
case 'u_up_total':
diff --git a/upload/ajax/index_data.php b/upload/ajax/index_data.php
index 2c0a5e42b..efe5bdd28 100644
--- a/upload/ajax/index_data.php
+++ b/upload/ajax/index_data.php
@@ -19,7 +19,7 @@ switch($mode)
{
foreach($stats['birthday_week_list'] as $week)
{
- $html[] = profile_url($week) .' ('. birthday_age($week['age']) .')';
+ $html[] = profile_url($week) .' ('. birthday_age($week['user_birthday']) .')';
}
$html = sprintf($lang['BIRTHDAY_WEEK'], $bb_cfg['birthday_check_day'], join(', ', $html));
}
@@ -36,7 +36,7 @@ switch($mode)
{
foreach($stats['birthday_today_list'] as $today)
{
- $html[] = profile_url($today) .' ('. birthday_age($today['age'], 1) .')';
+ $html[] = profile_url($today) .' ('. birthday_age($today['user_birthday']) .')';
}
$html = $lang['BIRTHDAY_TODAY'] . join(', ', $html);
}
diff --git a/upload/ajax/manage_admin.php b/upload/ajax/manage_admin.php
index 1c1b70d76..6405aeede 100644
--- a/upload/ajax/manage_admin.php
+++ b/upload/ajax/manage_admin.php
@@ -10,19 +10,12 @@ switch ($mode)
{
case 'clear_cache':
- $gc_cache = array(
- 'bb_cache',
- 'tr_cache',
- 'session_cache',
- 'bb_cap_sid',
- 'bb_login_err',
- 'bb_poll_data',
- );
-
- // foreach ($bb_cfg['cache']['engines'] as $cache_name => $cache_val)
- foreach ($gc_cache as $cache_name)
+ foreach ($bb_cfg['cache']['engines'] as $cache_name => $cache_val)
{
- CACHE($cache_name)->rm();
+ if (!in_array('db_sqlite', $cache_val))
+ {
+ CACHE($cache_name)->rm();
+ }
}
$this->response['cache_html'] = ''. $lang['ALL_CACHE_CLEARED'] .'';
diff --git a/upload/ajax/posts.php b/upload/ajax/posts.php
index 64e5b2863..169671b82 100644
--- a/upload/ajax/posts.php
+++ b/upload/ajax/posts.php
@@ -67,7 +67,7 @@ switch($this->request['type'])
break;
case 'reply';
- if (bf($userdata['user_opt'], 'user_opt', 'allow_post'))
+ if (bf($userdata['user_opt'], 'user_opt', 'dis_post'))
{
$this->ajax_die(strip_tags($lang['RULES_REPLY_CANNOT']));
}
@@ -113,7 +113,7 @@ switch($this->request['type'])
case 'edit':
case 'editor':
- if (bf($userdata['user_opt'], 'user_opt', 'allow_post_edit'))
+ if (bf($userdata['user_opt'], 'user_opt', 'dis_post_edit'))
{
$this->ajax_die($lang['POST_EDIT_CANNOT']);
}
@@ -226,7 +226,7 @@ switch($this->request['type'])
$this->ajax_die('empty topic_id');
}
- if (bf($userdata['user_opt'], 'user_opt', 'allow_post'))
+ if (bf($userdata['user_opt'], 'user_opt', 'dis_post'))
{
$this->ajax_die(strip_tags($lang['RULES_REPLY_CANNOT']));
}
diff --git a/upload/ajax/view_profile.php b/upload/ajax/view_profile.php
deleted file mode 100644
index ef757dc89..000000000
--- a/upload/ajax/view_profile.php
+++ /dev/null
@@ -1,167 +0,0 @@
-request['mode'];
-
-switch ($mode)
-{
- case 'active_torrents':
- $user_id = (int) $this->request['user_id'];
- if (!$user_id) $this->ajax_die($lang['NO_USER_ID_SPECIFIED']);
- $user_info = get_userdata($user_id);
- if (!bf($user_info['user_opt'], 'user_opt', 'allow_dls') && !IS_AM && $user_id != $userdata['user_id']) $this->ajax_die($lang['CUR_ACTIVE_DLS_DISALLOWED']);
-
- $excluded_forums_csv = $user->get_excluded_forums(AUTH_VIEW);
- $not_auth_forums_sql = ($excluded_forums_csv) ? "
- AND f.forum_id NOT IN($excluded_forums_csv)
- AND f.forum_parent NOT IN($excluded_forums_csv)
- " : '';
-
- $dl = ' ';
- if(IS_AM || $user_id == $userdata['user_id'])
- {
- $dl_link = "search.php?dlu=$user_id&";
- $dl = '
- '. $lang['SEARCH_DL_WILL_DOWNLOADS'] .'
- ::
- '. $lang['SEARCH_DL_DOWN'] .'
- ::
- '. $lang['SEARCH_DL_COMPLETE'] .'
- ::
- '. $lang['SEARCH_DL_CANCEL'] .'
- ';
- }
-
- $sql = "
- SELECT
- f.forum_id, f.forum_name,
- t.topic_title,
- tor.tor_type, tor.size,
- trs.seeders, trs.leechers,
- tr.*
- FROM ". BB_FORUMS ." f, ". BB_TOPICS ." t, ". BB_BT_TRACKER ." tr, ". BB_BT_TORRENTS ." tor, ". BB_BT_TRACKER_SNAP ." trs
- WHERE tr.user_id = $user_id
- AND tr.topic_id = tor.topic_id
- AND trs.topic_id = tor.topic_id
- AND tor.topic_id = t.topic_id
- AND t.forum_id = f.forum_id
- $not_auth_forums_sql
- GROUP BY tr.topic_id
- ORDER BY tr.releaser DESC, tr.seeder DESC, f.forum_name ASC, t.topic_title ASC";
-
- if (!$result = DB()->sql_query($sql))
- {
- $this->ajax_die('Could not query users torrent profile information', '', __LINE__, __FILE__, $sql);
- }
-
- $r = $s = $l = $releasing_count = $seeding_count = $leeching_count = 0;
-
- if ($rowset = DB()->sql_fetchrowset($result))
- {
- $html = '';
- for ($i=0; $i ';
- }
- elseif ($rowset[$i]['tor_type'] == TOR_TYPE_SILVER)
- {
- $is_gold = '
';
- }
- }
- $topic_title = ($rowset[$i]['update_time']) ? wbr($rowset[$i]['topic_title']) : ''. wbr($rowset[$i]['topic_title']) .'';
- $topic_seeders = ''. $rowset[$i]['seeders'] .'';
- $topic_leechers = ''. $rowset[$i]['leechers'] .'';
- $topic_speed_up = ($rowset[$i]['speed_up']) ? humn_size($rowset[$i]['speed_up'], 0, 'KB') .'/s' : '-';
-
- $compl_perc_html = '';
- $colspan = 'colspan="2" ';
- if ($rowset[$i]['releaser'])
- {
- $r = $r + $rowset[$i]['size'];
- $type = $type = '
'. $lang['RELEASER'] .' | ';
- $releasing_count++;
- }
- elseif ($rowset[$i]['seeder'])
- {
- $s = $s + $rowset[$i]['size'];
- $type = $type = ''. $lang['SEEDER'] .' | ';
- $seeding_count++;
- }
- else
- {
- $l = $l + $rowset[$i]['size'];
- $type = ''. $lang['LEECHER'] .' | ';
-
- $compl_size = ($rowset[$i]['remain'] && $rowset[$i]['size'] && $rowset[$i]['size'] > $rowset[$i]['remain']) ? ($rowset[$i]['size'] - $rowset[$i]['remain']) : 0;
-
- $compl_perc = ($compl_size) ? floor($compl_size * 100 / $rowset[$i]['size']) : 0;
-
- $colspan = '';
- $compl_perc_html = ''. $compl_perc .'% | ';
- $leeching_count++;
- }
-
- $html .= '
-
- '. $type .'
- '. htmlCHR($rowset[$i]['forum_name']) .' |
- '. $is_gold .''. $topic_title .' |
- '. $compl_perc_html .'
-
-
- '. $topic_seeders .' | '. $topic_leechers .'
- '. $topic_speed_up .'
-
- |
-
- ';
- }
-
- $releasing_count = ($releasing_count) ? $releasing_count .' ('. humn_size($r) .')' : 0;
- $seeding_count = ($seeding_count) ? $seeding_count .' ('. humn_size($s) .')' : 0;
- $leeching_count = ($leeching_count) ? $leeching_count .' ('. humn_size($l) .')' : 0;
- }
- else
- {
- $html = '
-
- '. $lang['NONE'] .' |
-
- ';
- }
-
- $this->response['active_torrents'] = '
-
-
-
- '. $lang['CUR_ACTIVE_DLS'] .'
- '. $lang['RELEASING'] .': '. $releasing_count .' :: '. $lang['SEEDING'] .': ' . $seeding_count .' :: '. $lang['LEECHING'] .': ' . $leeching_count .'
-
-
-
-
-
- '. $lang['TYPE'] .' |
- '. $lang['FORUM'] .' |
- '. $lang['TOPICS'] .' |
- '. $lang['TORRENT'] .' |
-
- '. $html .'
-
-
- '. $dl .'
- |
-
-
-
- ';
- break;
-}
\ No newline at end of file
diff --git a/upload/attach_mod/displaying_torrent.php b/upload/attach_mod/displaying_torrent.php
index 2cfe7989d..ff8a8b627 100644
--- a/upload/attach_mod/displaying_torrent.php
+++ b/upload/attach_mod/displaying_torrent.php
@@ -219,7 +219,7 @@ if ($tor_reged && $tor_info)
'TOR_FROZEN' => (!IS_AM) ? (isset($bb_cfg['tor_frozen'][$tor_info['tor_status']]) && !(isset($bb_cfg['tor_frozen_author_download'][$tor_info['tor_status']]) && $userdata['user_id'] == $tor_info['poster_id'])) ? true : '' : '',
'TOR_STATUS_TEXT' => $lang['TOR_STATUS_NAME'][$tor_info['tor_status']],
'TOR_STATUS_ICON' => $bb_cfg['tor_icons'][$tor_info['tor_status']],
- 'TOR_STATUS_BY' => ($tor_info['checked_user_id'] && $is_auth['auth_mod']) ? (' · '. profile_url($tor_info) .' · '. delta_time($tor_info['checked_time']) . $lang['TOR_BACK'] .'') : '',
+ 'TOR_STATUS_BY' => ($tor_info['checked_user_id'] && $is_auth['auth_mod']) ? (' · '. profile_url($tor_info) .' · '. delta_time($tor_info['checked_time']) . $lang['TOR_BACK'] .'') : '',
'TOR_STATUS_SELECT' => build_select('sel_status', array_flip($lang['TOR_STATUS_NAME']), TOR_APPROVED),
'TOR_STATUS_REPLY' => $bb_cfg['tor_comment'] && !IS_GUEST && in_array($tor_info['tor_status'], $bb_cfg['tor_reply']) && $userdata['user_id'] == $tor_info['poster_id'] && $t_data['topic_status'] != TOPIC_LOCKED,
//end torrent status mod
@@ -599,5 +599,5 @@ $template->assign_vars(array(
'SEED_EXIST' => ($seeders || defined('SEEDER_EXIST')),
'LEECH_EXIST' => ($leechers || defined('LEECHER_EXIST')),
'TOR_HELP_LINKS' => $bb_cfg['tor_help_links'],
- 'CALL_SEED' => ($bb_cfg['callseed'] && $tor_reged && !isset($bb_cfg['tor_no_tor_act'][$tor_info['tor_status']])),
+ 'CALL_SEED' => ($bb_cfg['callseed'] && $tor_reged && !isset($bb_cfg['tor_no_tor_act'][$tor_info['tor_status']]) && $seed_count < 3 && $tor_info['call_seed_time'] < (TIMENOW - 86400)),
));
\ No newline at end of file
diff --git a/upload/callseed.php b/upload/callseed.php
index 47bac5b95..70bdf749d 100644
--- a/upload/callseed.php
+++ b/upload/callseed.php
@@ -8,134 +8,87 @@ require(BB_ROOT . 'common.php');
// Init userdata
$user->session_start(array('req_login' => true));
-set_die_append_msg();
-
-require(INC_DIR .'bbcode.php');
-
-function topic_info($topic_id)
-{
- $sql = " SELECT tor.poster_id, tor.forum_id, tor.attach_id, t.topic_title, f.forum_name
- FROM ". BB_BT_TORRENTS ." tor , ". BB_TOPICS ." t, ". BB_FORUMS ." f
- WHERE tor.topic_id = $topic_id
- AND t.topic_id = tor.topic_id
- AND f.forum_id = tor.forum_id
- LIMIT 1";
- $row = DB()->fetch_row($sql);
-
- $t = array(
- "topic_title" => $row['topic_title'],
- "forum_title" => $row['forum_name'],
- "attach_id" => $row['attach_id'],
- "topic_poster" => $row['poster_id'],
- "forum_id" => $row['forum_id'],
- );
-
- return $t;
-}
-
-function call_seed($topic_id, $t_info, $to_user_id)
-{
- global $userdata, $lang, $msg_error;
-
- $sql = "UPDATE ". BB_BT_TORRENTS ." SET call_seed_time=". TIMENOW ." WHERE topic_id = $topic_id";
- if (!DB()->sql_query($sql)) {
- $msg_error = "TIME";
- return;
- }
-
- $subj = sprintf ($lang['CALLSEED_SUBJ'], $t_info['topic_title']);
- $text = sprintf ($lang['CALLSEED_TEXT'], $topic_id, $t_info['forum_title'], $t_info['topic_title'], $t_info['attach_id']);
- $subj = DB()->escape($subj);
- $text = DB()->escape($text);
-
- send_pm($to_user_id, $subj, $text, $userdata['user_id']);
-}
-
- $u_id = array();
- $topic_id = request_var('t', 0);
- $t_info = topic_info($topic_id);
- $forum_id = $t_info['forum_id'];
- $msg_error = "OK";
-
- $sql = "SELECT call_seed_time FROM ". BB_BT_TORRENTS ." WHERE topic_id = $topic_id LIMIT 1";
- if($row = DB()->fetch_row($sql))
- {
- $pr_time = $row['call_seed_time'];
- $pause = 86400; //1 day
- $cp = TIMENOW - $pr_time;
- $pcp = $pause - $cp;
- if($cp <= $pause)
- {
- $cur_pause_hour = floor($pcp/3600);
- $cur_pause_min = floor($pcp/60);
- $msg_error = "SPAM";
- }
- }
- else
- {
- message_die(GENERAL_ERROR, 'Topic does not callseed time', '', __LINE__, __FILE__);
- }
-
- // check have_seed
- if ($msg_error == "OK")
- {
- $sql = "SELECT seeders, leechers FROM ". BB_BT_TRACKER_SNAP ." WHERE topic_id = $topic_id LIMIT 1";
- $row = DB()->fetch_row($sql);
- if ($row['seeders'] <= 2)
- {
- $sql = "SELECT user_id FROM ". BB_BT_DLSTATUS ." WHERE topic_id = $topic_id AND user_id NOT IN ({$userdata['user_id']}, ". EXCLUDED_USERS_CSV .")";
-
- foreach(DB()->fetch_rowset($sql) as $row)
- {
- $u_id[] = $row['user_id'];
- }
- if (!in_array($t_info['topic_poster'], $u_id))
- {
- $u_id[] = $t_info['topic_poster'];
- }
- array_unique($u_id);
-
- foreach($u_id as $i=>$user_id)
- {
- if ($msg_error != "OK") break;
-
- call_seed($topic_id, $t_info, $user_id);
- }
- }
- else
- {
- $seeders = $row['seeders'];
- $leechers = $row['leechers'];
- $msg_error = "HAVE_SEED";
- }
- }
-
- $msg = '';
- meta_refresh(TOPIC_URL . $topic_id, 8);
-
- switch($msg_error) {
- case "OK":
- $msg .= $lang['CALLSEED_MSG_OK'];
- break;
- case "SPAM":
- $msg .= sprintf ($lang['CALLSEED_MSG_SPAM'], $cur_pause_hour, $cur_pause_min);
- break;
- case "MSG":
- $msg .= $lang['CALLSEED_MSG_MSG'];
- break;
- case "MSG_TEXT":
- $msg .= $lang['CALLSEED_MSG_MSG_TEXT'];
- break;
- case "POPUP":
- $msg .= $lang['CALLSEED_MSG_POPUP'];
- break;
- case "TIME":
- $msg .= $lang['CALLSEED_MSG_TIME'];
- break;
- case "HAVE_SEED":
- $msg .= sprintf ($lang['CALLSEED_HAVE_SEED'], $seeders, $leechers);
- break;
- }
+$topic_id = (int) request_var('t', 0);
+$t_data = topic_info($topic_id);
+$forum_id = $t_data['forum_id'];
set_die_append_msg($forum_id, $topic_id);
-bb_die($msg);
\ No newline at end of file
+
+if ($t_data['seeders'] > 2)
+{
+ bb_die(sprintf($lang['CALLSEED_HAVE_SEED'], $t_data['seeders']));
+}
+elseif ($t_data['call_seed_time'] > (TIMENOW - 86400))
+{
+ $time_left = delta_time($t_data['call_seed_time'] + 86400, TIMENOW, 'days');
+ bb_die(sprintf($lang['CALLSEED_MSG_SPAM'], $time_left));
+}
+
+$ban_user_id = array();
+
+$sql = DB()->fetch_rowset("SELECT ban_userid FROM ". BB_BANLIST ." WHERE ban_userid != 0");
+
+foreach ($sql as $row)
+{
+ $ban_user_id[] = ','. $row['ban_userid'];
+}
+$ban_user_id = join('', $ban_user_id);
+
+$user_list = DB()->fetch_rowset("
+ SELECT DISTINCT dl.user_id, u.user_opt, tr.user_id as active_dl
+ FROM ". BB_BT_DLSTATUS ." dl
+ LEFT JOIN ". BB_USERS ." u ON(u.user_id = dl.user_id)
+ LEFT JOIN ". BB_BT_TRACKER ." tr ON(tr.user_id = dl.user_id)
+ WHERE dl.topic_id = $topic_id
+ AND dl.user_status IN (". DL_STATUS_COMPLETE.", ". DL_STATUS_DOWN.")
+ AND dl.user_id NOT IN ({$userdata['user_id']}, ". EXCLUDED_USERS_CSV . $ban_user_id .")
+ AND u.user_active = 1
+ GROUP BY dl.user_id
+");
+
+$subject = sprintf($lang['CALLSEED_SUBJECT'], $t_data['topic_title']);
+$message = sprintf($lang['CALLSEED_TEXT'], make_url(TOPIC_URL . $topic_id), $t_data['topic_title'], make_url(DOWNLOAD_URL . $t_data['attach_id']));
+
+if ($user_list)
+{
+ foreach ($user_list as $row)
+ {
+ if (!empty($row['active_dl'])) continue;
+
+ if (bf($row['user_opt'], 'user_opt', 'user_callseed'))
+ {
+ send_pm($row['user_id'], $subject, $message, BOT_UID);
+ }
+ }
+}
+else
+{
+ send_pm($t_data['poster_id'], $subject, $message, BOT_UID);
+}
+
+DB()->query("UPDATE ". BB_BT_TORRENTS ." SET call_seed_time = ". TIMENOW ." WHERE topic_id = $topic_id LIMIT 1");
+
+meta_refresh(TOPIC_URL . $topic_id);
+bb_die($lang['CALLSEED_MSG_OK']);
+
+function topic_info ($topic_id)
+{
+ global $lang;
+
+ $sql = "
+ SELECT
+ tor.poster_id, tor.forum_id, tor.attach_id, tor.call_seed_time,
+ t.topic_title, sn.seeders
+ FROM ". BB_BT_TORRENTS ." tor
+ LEFT JOIN ". BB_TOPICS ." t USING(topic_id)
+ LEFT JOIN ". BB_BT_TRACKER_SNAP ." sn USING(topic_id)
+ WHERE tor.topic_id = $topic_id
+ ";
+
+ if (!$torrent = DB()->fetch_row($sql))
+ {
+ message_die(GENERAL_ERROR, $lang['TOPIC_POST_NOT_EXIST']);
+ }
+
+ return $torrent;
+}
diff --git a/upload/common.php b/upload/common.php
index d52cea0ad..ec44a2243 100644
--- a/upload/common.php
+++ b/upload/common.php
@@ -14,6 +14,8 @@ if (empty($_SERVER['SERVER_NAME'])) $_SERVER['SERVER_NAME'] = '';
if (!defined('BB_ROOT')) define('BB_ROOT', './');
if (!defined('IN_FORUM') && !defined('IN_TRACKER')) define('IN_FORUM', true);
+header('X-Frame-Options: SAMEORIGIN');
+
// Get initial config
require(BB_ROOT .'config.php');
diff --git a/upload/config.php b/upload/config.php
index ce9c8cc8a..140a58a4c 100644
--- a/upload/config.php
+++ b/upload/config.php
@@ -55,8 +55,8 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do
// Increase number of revision after update
$bb_cfg['tp_version'] = '2.6 (RC)';
-$bb_cfg['tp_release_date'] = '18-06-2014';
-$bb_cfg['tp_release_state'] = 'R588';
+$bb_cfg['tp_release_date'] = '19-06-2014';
+$bb_cfg['tp_release_state'] = 'R589';
// Database
$charset = 'utf8';
@@ -111,7 +111,6 @@ $bb_cfg['cache']['engines'] = array(
'bb_login_err' => array('filecache', array()),
'bb_poll_data' => array('filecache', array()),
);
-
// Datastore
// Available datastore types: memcache, sqlite, redis, eaccelerator, apc, xcache (default filecache)
$bb_cfg['datastore_type'] = 'filecache';
@@ -556,7 +555,7 @@ $bb_cfg['gen_forums_allowed_ext'] = array('zip', 'rar'); // для о
$bb_cfg['avatars'] = array(
'allowed_ext' => array('gif','jpg','jpeg','png'), // разрешенные форматы файлов
'bot_avatar' => 'gallery/bot.gif', // аватара бота
- 'max_size' => 512*1024, // размер аватары в байтах
+ 'max_size' => 50*1024, // размер аватары в байтах
'max_height' => 100, // высота аватара в px
'max_width' => 100, // ширина аватара в px
'no_avatar' => 'gallery/noavatar.png', // дефолтная аватара
diff --git a/upload/files/.htaccess b/upload/files/.htaccess
index 34ed2a11e..599159cb0 100644
--- a/upload/files/.htaccess
+++ b/upload/files/.htaccess
@@ -1,3 +1,5 @@
php_flag engine off
RemoveHandler .php .php5 .php4 .php3 .phtml .pl .asp
-AddType text/plain .php .php .htm .html .phtml .pl .asp
\ No newline at end of file
+AddType text/plain .php .php .htm .html .phtml .pl .asp
+Options -Indexes
+
diff --git a/upload/groupcp.php b/upload/groupcp.php
index a0b8447cc..fafc41af6 100644
--- a/upload/groupcp.php
+++ b/upload/groupcp.php
@@ -21,7 +21,7 @@ function generate_user_info(&$row, $date_format, $group_mod, &$from, &$posts, &$
$posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0;
$pm = ($bb_cfg['text_buttons']) ? ''. $lang['SEND_PM_TXTB'] .'' : '
';
- if (bf($row['user_opt'], 'user_opt', 'viewemail') || $group_mod)
+ if (bf($row['user_opt'], 'user_opt', 'user_viewemail') || $group_mod)
{
$email_uri = ($bb_cfg['board_email_form']) ? ("profile.php?mode=email&". POST_USERS_URL ."=".$row['user_id']) : 'mailto:'. $row['user_email'];
$email = ''. $row['user_email'] .'';
diff --git a/upload/images/index.html b/upload/images/index.html
new file mode 100644
index 000000000..e69de29bb
diff --git a/upload/includes/cron/jobs/cache_gc.php b/upload/includes/cron/jobs/cache_gc.php
index bab507271..3aee9a73b 100644
--- a/upload/includes/cron/jobs/cache_gc.php
+++ b/upload/includes/cron/jobs/cache_gc.php
@@ -2,16 +2,9 @@
if (!defined('BB_ROOT')) die(basename(__FILE__));
-$gc_cache = array(
- 'bb_cache',
- 'tr_cache',
- 'session_cache',
- 'bb_cap_sid',
- 'bb_login_err',
- 'bb_poll_data',
-);
+global $cron_runtime_log
-foreach ($gc_cache as $cache_name)
+foreach ($bb_cfg['cache']['engines'] as $cache_name => $cache_val)
{
if (method_exists(CACHE($cache_name), 'gc'))
{
diff --git a/upload/includes/cron/jobs/clean_dlstat.php b/upload/includes/cron/jobs/clean_dlstat.php
index 994da7c3b..5c19c66dc 100644
--- a/upload/includes/cron/jobs/clean_dlstat.php
+++ b/upload/includes/cron/jobs/clean_dlstat.php
@@ -2,45 +2,6 @@
if (!defined('BB_ROOT')) die(basename(__FILE__));
-define('BUF_DLSTATUS_TABLE', 'tmp_buf_dlstatus');
-
-// Move new dl-status records to main table
-DB()->query("
- CREATE TEMPORARY TABLE ". BUF_DLSTATUS_TABLE ." (
- user_id mediumint(9) NOT NULL default '0',
- topic_id mediumint(8) unsigned NOT NULL default '0',
- user_status tinyint(1) NOT NULL default '0',
- PRIMARY KEY (user_id, topic_id)
- ) ENGINE = MyISAM
-");
-
-DB()->query("
- INSERT INTO ". BUF_DLSTATUS_TABLE ."
- (user_id, topic_id, user_status)
- SELECT
- user_id, topic_id, user_status
- FROM
- ". BB_BT_DLSTATUS ."
- WHERE
- last_modified_dlstatus < DATE_SUB(NOW(), INTERVAL 1 DAY)
-");
-
-DB()->query("
- REPLACE INTO ". BB_BT_DLSTATUS ."
- (user_id, topic_id, user_status)
- SELECT
- user_id, topic_id, user_status
- FROM ". BUF_DLSTATUS_TABLE ."
-");
-
-DB()->query("
- DELETE dl
- FROM ". BUF_DLSTATUS_TABLE ." buf
- INNER JOIN ". BB_BT_DLSTATUS ." dl USING(user_id, topic_id)
-");
-
-DB()->query("DROP TEMPORARY TABLE ". BUF_DLSTATUS_TABLE);
-
// Delete staled dl-status records
$keeping_dlstat = array(
DL_STATUS_WILL => (int) $bb_cfg['dl_will_days_keep'],
diff --git a/upload/includes/datastore/build_stats.php b/upload/includes/datastore/build_stats.php
index c85d758c7..7fbea6209 100644
--- a/upload/includes/datastore/build_stats.php
+++ b/upload/includes/datastore/build_stats.php
@@ -38,52 +38,53 @@ if ($bb_cfg['tor_stats'])
// gender stat
if ($bb_cfg['gender'])
{
- $sql = DB()->fetch_rowset("SELECT user_gender FROM ". BB_USERS ." WHERE user_id NOT IN(". EXCLUDED_USERS_CSV .")");
- $data['male'] = $data['female'] = $data['unselect'] = 0;
-
- foreach ($sql as $row)
- {
- if($row['user_gender'] == MALE) $data['male']++;
- if($row['user_gender'] == FEMALE) $data['female']++;
- if(!$row['user_gender']) $data['unselect']++;
- }
+ $male = DB()->fetch_row("SELECT COUNT(user_id) AS male FROM ". BB_USERS ." WHERE user_gender = ". MALE ." AND user_id NOT IN(". EXCLUDED_USERS_CSV .")");
+ $female = DB()->fetch_row("SELECT COUNT(user_id) AS female FROM ". BB_USERS ." WHERE user_gender = ". FEMALE ." AND user_id NOT IN(". EXCLUDED_USERS_CSV .")");
+ $unselect = DB()->fetch_row("SELECT COUNT(user_id) AS unselect FROM ". BB_USERS ." WHERE user_gender = 0 AND user_id NOT IN(". EXCLUDED_USERS_CSV .")");
+
+ $data['male'] = $male['male'];
+ $data['female'] = $female['female'];
+ $data['unselect'] = $unselect['unselect'];
}
// birthday stat
if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled'])
{
- $sql = DB()->fetch_rowset("SELECT user_id, username, user_birthday, user_rank FROM ". BB_USERS ." WHERE user_id NOT IN(". EXCLUDED_USERS_CSV .") AND user_birthday != '0000-00-00' AND user_active = 1 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');
+ $sql = DB()->fetch_rowset("SELECT user_id, username, user_rank , user_birthday
+ FROM ". BB_USERS ."
+ WHERE user_id NOT IN(". EXCLUDED_USERS_CSV .")
+ AND user_birthday IS not NULL
+ AND user_active = 1
+ ORDER BY user_level DESC, username
+ ");
+
+ $date_today = bb_date(TIMENOW, 'md', 'false');
+ $date_forward = bb_date(TIMENOW + ($bb_cfg['birthday_check_day']*86400), 'md', 'false');
$birthday_today_list = $birthday_week_list = array();
foreach ($sql as $row)
{
$user_birthday = date('md', strtotime($row['user_birthday']));
- $user_birthday2 = $this_year . $user_birthday;
- if ($user_birthday2 < $date_today) $user_birthday2 += 10000;
-
- if ($user_birthday2 > $date_today && $user_birthday2 <= $date_forward)
+ if ($user_birthday > $date_today && $user_birthday <= $date_forward)
{
// user are having birthday within the next days
$birthday_week_list[] = array(
- 'user_id' => $row['user_id'],
- 'username' => $row['username'],
- 'user_rank' => $row['user_rank'],
- 'age' => $row['user_birthday'],
+ 'user_id' => $row['user_id'],
+ 'username' => $row['username'],
+ 'user_rank' => $row['user_rank'],
+ 'user_birthday' => $row['user_birthday'],
);
}
- elseif ($user_birthday2 == $date_today)
+ elseif ($user_birthday == $date_today)
{
//user have birthday today
$birthday_today_list[] = array(
- 'user_id' => $row['user_id'],
- 'username' => $row['username'],
- 'user_rank' => $row['user_rank'],
- 'age' => $row['user_birthday'],
+ 'user_id' => $row['user_id'],
+ 'username' => $row['username'],
+ 'user_rank' => $row['user_rank'],
+ 'user_birthday' => $row['user_birthday'],
);
}
}
diff --git a/upload/includes/functions.php b/upload/includes/functions.php
index 1e34d5fc0..24af39a16 100644
--- a/upload/includes/functions.php
+++ b/upload/includes/functions.php
@@ -127,7 +127,7 @@ class ads_common
global $bb_cfg;
$this->ad_blocks =& $bb_cfg['ad_blocks'];
- $this->active_ads = !empty($bb_cfg['active_ads']) ? unserialize($bb_cfg['active_ads']) : array();
+ $this->active_ads = !empty($bb_cfg['active_ads']) ? @unserialize($bb_cfg['active_ads']) : array();
}
/**
@@ -258,21 +258,23 @@ $bf['forum_perm'] = array(
);
$bf['user_opt'] = array(
- 'viewemail' => 0, // Показывать e-mail
- 'allow_sig' => 1, // Запрет на подпись
- 'allow_avatar' => 2, // Запрет на аватар
- 'allow_pm' => 3, // Запрет на отправку ЛС
- 'allow_viewonline' => 4, // Скрывать пребывание пользователя
- 'notify' => 5, // Сообщать об ответах в отслеживаемых темах
- 'notify_pm' => 6, // Сообщать о новых ЛС
- 'allow_passkey' => 7, // Запрет на добавление passkey, он же запрет на скачивание торрентов
- 'hide_porn_forums' => 8, // Скрывать pron форумы
- 'allow_gallery' => 9, // Неиспользуемое (запрет использования галереи)
- 'hide_ads' => 10, // Запрет на показ рекламы
- 'allow_topic' => 11, // Запрет на создание новых тем
- 'allow_post' => 12, // Запрет на отправку сообщений
- 'allow_post_edit' => 13, // Запрет на редактирование сообщений
- 'allow_dls' => 14, // Запрет на список текущих закачек в профиле
+# 'dis_opt_name' => ЗАПРЕТЫ используемые администраторами для пользователей
+# 'user_opt_name' => НАСТРОЙКИ используемые пользователями
+ 'user_viewemail' => 0, // Показывать e-mail
+ 'dis_sig' => 1, // Запрет на подпись
+ 'dis_avatar' => 2, // Запрет на аватар
+ 'dis_pm' => 3, // Запрет на отправку ЛС
+ 'user_viewonline' => 4, // Скрывать пребывание пользователя
+ 'user_notify' => 5, // Сообщать об ответах в отслеживаемых темах
+ 'user_notify_pm' => 6, // Сообщать о новых ЛС
+ 'dis_passkey' => 7, // Запрет на добавление passkey, он же запрет на скачивание торрентов
+ 'user_porn_forums' => 8, // Скрывать pron форумы
+ 'user_callseed' => 9, // Позвать скачавших
+ 'user_hide_ads' => 10, // Запрет на показ рекламы
+ 'dis_topic' => 11, // Запрет на создание новых тем
+ 'dis_post' => 12, // Запрет на отправку сообщений
+ 'dis_post_edit' => 13, // Запрет на редактирование сообщений
+ 'user_dls' => 14, // Скрывать список текущих закачек в профиле
);
function bit2dec ($bit_num)
@@ -1618,90 +1620,13 @@ function bb_date ($gmepoch, $format = false, $tz = null)
return ($bb_cfg['translate_dates']) ? strtr(strtoupper($date), $lang['DATETIME']) : $date;
}
-// Birthday
-// Add function mkrealdate for Birthday MOD
-// the originate php "mktime()", does not work proberly on all OS, especially when going back in time
-// before year 1970 (year 0), this function "mkrealtime()", has a mutch larger valid date range,
-// from 1901 - 2099. it returns a "like" UNIX timestamp divided by 86400, so
-// calculation from the originate php date and mktime is easy.
-// mkrealdate, returns the number of day (with sign) from 1.1.1970.
-function mkrealdate ($day, $month, $birth_year)
-{
- // define epoch
- $epoch = 0;
- // range check months
- if ($month < 1 || $month > 12) return "error";
- // range check days
- switch ($month)
- {
- case 1: if ($day > 31) return "error"; break;
- case 2: if ($day > 29) return "error";
- $epoch = $epoch+31; break;
- case 3: if ($day > 31) return "error";
- $epoch = $epoch+59; break;
- case 4: if ($day > 30) return "error" ;
- $epoch = $epoch+90; break;
- case 5: if ($day > 31) return "error";
- $epoch = $epoch+120; break;
- case 6: if ($day > 30) return "error";
- $epoch = $epoch+151; break;
- case 7: if ($day > 31) return "error";
- $epoch = $epoch+181; break;
- case 8: if ($day > 31) return "error";
- $epoch = $epoch+212; break;
- case 9: if ($day > 30) return "error";
- $epoch = $epoch+243; break;
- case 10: if ($day > 31) return "error";
- $epoch = $epoch+273; break;
- case 11: if ($day > 30) return "error";
- $epoch = $epoch+304; break;
- case 12: if ($day > 31) return "error";
- $epoch = $epoch+334; break;
- }
- $epoch = $epoch+$day;
- $epoch_Y = sqrt(($birth_year-1970)*($birth_year-1970));
- $leapyear = round((($epoch_Y+2) / 4)-.5);
- if (($epoch_Y+2)%4 == 0)
- {// curent year is leapyear
- $leapyear--;
- if ($birth_year > 1970 && $month >= 3) $epoch = $epoch+1;
- if ($birth_year < 1970 && $month < 3) $epoch = $epoch-1;
- }
- else if ($month == 2 && $day > 28) return "error";//only 28 days in feb.
- //year
- if ($birth_year > 1970)
- {
- $epoch = $epoch + $epoch_Y*365-1 + $leapyear;
- }
- else
- {
- $epoch = $epoch - $epoch_Y*365-1 - $leapyear;
- }
- return $epoch;
-}
-
-// Add function realdate for Birthday MOD
-// the originate php "date()", does not work proberly on all OS, especially when going back in time
-// before year 1970 (year 0), this function "realdate()", has a mutch larger valid date range,
-// from 1901 - 2099. it returns a "like" UNIX date format (only date, related letters may be used, due to the fact that
-// the given date value should already be divided by 86400 - leaving no time information left)
-// a input like a UNIX timestamp divided by 86400 is expected, so
-// calculation from the originate php date and mktime is easy.
-// e.g. realdate ("m d Y", 3) returns the string "1 3 1970"
-
-// UNIX users should replace this function with the below code, since this should be faster
-//
-
-function realdate ($date, $format = "Ymd")
+function birthday_age ($date)
{
+ global $bb_cfg;
if (!$date) return;
- return bb_date($date*86400 + 1, $format, 0);
-}
-function birthday_age ($date, $list = 0)
-{
- if (!$date) return;
- return delta_time(mktime(11, 0, 0, date('m', strtotime($date)), date('d', strtotime($date)), (date('Y', strtotime($date)) - $list)));
+ $tz = TIMENOW + (3600 * $bb_cfg['board_timezone']);
+ return delta_time(strtotime($date, $tz));
}
//
@@ -2881,18 +2806,11 @@ function send_pm ($user_id, $subject, $message, $poster_id = BOT_UID)
$poster_ip = USER_IP;
}
- DB()->sql_query("INSERT INTO ". BB_PRIVMSGS ." (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip)
- VALUES (". PRIVMSGS_NEW_MAIL .", '$subject', {$poster_id}, $user_id, ". TIMENOW .", '$poster_ip')");
+ DB()->query("INSERT INTO ". BB_PRIVMSGS ." (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip) VALUES (". PRIVMSGS_NEW_MAIL .", '$subject', {$poster_id}, $user_id, ". TIMENOW .", '$poster_ip')");
$pm_id = DB()->sql_nextid();
- DB()->sql_query("INSERT INTO " . BB_PRIVMSGS_TEXT . " (privmsgs_text_id, privmsgs_text)
- VALUES ($pm_id, '$message')");
-
- DB()->sql_query("UPDATE ". BB_USERS ." SET
- user_new_privmsg = user_new_privmsg + 1,
- user_last_privmsg = ". TIMENOW .",
- user_newest_pm_id = $pm_id
- WHERE user_id = $user_id");
+ DB()->query("INSERT INTO " . BB_PRIVMSGS_TEXT . " (privmsgs_text_id, privmsgs_text) VALUES ($pm_id, '$message')");
+ DB()->query("UPDATE ". BB_USERS ." SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = ". TIMENOW .", user_newest_pm_id = $pm_id WHERE user_id = $user_id");
}
function profile_url ($data)
@@ -2930,7 +2848,7 @@ function profile_url ($data)
return $profile;
}
-function get_avatar ($user_id, $ext_id, $allow_avatar = true, $size = true)
+function get_avatar ($user_id, $ext_id, $allow_avatar = true, $size = true, $height = '', $width = '')
{
global $bb_cfg;
@@ -2938,17 +2856,23 @@ function get_avatar ($user_id, $ext_id, $allow_avatar = true, $size = true)
{
// TODO
}
+
+ $height = ($height != '') ? 'height="'. $height .'"' : '';
+ $width = ($width != '') ? 'width="'. $width .'"' : '';
- $user_avatar = '
';
+ $user_avatar = '
';
if ($user_id == BOT_UID && $bb_cfg['avatars']['bot_avatar'])
{
- $user_avatar = '
';
+ $user_avatar = '
';
}
elseif ($allow_avatar && $ext_id)
{
- $user_avatar = '
';
+ if (file_exists($bb_cfg['avatars']['upload_path'] . get_avatar_path($user_id, $ext_id)))
+ {
+ $user_avatar = '
';
+ }
}
return $user_avatar;
-}
\ No newline at end of file
+}
diff --git a/upload/includes/functions_torrent.php b/upload/includes/functions_torrent.php
index b26faf6d6..93171fdd8 100644
--- a/upload/includes/functions_torrent.php
+++ b/upload/includes/functions_torrent.php
@@ -396,7 +396,7 @@ function send_torrent_with_passkey ($filename)
message_die(GENERAL_ERROR, $lang['PASSKEY_ERR_TOR_NOT_REG']);
}
- if (bf($userdata['user_opt'], 'user_opt', 'allow_passkey') && !IS_GUEST)
+ if (bf($userdata['user_opt'], 'user_opt', 'dis_passkey') && !IS_GUEST)
{
message_die(GENERAL_ERROR, 'Could not add passkey');
}
@@ -511,7 +511,7 @@ function generate_passkey ($user_id, $force_generate = false)
}
if ($row = DB()->sql_fetchrow($result))
{
- if (bf($row['user_opt'], 'user_opt', 'allow_passkey'))
+ if (bf($row['user_opt'], 'user_opt', 'dis_passkey'))
{
message_die(GENERAL_MESSAGE, $lang['NOT_AUTHORISED']);
}
diff --git a/upload/includes/init_bb.php b/upload/includes/init_bb.php
index 349a0a0ae..96d649e86 100644
--- a/upload/includes/init_bb.php
+++ b/upload/includes/init_bb.php
@@ -1,6 +1,7 @@
assign_vars(array(
'SHOW_ADS' => (!$logged_in || isset($bb_cfg['show_ads_users'][$user->id]) || (!IS_AM && $user->show_ads)),
'USER_HIDE_CAT' => (BB_SCRIPT == 'index'),
- 'USER_RUS' => ($userdata['user_lang'] != 'english') ? true : false,
+ 'USER_LANG' => $userdata['user_lang'],
'INCLUDE_BBCODE_JS' => !empty($page_cfg['include_bbcode_js']),
'USER_OPTIONS_JS' => (IS_GUEST) ? '{}' : bb_json_encode($user->opt_js),
@@ -206,8 +206,8 @@ $template->assign_vars(array(
'SESSION_USER_ID' => $userdata['user_id'],
'POINTS' => $userdata['user_points'],
'THIS_USER' => profile_url($userdata),
- 'THIS_AVATAR' => get_avatar($userdata['user_id'], $userdata['avatar_ext_id'], !bf($userdata['user_opt'], 'user_opt', 'allow_avatar')),
- 'AVATAR_DISALLOWED' => bf($userdata['user_opt'], 'user_opt', 'allow_avatar'),
+ 'THIS_AVATAR' => get_avatar($userdata['user_id'], $userdata['avatar_ext_id'], !bf($userdata['user_opt'], 'user_opt', 'dis_avatar')),
+ 'AVATAR_DISALLOWED' => bf($userdata['user_opt'], 'user_opt', 'dis_avatar'),
'SHOW_LOGIN_LINK' => !defined('IN_LOGIN'),
'AUTOLOGIN_DISABLED' => !$bb_cfg['allow_autologin'],
'S_LOGIN_ACTION' => LOGIN_URL,
diff --git a/upload/includes/sessions.php b/upload/includes/sessions.php
index 0b2df8fb1..105985b3a 100644
--- a/upload/includes/sessions.php
+++ b/upload/includes/sessions.php
@@ -755,7 +755,7 @@ class user_common
$excluded[] = $not_auth;
}
- if (bf($this->opt, 'user_opt', 'hide_porn_forums'))
+ if (bf($this->opt, 'user_opt', 'user_porn_forums'))
{
global $datastore;
@@ -789,7 +789,7 @@ class user_common
{
global $datastore, $bb_cfg;
- if ($bb_cfg['show_ads'] && !bf($this->opt, 'user_opt', 'hide_ads') && !defined('IN_ADMIN') && !defined('IN_AJAX'))
+ if ($bb_cfg['show_ads'] && !bf($this->opt, 'user_opt', 'user_hide_ads') && !defined('IN_ADMIN') && !defined('IN_AJAX'))
{
$datastore->enqueue('ads');
$this->show_ads = true;
diff --git a/upload/includes/template.php b/upload/includes/template.php
index d908f1df4..de4fcbd50 100644
--- a/upload/includes/template.php
+++ b/upload/includes/template.php
@@ -117,7 +117,7 @@ class Template
*/
function Template($root = '.')
{
- global $lang;
+ global $bb_cfg, $lang;
// setting pointer "vars"
$this->vars = &$this->_tpldata['.'][0];
@@ -126,6 +126,7 @@ class Template
$this->root = $root;
$this->tpl = basename($root);
$this->lang =& $lang;
+ $this->use_cache = $bb_cfg['xs_use_cache'];
}
/**
diff --git a/upload/includes/ucp/usercp_register.php b/upload/includes/ucp/usercp_register.php
index dcf44b795..8f8b47ea7 100644
--- a/upload/includes/ucp/usercp_register.php
+++ b/upload/includes/ucp/usercp_register.php
@@ -39,10 +39,8 @@ switch ($mode)
* Регистрация
*/
case 'register':
- if (!$can_register)
- {
- redirect('index.php');
- }
+ if (!$can_register) redirect('index.php');
+
if (!IS_ADMIN)
{
// Ограничение по ip
@@ -75,6 +73,7 @@ switch ($mode)
'user_email' => true,
'user_timezone' => true,
'user_lang' => true,
+ 'user_opt' => true,
);
$pr_data = array(
@@ -93,11 +92,8 @@ switch ($mode)
* Редактирование профиля
*/
case 'editprofile':
- if (IS_GUEST)
- {
- login_redirect();
- }
-
+ if (IS_GUEST) login_redirect();
+
// field => can_edit
$profile_fields = array(
'user_active' => IS_ADMIN,
@@ -137,7 +133,6 @@ switch ($mode)
user_id,
user_rank,
user_level,
- user_email,
$profile_fields_sql
FROM ". BB_USERS ."
WHERE user_id = $pr_user_id
@@ -171,465 +166,440 @@ foreach ($profile_fields as $field => $can_edit)
{
switch ($field)
{
- /**
- * Активация (edit, reg)
- */
- case 'user_active':
- $active = isset($_POST['user_active']) ? (int) $_POST['user_active'] : $pr_data['user_active'];
- if ($submit && $adm_edit)
- {
- $pr_data['user_active'] = $active;
- $db_data['user_active'] = $active;
- }
- break;
-
- /**
- * Имя (edit, reg)
- */
- case 'username':
- $username = !empty($_POST['username']) ? clean_username($_POST['username']) : $pr_data['username'];
-
- if ($submit)
- {
- $err = validate_username($username);
- if (!$errors AND $err && $mode == 'register')
+ /**
+ * Активация (edit, reg)
+ */
+ case 'user_active':
+ $active = isset($_POST['user_active']) ? (int) $_POST['user_active'] : $pr_data['user_active'];
+ if ($submit && $adm_edit)
{
- $errors[] = $err;
+ $pr_data['user_active'] = $active;
+ $db_data['user_active'] = $active;
}
- if ($can_edit && $username != $pr_data['username'] || $mode == 'register')
- {
- $pr_data['username'] = $username;
- $db_data['username'] = $username;
- }
- }
- $tp_data['CAN_EDIT_USERNAME'] = $can_edit;
- $tp_data['USERNAME'] = $pr_data['username'];
- break;
+ break;
- /**
- * Пароль (edit, reg)
- */
- case 'user_password':
- if ($submit)
- {
- $cur_pass = (string) @$_POST['cur_pass'];
- $new_pass = (string) @$_POST['new_pass'];
- $cfm_pass = (string) @$_POST['cfm_pass'];
+ /**
+ * Имя (edit, reg)
+ */
+ case 'username':
+ $username = !empty($_POST['username']) ? clean_username($_POST['username']) : $pr_data['username'];
- // пароль для гостя и при смене пароля юзером
- if (!empty($new_pass))
+ if ($submit)
{
- if (mb_strlen($new_pass, 'UTF-8') > 20)
- {
- $errors[] = sprintf($lang['CHOOSE_PASS_ERR_MAX'], 20);
- }
- elseif (mb_strlen($new_pass, 'UTF-8') < 4)
- {
- $errors[] = sprintf($lang['CHOOSE_PASS_ERR_MIN'], 4);
- }
- elseif ($new_pass != $cfm_pass)
- {
- $errors[] = $lang['CHOOSE_PASS_ERR'];
- }
- $db_data['user_password'] = md5(md5($new_pass));
- }
-
- if ($mode == 'register')
- {
- if (empty($new_pass))
- {
- $errors[] = $lang['CHOOSE_PASS'];
- }
- }
- else
- {
- if (!empty($cur_pass))
- {
- $cur_pass_valid = ($pr_data['user_password'] === md5(md5($cur_pass)));
- }
- if (!empty($new_pass) && !$cur_pass_valid)
- {
- $errors[] = $lang['CHOOSE_PASS_FAILED'];
- }
- }
- }
- break;
-
- /**
- * E-mail (edit, reg)
- */
- case 'user_email':
- $email = !empty($_POST['user_email']) ? (string) $_POST['user_email'] : $pr_data['user_email'];
- if ($submit)
- {
- if ($mode == 'register')
- {
- if (empty($email))
- {
- $errors[] = $lang['CHOOSE_E_MAIL'];
- }
- if (!$errors AND $err = validate_email($email))
+ $err = validate_username($username);
+ if (!$errors AND $err && $mode == 'register')
{
$errors[] = $err;
}
- $db_data['user_email'] = $email;
- }
- else if ($email != $pr_data['user_email']) // если смена мейла юзером
- {
- if (!$cur_pass_valid)
+ if ($can_edit && $username != $pr_data['username'] || $mode == 'register')
{
- $errors[] = $lang['CONFIRM_PASSWORD_EXPLAIN'];
+ $pr_data['username'] = $username;
+ $db_data['username'] = $username;
}
- if (!$errors AND $err = validate_email($email))
+ }
+ $tp_data['CAN_EDIT_USERNAME'] = $can_edit;
+ $tp_data['USERNAME'] = $pr_data['username'];
+ break;
+
+ /**
+ * Пароль (edit, reg)
+ */
+ case 'user_password':
+ if ($submit)
+ {
+ $cur_pass = (string) @$_POST['cur_pass'];
+ $new_pass = (string) @$_POST['new_pass'];
+ $cfm_pass = (string) @$_POST['cfm_pass'];
+
+ // пароль для гостя и при смене пароля юзером
+ if (!empty($new_pass))
{
- $errors[] = $err;
+ if (mb_strlen($new_pass, 'UTF-8') > 20)
+ {
+ $errors[] = sprintf($lang['CHOOSE_PASS_ERR_MAX'], 20);
+ }
+ elseif (mb_strlen($new_pass, 'UTF-8') < 4)
+ {
+ $errors[] = sprintf($lang['CHOOSE_PASS_ERR_MIN'], 4);
+ }
+ elseif ($new_pass != $cfm_pass)
+ {
+ $errors[] = $lang['CHOOSE_PASS_ERR'];
+ }
+ $db_data['user_password'] = md5(md5($new_pass));
}
- if ($bb_cfg['reg_email_activation'])
+
+ if ($mode == 'register')
{
- $pr_data['user_active'] = 0;
- $db_data['user_active'] = 0;
- }
- $db_data['user_email'] = $email;
- }
- }
- $tp_data['USER_EMAIL'] = htmlCHR($email);
- break;
-
- /**
- * Язык (edit, reg)
- */
- case 'user_lang':
- $user_lang = isset($_POST['user_lang']) ? (string) $_POST['user_lang'] : $pr_data['user_lang'];
- if ($submit && ($user_lang != $pr_data['user_lang'] || $mode == 'register'))
- {
- $pr_data['user_lang'] = $user_lang;
- $db_data['user_lang'] = $user_lang;
- }
- break;
-
- /**
- * Часовой пояс (edit, reg)
- */
- case 'user_timezone':
- $user_timezone = isset($_POST['user_timezone']) ? (int) $_POST['user_timezone'] : $pr_data['user_timezone'];
- if ($submit && ($user_timezone != $pr_data['user_timezone'] || $mode == 'register'))
- {
- if (isset($lang['TZ'][$user_timezone]))
- {
- $pr_data['user_timezone'] = $user_timezone;
- $db_data['user_timezone'] = $user_timezone;
- }
- }
- break;
-
- /**
- * Пол (edit, reg)
- */
- case 'user_gender':
- $gender = isset($_POST['user_gender']) ? (int) $_POST['user_gender'] : $pr_data['user_gender'];
- if ($submit && $gender != $pr_data['user_gender'])
- {
- $pr_data['user_gender'] = $gender;
- $db_data['user_gender'] = $gender;
- }
- $tp_data['USER_GENDER'] = build_select('user_gender', array_flip($lang['GENDER_SELECT']), $pr_data['user_gender']);
- break;
-
- /**
- * Возраст (edit)
- */
- case 'user_birthday':
- $user_birthday = ($pr_data['user_birthday'] != '0000-00-00') ? strtotime($pr_data['user_birthday']) : false;
-
- $b_day = (isset($_POST['b_day'])) ? (int) $_POST['b_day'] : (($user_birthday) ? date('j', $user_birthday) : 0);
- $b_md = (isset($_POST['b_md'])) ? (int) $_POST['b_md'] : (($user_birthday) ? date('n', $user_birthday) : 0);
- $b_year = (isset($_POST['b_year'])) ? (int) $_POST['b_year'] : (($user_birthday) ? date('Y', $user_birthday) : 0);
-
- if ($b_day || $b_md || $b_year)
- {
- if (!checkdate($b_md, $b_day, $b_year))
- {
- $errors[] = $lang['WRONG_BIRTHDAY_FORMAT'];
- $birthday = '';
- $next_birthday_greeting = 0;
- }
- else
- {
- $birthday = "$b_year-$b_md-$b_day";
- $next_birthday_greeting = (date('md') < $b_md . (($b_day <= 9) ? '0' : '') . $b_day) ? date('Y') : date('Y') + 1;
- }
- }
- else
- {
- $birthday = '';
- $next_birthday_greeting = 0;
- }
-
- if ($submit && $birthday != $pr_data['user_birthday'])
- {
- $pr_data['user_birthday'] = $birthday;
- $db_data['user_birthday'] = $birthday;
- $db_data['user_next_birthday_greeting'] = $next_birthday_greeting;
- }
- break;
-
- /**
- * opt (edit)
- */
- case 'user_opt':
- $user_opt = $pr_data['user_opt'];
-
- $update_user_opt = array(
- 'viewemail' => true,
- 'allow_viewonline' => true,
- 'notify' => true,
- 'notify_pm' => true,
- 'hide_porn_forums' => true,
- 'allow_dls' => true,
- );
- foreach ($update_user_opt as $opt => $can_change_opt)
- {
- if ($submit && $can_change_opt && isset($_POST[$opt]))
- {
- setbit($user_opt, $bf['user_opt'][$opt], !empty($_POST[$opt]));
- }
- $tp_data[strtoupper($opt)] = bf($user_opt, 'user_opt', $opt);
- }
- if ($submit && $user_opt != $pr_data['user_opt'])
- {
- $pr_data['user_opt'] = $user_opt;
- $db_data['user_opt'] = (int) $user_opt;
- }
- break;
-
- /**
- * Avatar (edit)
- */
- case 'avatar_ext_id':
- if ($submit && !bf($pr_data['user_opt'], 'user_opt', 'allow_avatar'))
- {
- if (isset($_POST['delete_avatar']))
- {
- delete_avatar($pr_data['user_id'], $pr_data['avatar_ext_id']);
- $pr_data['avatar_ext_id'] = 0;
- $db_data['avatar_ext_id'] = 0;
- }
- else if (!empty($_FILES['avatar']['name']) && $bb_cfg['avatars']['up_allowed'])
- {
- require(INC_DIR .'functions_upload.php');
- $upload = new upload_common();
-
- if ($upload->init($bb_cfg['avatars'], $_FILES['avatar']) AND $upload->store('avatar', $pr_data))
- {
- $pr_data['avatar_ext_id'] = $upload->file_ext_id;
- $db_data['avatar_ext_id'] = (int) $upload->file_ext_id;
+ if (empty($new_pass))
+ {
+ $errors[] = $lang['CHOOSE_PASS'];
+ }
}
else
{
- $errors = array_merge($errors, $upload->errors);
+ if (!empty($cur_pass))
+ {
+ $cur_pass_valid = ($pr_data['user_password'] === md5(md5($cur_pass)));
+ }
+ if (!empty($new_pass) && !$cur_pass_valid)
+ {
+ $errors[] = $lang['CHOOSE_PASS_FAILED'];
+ }
}
}
- }
- break;
+ break;
- /**
- * ICQ (edit)
- */
- case 'user_icq':
- $icq = isset($_POST['user_icq']) ? (string) $_POST['user_icq'] : $pr_data['user_icq'];
- if ($submit && $icq != $pr_data['user_icq'])
- {
- if ($icq == '' || preg_match('#^\d{6,15}$#', $icq))
+ /**
+ * E-mail (edit, reg)
+ */
+ case 'user_email':
+ $email = !empty($_POST['user_email']) ? (string) $_POST['user_email'] : $pr_data['user_email'];
+ if ($submit)
{
- $pr_data['user_icq'] = $icq;
- $db_data['user_icq'] = (string) $icq;
- }
- else
- {
- $pr_data['user_icq'] = '';
- $errors[] = htmlCHR($lang['ICQ_ERROR']);
- }
- }
- $tp_data['USER_ICQ'] = $pr_data['user_icq'];
- break;
-
- /**
- * Сайт (edit)
- */
- case 'user_website':
- $website = isset($_POST['user_website']) ? (string) $_POST['user_website'] : $pr_data['user_website'];
- $website = htmlCHR($website);
- if ($submit && $website != $pr_data['user_website'])
- {
- if ($website == '' || preg_match('#^https?://[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]+$#iu', $website))
- {
- $pr_data['user_website'] = $website;
- $db_data['user_website'] = (string) $website;
- }
- else
- {
- $pr_data['user_website'] = '';
- $errors[] = htmlCHR($lang['WEBSITE_ERROR']);
- }
- }
- $tp_data['USER_WEBSITE'] = $pr_data['user_website'];
- break;
-
- /**
- * Откуда (edit)
- */
- case 'user_from':
- $from = isset($_POST['user_from']) ? (string) $_POST['user_from'] : $pr_data['user_from'];
- $from = htmlCHR($from);
- if ($submit && $from != $pr_data['user_from'])
- {
- $pr_data['user_from'] = $from;
- $db_data['user_from'] = (string) $from;
- }
- $tp_data['USER_FROM'] = $pr_data['user_from'];
- break;
-
- /**
- * Подпись (edit)
- */
- case 'user_sig':
- $sig = isset($_POST['user_sig']) ? (string) $_POST['user_sig'] : $pr_data['user_sig'];
- if ($submit && $sig != $pr_data['user_sig'])
- {
- $sig = prepare_message($sig);
-
- if (mb_strlen($sig, 'UTF-8') > $bb_cfg['max_sig_chars'])
- {
- $errors[] = $lang['SIGNATURE_TOO_LONG'];
- }
- else if (preg_match('#<(a|b|i|u|table|tr|td|img) #i', $sig) || preg_match('#(href|src|target|title)=#i', $sig))
- {
- $errors[] = $lang['SIGNATURE_ERROR_HTML'];
- }
-
- $pr_data['user_sig'] = $sig;
- $db_data['user_sig'] = (string) $sig;
- }
- $tp_data['USER_SIG'] = $pr_data['user_sig'];
- break;
-
- /**
- * Род занятий (edit)
- */
- case 'user_occ':
- $occ = isset($_POST['user_occ']) ? (string) $_POST['user_occ'] : $pr_data['user_occ'];
- $occ = htmlCHR($occ);
- if ($submit && $occ != $pr_data['user_occ'])
- {
- $pr_data['user_occ'] = $occ;
- $db_data['user_occ'] = (string) $occ;
- }
- $tp_data['USER_OCC'] = $pr_data['user_occ'];
- break;
-
- /**
- * Интересы
- */
- case 'user_interests':
- $interests = isset($_POST['user_interests']) ? (string) $_POST['user_interests'] : $pr_data['user_interests'];
- $interests = htmlCHR($interests);
- if ($submit && $interests != $pr_data['user_interests'])
- {
- $pr_data['user_interests'] = $interests;
- $db_data['user_interests'] = (string) $interests;
- }
- $tp_data['USER_INTERESTS'] = $pr_data['user_interests'];
- break;
-
- /**
- * Skype
- */
- case 'user_skype':
- $skype = isset($_POST['user_skype']) ? (string) $_POST['user_skype'] : $pr_data['user_skype'];
- if ($submit && $skype != $pr_data['user_skype'])
- {
- if ($skype != '' && !preg_match("#^[a-zA-Z0-9_.\-@,]{6,32}$#", $skype))
- {
- $errors[] = $lang['SKYPE_ERROR'];
- }
- $pr_data['user_skype'] = $skype;
- $db_data['user_skype'] = (string) $skype;
- }
- $tp_data['USER_SKYPE'] = $pr_data['user_skype'];
- break;
-
- /**
- * Twitter
- */
- case 'user_twitter':
- $twitter = isset($_POST['user_twitter']) ? (string) $_POST['user_twitter'] : $pr_data['user_twitter'];
- if ($submit && $twitter != $pr_data['user_twitter'])
- {
- if ($twitter != '' && !preg_match("#^[a-zA-Z0-9_]{1,15}$#", $twitter))
- {
- $errors[] = $lang['TWITTER_ERROR'];
- }
- $pr_data['user_twitter'] = $twitter;
- $db_data['user_twitter'] = (string) $twitter;
- }
- $tp_data['USER_TWITTER'] = $pr_data['user_twitter'];
- break;
-
- /**
- * Выбор шаблона (edit)
- */
- case 'tpl_name':
- $templates = isset($_POST['tpl_name']) ? (string) $_POST['tpl_name'] : $pr_data['tpl_name'];
- $templates = htmlCHR($templates);
- if ($submit && $templates != $pr_data['tpl_name'])
- {
- $pr_data['tpl_name'] = $bb_cfg['tpl_name'];
- $db_data['tpl_name'] = (string) $bb_cfg['tpl_name'];
- foreach ($bb_cfg['templates'] as $folder => $name)
- {
- if ($templates == $folder)
+ if ($mode == 'register')
{
- $pr_data['tpl_name'] = $templates;
- $db_data['tpl_name'] = (string) $templates;
+ if (empty($email))
+ {
+ $errors[] = $lang['CHOOSE_E_MAIL'];
+ }
+ if (!$errors AND $err = validate_email($email))
+ {
+ $errors[] = $err;
+ }
+ $db_data['user_email'] = $email;
+ }
+ else if ($email != $pr_data['user_email']) // если смена мейла юзером
+ {
+ if (!$cur_pass_valid)
+ {
+ $errors[] = $lang['CONFIRM_PASSWORD_EXPLAIN'];
+ }
+ if (!$errors AND $err = validate_email($email))
+ {
+ $errors[] = $err;
+ }
+ if ($bb_cfg['reg_email_activation'])
+ {
+ $pr_data['user_active'] = 0;
+ $db_data['user_active'] = 0;
+ }
+ $db_data['user_email'] = $email;
}
}
- }
- $tp_data['TEMPLATES_SELECT'] = templates_select($pr_data['tpl_name'], 'tpl_name');
- break;
+ $tp_data['USER_EMAIL'] = htmlCHR($email);
+ break;
- /**
- * default
- */
- default:
- trigger_error("invalid profile field: $field", E_USER_ERROR);
- }
-}
+ /**
+ * Язык (edit, reg)
+ */
+ case 'user_lang':
+ $user_lang = isset($_POST['user_lang']) ? (string) $_POST['user_lang'] : $pr_data['user_lang'];
+ if ($submit && ($user_lang != $pr_data['user_lang'] || $mode == 'register'))
+ {
+ $pr_data['user_lang'] = $user_lang;
+ $db_data['user_lang'] = $user_lang;
+ }
+ break;
-if ($bb_cfg['birthday_enabled'] && $mode != 'register')
-{
- $days = array($lang['DELTA_TIME']['INTERVALS']['mday'][0] => 0);
- for ($i = 1; $i <= 31; $i++)
- {
- $days[$i] = $i;
- }
- $s_birthday = build_select('b_day', $days, $b_day);
+ /**
+ * Часовой пояс (edit, reg)
+ */
+ case 'user_timezone':
+ $user_timezone = isset($_POST['user_timezone']) ? (int) $_POST['user_timezone'] : $pr_data['user_timezone'];
+ if ($submit && ($user_timezone != $pr_data['user_timezone'] || $mode == 'register'))
+ {
+ if (isset($lang['TZ'][$user_timezone]))
+ {
+ $pr_data['user_timezone'] = $user_timezone;
+ $db_data['user_timezone'] = $user_timezone;
+ }
+ }
+ break;
- $months = array($lang['DELTA_TIME']['INTERVALS']['mon'][0] => 0);
- for ($i = 1; $i <= 12; $i++)
- {
- $month = bb_date(mktime(0, 0, 0, ($i+1), 0, 0), 'F');
- $months[$month] = $i;
- }
- $s_birthday .= build_select('b_md', $months, $b_md);
+ /**
+ * Пол (edit, reg)
+ */
+ case 'user_gender':
+ $user_gender = isset($_POST['user_gender']) ? (int) $_POST['user_gender'] : $pr_data['user_gender'];
+ if ($submit && $user_gender != $pr_data['user_gender'])
+ {
+ $pr_data['user_gender'] = $user_gender;
+ $db_data['user_gender'] = $user_gender;
+ }
+ $tp_data['USER_GENDER'] = build_select('user_gender', array_flip($lang['GENDER_SELECT']), $pr_data['user_gender']);
+ break;
- $year = bb_date(TIMENOW, 'Y', 'false');
- $years = array($lang['DELTA_TIME']['INTERVALS']['year'][0] => 0);
- for ($i = $year-$bb_cfg['birthday_max_age']; $i <= $year - $bb_cfg['birthday_min_age']; $i++)
- {
- $years[$i] = $i;
+ /**
+ * Возраст (edit)
+ */
+ case 'user_birthday':
+ $user_birthday = isset($_POST['user_birthday']) ? (string) $_POST['user_birthday'] : $pr_data['user_birthday'];
+
+ if ($submit && $user_birthday != $pr_data['user_birthday'])
+ {
+ $birthday_date = date_parse($user_birthday);
+
+ if (!empty($birthday_date['year']))
+ {
+ if (strtotime($user_birthday) >= TIMENOW)
+ {
+ $errors[] = $lang['WRONG_BIRTHDAY_FORMAT'];
+ }
+ elseif (bb_date(TIMENOW, 'Y', 'false') - $birthday_date['year'] > $bb_cfg['birthday_max_age'])
+ {
+ $errors[] = sprintf($lang['BIRTHDAY_TO_HIGH'], $bb_cfg['birthday_max_age']);
+ }
+ elseif (bb_date(TIMENOW, 'Y', 'false') - $birthday_date['year'] < $bb_cfg['birthday_min_age'])
+ {
+ $errors[] = sprintf($lang['BIRTHDAY_TO_LOW'], $bb_cfg['birthday_min_age']);
+ }
+ }
+
+ $pr_data['user_birthday'] = $user_birthday;
+ $db_data['user_birthday'] = $user_birthday;
+ }
+ $tp_data['USER_BIRTHDAY'] = $pr_data['user_birthday'];
+ break;
+
+ /**
+ * opt (edit)
+ */
+ case 'user_opt':
+ $user_opt = $pr_data['user_opt'];
+ $reg_mode = ($mode == 'register');
+
+ $update_user_opt = array(
+ # 'user_opt_name' => ($reg_mode) ? #reg_setting : #in_login_change
+ 'user_viewemail' => ($reg_mode) ? false : true,
+ 'user_viewonline' => ($reg_mode) ? false : true,
+ 'user_notify' => ($reg_mode) ? true : true,
+ 'user_notify_pm' => ($reg_mode) ? true : true,
+ 'user_porn_forums' => ($reg_mode) ? false : true,
+ 'user_dls' => ($reg_mode) ? false : true,
+ 'user_callseed' => ($reg_mode) ? true : true,
+ );
+
+ foreach ($update_user_opt as $opt => $can_change_opt)
+ {
+ if ($submit && (isset($_POST[$opt]) && $can_change_opt || $reg_mode))
+ {
+ $change_opt = ($reg_mode) ? $can_change_opt : !empty($_POST[$opt]);
+ setbit($user_opt, $bf['user_opt'][$opt], $change_opt);
+ }
+ $tp_data[strtoupper($opt)] = bf($user_opt, 'user_opt', $opt);
+ }
+ if ($submit && ($user_opt != $pr_data['user_opt'] || $reg_mode))
+ {
+ $pr_data['user_opt'] = $user_opt;
+ $db_data['user_opt'] = (int) $user_opt;
+ }
+ break;
+
+ /**
+ * Avatar (edit)
+ */
+ case 'avatar_ext_id':
+ if ($submit && !bf($pr_data['user_opt'], 'user_opt', 'dis_avatar'))
+ {
+ if (isset($_POST['delete_avatar']))
+ {
+ delete_avatar($pr_data['user_id'], $pr_data['avatar_ext_id']);
+ $pr_data['avatar_ext_id'] = 0;
+ $db_data['avatar_ext_id'] = 0;
+ }
+ else if (!empty($_FILES['avatar']['name']) && $bb_cfg['avatars']['up_allowed'])
+ {
+ require(INC_DIR .'functions_upload.php');
+ $upload = new upload_common();
+
+ if ($upload->init($bb_cfg['avatars'], $_FILES['avatar']) AND $upload->store('avatar', $pr_data))
+ {
+ $pr_data['avatar_ext_id'] = $upload->file_ext_id;
+ $db_data['avatar_ext_id'] = (int) $upload->file_ext_id;
+ }
+ else
+ {
+ $errors = array_merge($errors, $upload->errors);
+ }
+ }
+ }
+ $tp_data['AVATARS_MAX_SIZE'] = humn_size($bb_cfg['avatars']['max_size']);
+ break;
+
+ /**
+ * ICQ (edit)
+ */
+ case 'user_icq':
+ $icq = isset($_POST['user_icq']) ? (string) $_POST['user_icq'] : $pr_data['user_icq'];
+ if ($submit && $icq != $pr_data['user_icq'])
+ {
+ if ($icq == '' || preg_match('#^\d{6,15}$#', $icq))
+ {
+ $pr_data['user_icq'] = $icq;
+ $db_data['user_icq'] = (string) $icq;
+ }
+ else
+ {
+ $pr_data['user_icq'] = '';
+ $errors[] = htmlCHR($lang['ICQ_ERROR']);
+ }
+ }
+ $tp_data['USER_ICQ'] = $pr_data['user_icq'];
+ break;
+
+ /**
+ * Сайт (edit)
+ */
+ case 'user_website':
+ $website = isset($_POST['user_website']) ? (string) $_POST['user_website'] : $pr_data['user_website'];
+ $website = htmlCHR($website);
+ if ($submit && $website != $pr_data['user_website'])
+ {
+ if ($website == '' || preg_match('#^https?://[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]+$#iu', $website))
+ {
+ $pr_data['user_website'] = $website;
+ $db_data['user_website'] = (string) $website;
+ }
+ else
+ {
+ $pr_data['user_website'] = '';
+ $errors[] = htmlCHR($lang['WEBSITE_ERROR']);
+ }
+ }
+ $tp_data['USER_WEBSITE'] = $pr_data['user_website'];
+ break;
+
+ /**
+ * Откуда (edit)
+ */
+ case 'user_from':
+ $from = isset($_POST['user_from']) ? (string) $_POST['user_from'] : $pr_data['user_from'];
+ $from = htmlCHR($from);
+ if ($submit && $from != $pr_data['user_from'])
+ {
+ $pr_data['user_from'] = $from;
+ $db_data['user_from'] = (string) $from;
+ }
+ $tp_data['USER_FROM'] = $pr_data['user_from'];
+ break;
+
+ /**
+ * Подпись (edit)
+ */
+ case 'user_sig':
+ $sig = isset($_POST['user_sig']) ? (string) $_POST['user_sig'] : $pr_data['user_sig'];
+ if ($submit && $sig != $pr_data['user_sig'])
+ {
+ $sig = prepare_message($sig);
+
+ if (mb_strlen($sig, 'UTF-8') > $bb_cfg['max_sig_chars'])
+ {
+ $errors[] = $lang['SIGNATURE_TOO_LONG'];
+ }
+ else if (preg_match('#<(a|b|i|u|table|tr|td|img) #i', $sig) || preg_match('#(href|src|target|title)=#i', $sig))
+ {
+ $errors[] = $lang['SIGNATURE_ERROR_HTML'];
+ }
+
+ $pr_data['user_sig'] = $sig;
+ $db_data['user_sig'] = (string) $sig;
+ }
+ $tp_data['USER_SIG'] = $pr_data['user_sig'];
+ break;
+
+ /**
+ * Род занятий (edit)
+ */
+ case 'user_occ':
+ $occ = isset($_POST['user_occ']) ? (string) $_POST['user_occ'] : $pr_data['user_occ'];
+ $occ = htmlCHR($occ);
+ if ($submit && $occ != $pr_data['user_occ'])
+ {
+ $pr_data['user_occ'] = $occ;
+ $db_data['user_occ'] = (string) $occ;
+ }
+ $tp_data['USER_OCC'] = $pr_data['user_occ'];
+ break;
+
+
+ /**
+ * Интересы
+ */
+ case 'user_interests':
+ $interests = isset($_POST['user_interests']) ? (string) $_POST['user_interests'] : $pr_data['user_interests'];
+ $interests = htmlCHR($interests);
+ if ($submit && $interests != $pr_data['user_interests'])
+ {
+ $pr_data['user_interests'] = $interests;
+ $db_data['user_interests'] = (string) $interests;
+ }
+ $tp_data['USER_INTERESTS'] = $pr_data['user_interests'];
+ break;
+
+ /**
+ * Skype
+ */
+ case 'user_skype':
+ $skype = isset($_POST['user_skype']) ? (string) $_POST['user_skype'] : $pr_data['user_skype'];
+ if ($submit && $skype != $pr_data['user_skype'])
+ {
+ if ($skype != '' && !preg_match("#^[a-zA-Z0-9_.\-@,]{6,32}$#", $skype))
+ {
+ $errors[] = $lang['SKYPE_ERROR'];
+ }
+ $pr_data['user_skype'] = $skype;
+ $db_data['user_skype'] = (string) $skype;
+ }
+ $tp_data['USER_SKYPE'] = $pr_data['user_skype'];
+ break;
+
+
+ /**
+ * Twitter
+ */
+ case 'user_twitter':
+ $twitter = isset($_POST['user_twitter']) ? (string) $_POST['user_twitter'] : $pr_data['user_twitter'];
+ if ($submit && $twitter != $pr_data['user_twitter'])
+ {
+ if ($twitter != '' && !preg_match("#^[a-zA-Z0-9_]{1,15}$#", $twitter))
+ {
+ $errors[] = $lang['TWITTER_ERROR'];
+ }
+ $pr_data['user_twitter'] = $twitter;
+ $db_data['user_twitter'] = (string) $twitter;
+ }
+ $tp_data['USER_TWITTER'] = $pr_data['user_twitter'];
+ break;
+
+ /**
+ * Выбор шаблона (edit)
+ */
+ case 'tpl_name':
+ $templates = isset($_POST['tpl_name']) ? (string) $_POST['tpl_name'] : $pr_data['tpl_name'];
+ $templates = htmlCHR($templates);
+ if ($submit && $templates != $pr_data['tpl_name'])
+ {
+ $pr_data['tpl_name'] = $bb_cfg['tpl_name'];
+ $db_data['tpl_name'] = (string) $bb_cfg['tpl_name'];
+ foreach ($bb_cfg['templates'] as $folder => $name)
+ {
+ if ($templates == $folder)
+ {
+ $pr_data['tpl_name'] = $templates;
+ $db_data['tpl_name'] = (string) $templates;
+ }
+ }
+ }
+ $tp_data['TEMPLATES_SELECT'] = templates_select($pr_data['tpl_name'], 'tpl_name');
+ break;
+
+ /**
+ * default
+ */
+ default:
+ trigger_error("invalid profile field: $field", E_USER_ERROR);
}
- $s_birthday .= build_select('b_year', $years, $b_year);
- $tp_data['BIRTHDAY'] = $s_birthday;
}
// submit
@@ -795,10 +765,10 @@ $template->assign_vars(array(
'USER_TIMEZONE' => $pr_data['user_timezone'],
'AVATAR_EXPLAIN' => sprintf($lang['AVATAR_EXPLAIN'], $bb_cfg['avatars']['max_width'], $bb_cfg['avatars']['max_height'], (round($bb_cfg['avatars']['max_size'] / 1024))),
- 'AVATAR_DISALLOWED' => bf($pr_data['user_opt'], 'user_opt', 'allow_avatar'),
+ 'AVATAR_DISALLOWED' => bf($pr_data['user_opt'], 'user_opt', 'dis_avatar'),
'SIGNATURE_EXPLAIN' => sprintf($lang['SIGNATURE_EXPLAIN'], $bb_cfg['max_sig_chars']),
- 'SIG_DISALLOWED' => bf($pr_data['user_opt'], 'user_opt', 'allow_sig'),
+ 'SIG_DISALLOWED' => bf($pr_data['user_opt'], 'user_opt', 'dis_sig'),
'PR_USER_ID' => $pr_data['user_id'],
'U_RESET_AUTOLOGIN' => LOGIN_URL . "?logout=1&reset_autologin=1&sid={$userdata['session_id']}",
diff --git a/upload/includes/ucp/usercp_viewprofile.php b/upload/includes/ucp/usercp_viewprofile.php
index 03c1bcd28..4cf53f4c0 100644
--- a/upload/includes/ucp/usercp_viewprofile.php
+++ b/upload/includes/ucp/usercp_viewprofile.php
@@ -45,7 +45,7 @@ if (IS_ADMIN)
$rank_select = build_select('rank-sel', $rank_select, $user_rank);
}
-if (bf($profiledata['user_opt'], 'user_opt', 'viewemail') || $profiledata['user_id'] == $userdata['user_id'] || IS_AM)
+if (bf($profiledata['user_opt'], 'user_opt', 'user_viewemail') || $profiledata['user_id'] == $userdata['user_id'] || IS_AM)
{
$email_uri = ($bb_cfg['board_email_form']) ? 'profile.php?mode=email&'. POST_USERS_URL .'='. $profiledata['user_id'] : 'mailto:'. $profiledata['user_email'];
$email = ''. $profiledata['user_email'] .'';
@@ -80,7 +80,7 @@ $profile_user_id = ($profiledata['user_id'] == $userdata['user_id']);
$signature = ($bb_cfg['allow_sig'] && $profiledata['user_sig']) ? $profiledata['user_sig'] : '';
-if(bf($profiledata['user_opt'], 'user_opt', 'allow_sig'))
+if(bf($profiledata['user_opt'], 'user_opt', 'dis_sig'))
{
if($profile_user_id)
{
@@ -110,38 +110,35 @@ $template->assign_vars(array(
'EMAIL' => $email,
'WWW' => $profiledata['user_website'],
'ICQ' => $profiledata['user_icq'],
- 'LAST_VISIT_TIME' => ($profiledata['user_lastvisit']) ? (bf($profiledata['user_opt'], 'user_opt', 'allow_viewonline') && !IS_ADMIN) ? $lang['HIDDEN_USER'] : bb_date($profiledata['user_lastvisit'], 'Y-m-d H:i', 'false') : $lang['NEVER'],
- 'LAST_ACTIVITY_TIME' => ($profiledata['user_session_time']) ? (bf($profiledata['user_opt'], 'user_opt', 'allow_viewonline') && !IS_ADMIN) ? $lang['HIDDEN_USER'] : bb_date($profiledata['user_session_time'], 'Y-m-d H:i', 'false') : $lang['NEVER'],
- 'ALLOW_DLS' => bf($profiledata['user_opt'], 'user_opt', 'allow_dls'),
- 'LOCATION' => $profiledata['user_from'],
+ 'LAST_VISIT_TIME' => ($profiledata['user_lastvisit']) ? (bf($profiledata['user_opt'], 'user_opt', 'user_viewonline') && !IS_ADMIN) ? $lang['HIDDEN_USER'] : bb_date($profiledata['user_lastvisit'], 'Y-m-d H:i', 'false') : $lang['NEVER'],
+ 'LAST_ACTIVITY_TIME' => ($profiledata['user_session_time']) ? (bf($profiledata['user_opt'], 'user_opt', 'user_viewonline') && !IS_ADMIN) ? $lang['HIDDEN_USER'] : bb_date($profiledata['user_session_time'], 'Y-m-d H:i', 'false') : $lang['NEVER'],
'USER_ACTIVE' => $profiledata['user_active'],
+ 'LOCATION' => $profiledata['user_from'],
'OCCUPATION' => $profiledata['user_occ'],
'INTERESTS' => $profiledata['user_interests'],
'SKYPE' => $profiledata['user_skype'],
'TWITTER' => $profiledata['user_twitter'],
'USER_POINTS' => $profiledata['user_points'],
'GENDER' => ($bb_cfg['gender'] && $profiledata['user_gender']) ? $lang['GENDER_SELECT'][$profiledata['user_gender']] : '',
- 'BIRTHDAY' => ($bb_cfg['birthday_enabled'] && $profiledata['user_birthday'] != '0000-00-00') ? date('Y-m-d', strtotime($profiledata['user_birthday'])) : '',
+ 'BIRTHDAY' => ($bb_cfg['birthday_enabled'] && $profiledata['user_birthday'] != '0000-00-00') ? $profiledata['user_birthday'] : '',
'AGE' => ($bb_cfg['birthday_enabled'] && $profiledata['user_birthday'] != '0000-00-00') ? birthday_age($profiledata['user_birthday']) : '',
'L_VIEWING_PROFILE' => sprintf($lang['VIEWING_USER_PROFILE'], $profiledata['username']),
+ 'L_MY_PROFILE' => sprintf($lang['VIEWING_MY_PROFILE'], 'profile.php?mode=editprofile'),
'U_SEARCH_USER' => "search.php?search_author=1&uid={$profiledata['user_id']}",
'U_SEARCH_TOPICS' => "search.php?uid={$profiledata['user_id']}&myt=1",
'U_SEARCH_RELEASES' => "tracker.php?rid={$profiledata['user_id']}#results",
- 'AVATAR_IMG' => get_avatar($profiledata['user_id'], $profiledata['avatar_ext_id'], !bf($profiledata['user_opt'], 'user_opt', 'allow_avatar')),
- 'AVATAR_DISALLOWED' => bf($profiledata['user_opt'], 'user_opt', 'allow_avatar'),
-
- 'S_PROFILE_ACTION' => 'profile.php',
+ 'AVATAR_IMG' => get_avatar($profiledata['user_id'], $profiledata['avatar_ext_id'], !bf($profiledata['user_opt'], 'user_opt', 'dis_avatar')),
+ 'AVATAR_DISALLOWED' => bf($profiledata['user_opt'], 'user_opt', 'dis_avatar'),
'SIGNATURE' => $signature,
'SHOW_PASSKEY' => (IS_ADMIN || $profile_user_id),
'SHOW_ROLE' => (IS_AM || $profile_user_id || $profiledata['user_active']),
'GROUP_MEMBERSHIP' => false,
'TRAF_STATS' => !(IS_AM || $profile_user_id),
- 'U_MANAGE' => (IS_ADMIN) ? "profile.php?mode=editprofile&u={$profiledata['user_id']}" : 'profile.php?mode=editprofile',
));
if (IS_ADMIN)
@@ -190,6 +187,12 @@ else if (IS_MOD)
));
}
+// Show users torrent-profile
+if (IS_AM || $profile_user_id || !bf($profiledata['user_opt'], 'user_opt', 'user_dls'))
+{
+ require(INC_DIR .'ucp/usercp_viewtorrent.php');
+}
+
// Ajax bt_userdata
if (IS_AM || $profile_user_id)
{
@@ -199,43 +202,39 @@ else
{
$template->assign_vars(array(
'DOWN_TOTAL_BYTES' => false,
- 'MIN_DL_BYTES' => false,
+ 'MIN_DL_BYTES' => false,
));
}
if (IS_ADMIN)
{
- $template->assign_vars(array(
- 'EDITABLE_TPLS' => true,
- 'U_PERMISSIONS' => "admin/admin_ug_auth.php?mode=user&u={$profiledata['user_id']}",
- ));
-
$ajax_user_opt = bb_json_encode(array(
- 'allow_avatar' => bf($profiledata['user_opt'], 'user_opt', 'allow_avatar'),
- 'allow_sig' => bf($profiledata['user_opt'], 'user_opt', 'allow_sig'),
- 'allow_passkey' => bf($profiledata['user_opt'], 'user_opt', 'allow_passkey'),
- 'allow_pm' => bf($profiledata['user_opt'], 'user_opt', 'allow_pm'),
- 'allow_post' => bf($profiledata['user_opt'], 'user_opt', 'allow_post'),
- 'allow_post_edit' => bf($profiledata['user_opt'], 'user_opt', 'allow_post_edit'),
- 'allow_topic' => bf($profiledata['user_opt'], 'user_opt', 'allow_topic'),
+ 'dis_avatar' => bf($profiledata['user_opt'], 'user_opt', 'dis_avatar'),
+ 'dis_sig' => bf($profiledata['user_opt'], 'user_opt', 'dis_sig'),
+ 'dis_passkey' => bf($profiledata['user_opt'], 'user_opt', 'dis_passkey'),
+ 'dis_pm' => bf($profiledata['user_opt'], 'user_opt', 'dis_pm'),
+ 'dis_post' => bf($profiledata['user_opt'], 'user_opt', 'dis_post'),
+ 'dis_post_edit' => bf($profiledata['user_opt'], 'user_opt', 'dis_post_edit'),
+ 'dis_topic' => bf($profiledata['user_opt'], 'user_opt', 'dis_topic'),
));
$template->assign_vars(array(
'EDITABLE_TPLS' => true,
'AJAX_USER_OPT' => $ajax_user_opt,
- 'EMAIL_ADDRESS' => htmlCHR($profiledata['user_email']),
+ 'U_MANAGE' => "profile.php?mode=editprofile&u={$profiledata['user_id']}",
+ 'U_PERMISSIONS' => "admin/admin_ug_auth.php?mode=user&u={$profiledata['user_id']}",
));
}
$user_restrictions = array();
-if (bf($profiledata['user_opt'], 'user_opt', 'allow_avatar')) $user_restrictions[] = $lang['HIDE_AVATARS'];
-if (bf($profiledata['user_opt'], 'user_opt', 'allow_sig')) $user_restrictions[] = $lang['SHOW_CAPTION'];
-if (bf($profiledata['user_opt'], 'user_opt', 'allow_passkey')) $user_restrictions[] = $lang['DOWNLOAD_TORRENT'];
-if (bf($profiledata['user_opt'], 'user_opt', 'allow_pm')) $user_restrictions[] = $lang['SEND_PM'];
-if (bf($profiledata['user_opt'], 'user_opt', 'allow_post')) $user_restrictions[] = $lang['SEND_MESSAGE'];
-if (bf($profiledata['user_opt'], 'user_opt', 'allow_post_edit')) $user_restrictions[] = $lang['EDIT_POST'];
-if (bf($profiledata['user_opt'], 'user_opt', 'allow_topic')) $user_restrictions[] = $lang['NEW_THREADS'];
+if (bf($profiledata['user_opt'], 'user_opt', 'dis_avatar')) $user_restrictions[] = $lang['HIDE_AVATARS'];
+if (bf($profiledata['user_opt'], 'user_opt', 'dis_sig')) $user_restrictions[] = $lang['SHOW_CAPTION'];
+if (bf($profiledata['user_opt'], 'user_opt', 'dis_passkey')) $user_restrictions[] = $lang['DOWNLOAD_TORRENT'];
+if (bf($profiledata['user_opt'], 'user_opt', 'dis_pm')) $user_restrictions[] = $lang['SEND_PM'];
+if (bf($profiledata['user_opt'], 'user_opt', 'dis_post')) $user_restrictions[] = $lang['SEND_MESSAGE'];
+if (bf($profiledata['user_opt'], 'user_opt', 'dis_post_edit')) $user_restrictions[] = $lang['EDIT_POST'];
+if (bf($profiledata['user_opt'], 'user_opt', 'dis_topic')) $user_restrictions[] = $lang['NEW_THREADS'];
$template->assign_var('USER_RESTRICTIONS', join('', $user_restrictions));
diff --git a/upload/includes/ucp/usercp_viewtorrent.php b/upload/includes/ucp/usercp_viewtorrent.php
new file mode 100644
index 000000000..36d852d71
--- /dev/null
+++ b/upload/includes/ucp/usercp_viewtorrent.php
@@ -0,0 +1,162 @@
+get_excluded_forums(AUTH_VIEW);
+$not_auth_forums_sql = ($excluded_forums_csv) ? "
+ AND f.forum_id NOT IN($excluded_forums_csv)
+ AND f.forum_parent NOT IN($excluded_forums_csv)
+" : '';
+
+$sql = DB()->fetch_rowset("
+ SELECT
+ f.forum_id, f.forum_name, t.topic_title,
+ tor.tor_type, tor.size,
+ sn.seeders, sn.leechers, tr.*
+ FROM ". BB_FORUMS ." f, ". BB_TOPICS ." t, ". BB_BT_TRACKER ." tr, ". BB_BT_TORRENTS ." tor, ". BB_BT_TRACKER_SNAP ." sn
+ WHERE tr.user_id = {$profiledata['user_id']}
+ AND tr.topic_id = tor.topic_id
+ AND sn.topic_id = tor.topic_id
+ AND tor.topic_id = t.topic_id
+ AND t.forum_id = f.forum_id
+ $not_auth_forums_sql
+ GROUP BY tr.topic_id
+ ORDER BY f.forum_name, t.topic_title
+");
+
+foreach ($sql as $rowset)
+{
+ if ($rowset['releaser'])
+ {
+ $releasing[] = $rowset;
+ }
+ elseif ($rowset['seeder'])
+ {
+ $seeding[] = $rowset;
+ }
+ else
+ {
+ $leeching[] = $rowset;
+ }
+}
+
+if ($releasing)
+{
+ foreach ($releasing as $i => $row)
+ {
+ $is_gold = '';
+ if ($tr_cfg['gold_silver_enabled'])
+ {
+ if ($row['tor_type'] == TOR_TYPE_GOLD)
+ {
+ $is_gold = '
';
+ }
+ elseif ($row['tor_type'] == TOR_TYPE_SILVER)
+ {
+ $is_gold = '
';
+ }
+ }
+
+ $topic_title = wbr($row['topic_title']);
+
+ $template->assign_block_vars('released', array(
+ 'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2',
+ 'FORUM_NAME' => htmlCHR($row['forum_name']),
+ 'TOPIC_TITLE' => ($row['update_time']) ? $topic_title : "$topic_title",
+ 'U_VIEW_FORUM' => FORUM_URL . $row['forum_id'],
+ 'U_VIEW_TOPIC' => TOPIC_URL . $row['topic_id'],
+ 'TOR_TYPE' => $is_gold,
+ 'TOPIC_SEEDERS' => ($row['seeders']) ? $row['seeders'] : 0,
+ 'TOPIC_LEECHERS' => ($row['leechers']) ? $row['leechers'] : 0,
+ 'SPEED_UP' => ($row['speed_up']) ? humn_size($row['speed_up'], 0, 'KB') .'/s' : '-',
+ ));
+
+ $releasing_count++;
+ }
+}
+
+if ($seeding)
+{
+ foreach ($seeding as $i => $row)
+ {
+ $is_gold = '';
+ if ($tr_cfg['gold_silver_enabled'])
+ {
+ if ($row['tor_type'] == TOR_TYPE_GOLD)
+ {
+ $is_gold = '
';
+ }
+ elseif ($row['tor_type'] == TOR_TYPE_SILVER)
+ {
+ $is_gold = '
';
+ }
+ }
+
+ $topic_title = wbr($row['topic_title']);
+
+ $template->assign_block_vars('seed', array(
+ 'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2',
+ 'FORUM_NAME' => htmlCHR($row['forum_name']),
+ 'TOPIC_TITLE' => ($row['update_time']) ? $topic_title : "$topic_title",
+ 'U_VIEW_FORUM' => FORUM_URL . $row['forum_id'],
+ 'U_VIEW_TOPIC' => TOPIC_URL . $row['topic_id'],
+ 'TOR_TYPE' => $is_gold,
+ 'TOPIC_SEEDERS' => ($row['seeders']) ? $row['seeders'] : 0,
+ 'TOPIC_LEECHERS' => ($row['leechers']) ? $row['leechers'] : 0,
+ 'SPEED_UP' => ($row['speed_up']) ? humn_size($row['speed_up'], 0, 'KB') .'/s' : '-',
+ ));
+
+ $seeding_count++;
+ }
+}
+
+if ($leeching)
+{
+ foreach ($leeching as $i => $row)
+ {
+ $is_gold = '';
+ if ($tr_cfg['gold_silver_enabled'])
+ {
+ if ($row['tor_type'] == TOR_TYPE_GOLD)
+ {
+ $is_gold = '
';
+ }
+ elseif ($row['tor_type'] == TOR_TYPE_SILVER)
+ {
+ $is_gold = '
';
+ }
+ }
+
+ $compl_size = ($row['remain'] && $row['size'] && $row['size'] > $row['remain']) ? ($row['size'] - $row['remain']) : 0;
+ $compl_perc = ($compl_size) ? floor($compl_size * 100 / $row['size']) : 0;
+ $topic_title = wbr($row['topic_title']);
+
+ $template->assign_block_vars('leech', array(
+ 'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2',
+ 'FORUM_NAME' => htmlCHR($row['forum_name']),
+ 'TOPIC_TITLE' => ($row['update_time']) ? $topic_title : "$topic_title",
+ 'U_VIEW_FORUM' => FORUM_URL . $row['forum_id'],
+ 'U_VIEW_TOPIC' => TOPIC_URL . $row['topic_id'],
+ 'COMPL_PERC' => $compl_perc,
+ 'TOR_TYPE' => $is_gold,
+ 'TOPIC_SEEDERS' => ($row['seeders']) ? $row['seeders'] : 0,
+ 'TOPIC_LEECHERS' => ($row['leechers']) ? $row['leechers'] : 0,
+ 'SPEED_DOWN' => ($row['speed_down']) ? humn_size($row['speed_down'], 0, 'KB') .'/s' : '-',
+ ));
+
+ $leeching_count++;
+ }
+}
+
+$template->assign_vars(array(
+ 'SHOW_SEARCH_DL' => IS_AM || $profile_user_id,
+ 'USERNAME' => $profiledata['username'],
+ 'L_RELEASINGS' => "{$lang['RELEASING']}: ". (($releasing_count) ? "$releasing_count" : '0'),
+ 'L_SEEDINGS' => "{$lang['SEEDING']}: ". (($seeding_count) ? "$seeding_count" : '0'),
+ 'L_LEECHINGS' => "{$lang['LEECHING']}: ". (($leeching_count) ? "$leeching_count" : '0'),
+ 'USER_DLS' => $releasing_count || $seeding_count || $leeching_count,
+));
diff --git a/upload/index.php b/upload/index.php
index de5295624..96f43fa46 100644
--- a/upload/index.php
+++ b/upload/index.php
@@ -106,11 +106,11 @@ $sql = "
t.topic_id AS last_topic_id, t.topic_title AS last_topic_title,
u.user_id AS last_post_user_id, u.user_rank AS last_post_user_rank,
IF(p.poster_id = $anon, p.post_username, u.username) AS last_post_username
- FROM ". BB_CATEGORIES ." c
- INNER JOIN ". BB_FORUMS ." f ON($forums_join_sql)
+ FROM ". BB_CATEGORIES ." c
+ INNER JOIN ". BB_FORUMS ." f ON($forums_join_sql)
$join_p_type ". BB_POSTS ." p ON($posts_join_sql)
$join_t_type ". BB_TOPICS ." t ON($topics_join_sql)
- LEFT JOIN ". BB_USERS ." u ON(u.user_id = p.poster_id)
+ LEFT JOIN ". BB_USERS ." u ON(u.user_id = p.poster_id)
ORDER BY c.cat_order, f.forum_order
";
@@ -168,8 +168,7 @@ if (!$cat_forums = CACHE('bb_cache')->get($cache_name))
$cat_forums[$cat_id]['f'][$forum_id] = $row;
}
CACHE('bb_cache')->set($cache_name, $cat_forums, 180);
- unset($row);
- unset($forums);
+ unset($row, $forums);
$datastore->rm('cat_forums');
}
@@ -194,7 +193,7 @@ if (!empty($mod))
{
foreach ($group_ids as $group_id)
{
- $moderators[$forum_id][] = ''. $mod['name_groups'][$group_id] .'';
+ $moderators[$forum_id][] = ''. $mod['name_groups'][$group_id] .'';
}
}
}
@@ -202,44 +201,8 @@ if (!empty($mod))
unset($mod);
$datastore->rm('moderators');
-if (!$forums_count = count($cat_forums) AND $viewcat)
-{
- redirect("index.php");
-}
-
-$template->assign_vars(array(
- 'SHOW_FORUMS' => $forums_count,
- 'PAGE_TITLE' => ($viewcat) ? $cat_title_html[$viewcat] : $lang['HOME'],
- 'NO_FORUMS_MSG' => ($only_new) ? $lang['NO_NEW_POSTS'] : $lang['NO_FORUMS'],
-
- 'TOTAL_TOPICS' => sprintf($lang['POSTED_TOPICS_TOTAL'], $stats['topiccount']),
- 'TOTAL_POSTS' => sprintf($lang['POSTED_ARTICLES_TOTAL'], $stats['postcount']),
- 'TOTAL_USERS' => sprintf($lang['REGISTERED_USERS_TOTAL'], $stats['usercount']),
- 'TOTAL_GENDER' => ($bb_cfg['gender']) ? sprintf($lang['USERS_TOTAL_GENDER'], $stats['male'], $stats['female'], $stats['unselect']) : '',
- 'NEWEST_USER' => sprintf($lang['NEWEST_USER'], profile_url($stats['newestuser'])),
-
- // Tracker stats
- 'TORRENTS_STAT' => ($bb_cfg['tor_stats']) ? sprintf($lang['TORRENTS_STAT'], $stats['torrentcount'], humn_size($stats['size'])) : '',
- 'PEERS_STAT' => ($bb_cfg['tor_stats']) ? sprintf($lang['PEERS_STAT'], $stats['peers'], $stats['seeders'], $stats['leechers']) : '',
- 'SPEED_STAT' => ($bb_cfg['tor_stats']) ? sprintf($lang['SPEED_STAT'], humn_size($stats['speed']) .'/s') : '',
- 'SHOW_MOD_INDEX' => $bb_cfg['show_mod_index'],
- 'FORUM_IMG' => $images['forum'],
- 'FORUM_NEW_IMG' => $images['forum_new'],
- 'FORUM_LOCKED_IMG' => $images['forum_locked'],
-
- 'SHOW_ONLY_NEW_MENU' => true,
- 'ONLY_NEW_POSTS_ON' => ($only_new == ONLY_NEW_POSTS),
- 'ONLY_NEW_TOPICS_ON' => ($only_new == ONLY_NEW_TOPICS),
-
- 'U_SEARCH_NEW' => "search.php?new=1",
- 'U_SEARCH_SELF_BY_MY' => "search.php?uid={$userdata['user_id']}&o=1",
- 'U_SEARCH_LATEST' => "search.php?search_id=latest",
- 'U_SEARCH_UNANSWERED' => "search.php?search_id=unanswered",
-
- 'SHOW_LAST_TOPIC' => $show_last_topic,
-));
-
// Build index page
+$forums_count = 0;
foreach ($cat_forums as $cid => $c)
{
$template->assign_block_vars('h_c', array(
@@ -252,7 +215,7 @@ foreach ($cat_forums as $cid => $c)
'H_C_AL_MESS' => ($hide_cat_opt && !$showhide) ? true : false
));
- if (!$showhide && isset($hide_cat_user[$cid]))
+ if (!$showhide && isset($hide_cat_user[$cid]) && !$viewcat)
{
continue;
}
@@ -260,7 +223,7 @@ foreach ($cat_forums as $cid => $c)
$template->assign_block_vars('c', array(
'CAT_ID' => $cid,
'CAT_TITLE' => $cat_title_html[$cid],
- 'U_VIEWCAT' => "index.php?c=$cid",
+ 'U_VIEWCAT' => CAT_URL . $cid,
));
foreach ($c['f'] as $fid => $f)
@@ -271,6 +234,7 @@ foreach ($cat_forums as $cid => $c)
}
$is_sf = $f['forum_parent'];
+ $forums_count++;
$new = is_unread($f['last_post_time'], $f['last_topic_id'], $f['forum_id']) ? '_new' : '';
$folder_image = ($is_sf) ? $images["icon_minipost{$new}"] : $images["forum{$new}"];
@@ -316,6 +280,38 @@ foreach ($cat_forums as $cid => $c)
}
}
+$template->assign_vars(array(
+ 'SHOW_FORUMS' => $forums_count,
+ 'PAGE_TITLE' => ($viewcat) ? $cat_title_html[$viewcat] : $lang['HOME'],
+ 'NO_FORUMS_MSG' => ($only_new) ? $lang['NO_NEW_POSTS'] : $lang['NO_FORUMS'],
+
+ 'TOTAL_TOPICS' => sprintf($lang['POSTED_TOPICS_TOTAL'], $stats['topiccount']),
+ 'TOTAL_POSTS' => sprintf($lang['POSTED_ARTICLES_TOTAL'], $stats['postcount']),
+ 'TOTAL_USERS' => sprintf($lang['REGISTERED_USERS_TOTAL'], $stats['usercount']),
+ 'TOTAL_GENDER' => ($bb_cfg['gender']) ? sprintf($lang['USERS_TOTAL_GENDER'], $stats['male'], $stats['female'], $stats['unselect']) : '',
+ 'NEWEST_USER' => sprintf($lang['NEWEST_USER'], profile_url($stats['newestuser'])),
+
+ // Tracker stats
+ 'TORRENTS_STAT' => ($bb_cfg['tor_stats']) ? sprintf($lang['TORRENTS_STAT'], $stats['torrentcount'], humn_size($stats['size'])) : '',
+ 'PEERS_STAT' => ($bb_cfg['tor_stats']) ? sprintf($lang['PEERS_STAT'], $stats['peers'], $stats['seeders'], $stats['leechers']) : '',
+ 'SPEED_STAT' => ($bb_cfg['tor_stats']) ? sprintf($lang['SPEED_STAT'], humn_size($stats['speed']) .'/s') : '',
+ 'SHOW_MOD_INDEX' => $bb_cfg['show_mod_index'],
+ 'FORUM_IMG' => $images['forum'],
+ 'FORUM_NEW_IMG' => $images['forum_new'],
+ 'FORUM_LOCKED_IMG' => $images['forum_locked'],
+
+ 'SHOW_ONLY_NEW_MENU' => true,
+ 'ONLY_NEW_POSTS_ON' => ($only_new == ONLY_NEW_POSTS),
+ 'ONLY_NEW_TOPICS_ON' => ($only_new == ONLY_NEW_TOPICS),
+
+ 'U_SEARCH_NEW' => "search.php?new=1",
+ 'U_SEARCH_SELF_BY_MY' => "search.php?uid={$userdata['user_id']}&o=1",
+ 'U_SEARCH_LATEST' => "search.php?search_id=latest",
+ 'U_SEARCH_UNANSWERED' => "search.php?search_id=unanswered",
+
+ 'SHOW_LAST_TOPIC' => $show_last_topic,
+));
+
// Set tpl vars for bt_userdata
if ($bb_cfg['bt_show_dl_stat_on_index'] && !IS_GUEST)
{
@@ -374,7 +370,7 @@ if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled'])
{
$week_list = $today_list = array();
$week_all = $today_all = false;
-
+
if ($stats['birthday_week_list'])
{
shuffle($stats['birthday_week_list']);
@@ -386,7 +382,7 @@ if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled'])
continue;
}
- $week_list[] = profile_url($week) .' ('. birthday_age($week['age']) .')';
+ $week_list[] = profile_url($week) .' ('. birthday_age($week['user_birthday']) .')';
}
$week_all = ($week_all) ? ' ...' : '';
$week_list = sprintf($lang['BIRTHDAY_WEEK'], $bb_cfg['birthday_check_day'], join(', ', $week_list)) . $week_all;
@@ -404,7 +400,7 @@ if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled'])
continue;
}
- $today_list[] = profile_url($today) .' ('. birthday_age($today['age']) .')';
+ $today_list[] = profile_url($today) .' ('. birthday_age($today['user_birthday']) .')';
}
$today_all = ($today_all) ? ' ...' : '';
$today_list = $lang['BIRTHDAY_TODAY'] . join(', ', $today_list) . $today_all;
@@ -420,9 +416,9 @@ if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled'])
// Allow cron
if (IS_AM)
{
- if (@file_exists(CRON_RUNNING))
+ if (file_exists(CRON_RUNNING))
{
- if (@file_exists(CRON_ALLOWED))
+ if (file_exists(CRON_ALLOWED))
{
unlink (CRON_ALLOWED);
}
diff --git a/upload/language/en/main.php b/upload/language/en/main.php
index 9b86655ef..a9101d7ab 100644
--- a/upload/language/en/main.php
+++ b/upload/language/en/main.php
@@ -508,6 +508,7 @@ $lang['OUTBOX_EXPL'] = '';
// Profiles/Registration
//
$lang['VIEWING_USER_PROFILE'] = 'Viewing profile :: %s';
+$lang['VIEWING_MY_PROFILE'] = 'My profile [ Settings / Change profile ]';
$lang['DISABLED_USER'] = 'Account disabled';
$lang['MANAGE_USER'] = 'Administration';
@@ -554,7 +555,7 @@ $lang['ALWAYS_NOTIFY_EXPLAIN'] = 'Sends an e-mail when someone replies to a topi
$lang['BOARD_LANG'] = 'Board Language';
$lang['GENDER'] = 'Gender';
$lang['GENDER_SELECT'] = array(
- 0 => 'Unselect',
+ 0 => 'Unknown',
1 => 'Male',
2 => 'Female'
);
@@ -600,7 +601,7 @@ $lang['RESET_AUTOLOGIN_EXPL'] = '';
$lang['AVATAR'] = 'Avatar';
$lang['AVATAR_EXPLAIN'] = 'Displays a small graphic image below your details in posts. Only one image can be displayed at a time, its width can be no greater than %d pixels, the height no greater than %d pixels, and the file size no more than %d KB.';
-$lang['UPLOAD_AVATAR_FILE'] = 'Upload Avatar from your machine';
+$lang['UPLOAD_AVATAR_FILE'] = 'Upload Avatar';
$lang['SELECT_AVATAR'] = 'Select avatar';
$lang['RETURN_PROFILE'] = 'Return to profile';
@@ -1159,8 +1160,8 @@ $lang['SPEED_DOWN'] = 'Speed Down';
$lang['SEEDERS'] = 'Seeders';
$lang['LEECHERS'] = 'Leechers';
$lang['RELEASING'] = 'Self';
-$lang['SEEDING'] = 'Seeding';
-$lang['LEECHING'] = 'Leeching';
+$lang['SEEDING'] = 'Seed';
+$lang['LEECHING'] = 'Leech';
$lang['IS_REGISTERED'] = 'Registered';
$lang['MAGNET'] = 'Magnet';
@@ -1315,9 +1316,7 @@ $lang['NOT_TORRENT'] = 'This file is not torrent';
$lang['ONLY_1_TOR_PER_POST'] = 'You can register only one torrent in one post';
$lang['ONLY_1_TOR_PER_TOPIC'] = 'You can register only one torrent in one topic';
$lang['VIEWING_USER_BT_PROFILE'] = 'Viewing torrent-profile :: %s'; // %s is username
-$lang['CUR_ACTIVE_DLS'] = 'Currently active torrents';
-$lang['CUR_ACTIVE_DLS_ERROR'] = 'User does not download and seeding';
-$lang['CUR_ACTIVE_DLS_DISALLOWED'] = 'Browse the user denied active torrents';
+$lang['CUR_ACTIVE_DLS'] = 'Active torrents';
$lang['TD_TRAF'] = 'Today';
$lang['YS_TRAF'] = 'Yesterday';
@@ -1555,8 +1554,6 @@ $lang['NOTICE'] = '!ATTENTION!';
$lang['POWERED'] = 'UG93ZXJlZCBieSA8YSB0YXJnZXQ9Il9ibGFuayIgaHJlZj0iaHR0cDovL3RvcnJlbnRwaWVyLm1lIj5Ub3JyZW50UGllciBJSTwvYT4gJmNvcHk7IE1laXRoYXIsIFRvcnJlbnRQaWVyIElJIFRlYW0=';
$lang['COPY'] = 'The site does not give electronic versions of products, and is engaged only in a collecting and cataloguing of the references sent and published at a forum by our readers. If you are the legal owner of any submitted material and do not wish that the reference to him{it} was in our catalogue, contact us and we shall immediately remove her. Files for an exchange on tracker are given by users of a site, and the administration does not bear the responsibility for their maintenance. The request to not fill in the files protected by copyrights, and also files of the illegal maintenance!';
-$lang['CALLSEED'] = 'Downloaded the call';
-
// FILELIST
$lang['FILELIST'] = 'Filelist';
$lang['COLLAPSE'] = 'Collapse directory';
@@ -1736,7 +1733,6 @@ $lang['INDEXER'] = "Reindex search";
$lang['FORUM_STYLE'] = 'Forum style';
$lang['LINKS_ARE_FORBIDDEN'] = 'Links are forbidden';
-$lang['YOU_ARE_BEING_CHEATED'] = 'Looks like you are being cheated
Site is opened in frame. The current address is';
$lang['DONATION'] = 'Donation';
@@ -2861,18 +2857,13 @@ $lang['BOT_TOPIC_MOVED_FROM_TO'] = 'Topic has been moved from forum [b]%s[/b] to
$lang['BOT_MESS_SPLITS'] = 'Topic has been split. New topic - [b]%s[/b][br][br]%s';
$lang['BOT_TOPIC_SPLITS'] = 'Topic has been split from [b]%s[/b][br][br]%s';
-$lang['CALLSEED_SUBJ'] = 'Download help %s';
-$lang['CALLSEED_TEXT'] = 'Hello!
Your help is needed in the release %s :: %s
If you decide to help, but already deleted the torrent file, you can download it this
I hope for your help!';
-
-$lang['CALLSEED_MSG_OK'] = 'Message (PM) has been sent to all those who downloaded this release';
-$lang['CALLSEED_MSG_SPAM'] = 'Request has already been once successfully sent (Probably not you)
-
The next opportunity to send a request to be %s hours.
- Call you can download it only once in day';
-$lang['CALLSEED_MSG_MSG'] = 'Error sending message';
-$lang['CALLSEED_MSG_MSG_TEXT'] = 'Error saving text messages';
-$lang['CALLSEED_MSG_POPUP'] = 'Error of popup';
-$lang['CALLSEED_MSG_TIME'] = 'Unable to set the last query';
-$lang['CALLSEED_HAVE_SEED'] = 'Topic does not require help (Seeders: %d, Leechers: %d)';
+$lang['CALLSEED'] = 'Downloaded the call';
+$lang['CALLSEED_EXPLAIN'] = 'Take notice with a request to return to the distribution?';
+$lang['CALLSEED_SUBJECT'] = 'Download help %s';
+$lang['CALLSEED_TEXT'] = 'Hello![br]Your help is needed in the release [url=%s]%s[/url][br]If you decide to help, but already deleted the torrent file, you can download it [url=%s]this[/url][br][br]I hope for your help!';
+$lang['CALLSEED_MSG_OK'] = 'Message has been sent to all those who downloaded this release';
+$lang['CALLSEED_MSG_SPAM'] = 'Request has already been once successfully sent (Probably not you)
The next opportunity to send a request to be %s.';
+$lang['CALLSEED_HAVE_SEED'] = 'Topic does not require help (Seeders: %d)';
$lang['LOG_ACTION']['LOG_TYPE'] = array(
'mod_topic_delete' => 'Topic:
deleted',
diff --git a/upload/language/ru/main.php b/upload/language/ru/main.php
index 3ce371494..206fddc29 100644
--- a/upload/language/ru/main.php
+++ b/upload/language/ru/main.php
@@ -149,7 +149,7 @@ $lang['POSTED_ARTICLES_ZERO_TOTAL'] = 'Наши пользователи не о
$lang['POSTED_ARTICLES_TOTAL'] = 'Наши пользователи оставили сообщений: %s'; // Number of posts
$lang['REGISTERED_USERS_ZERO_TOTAL'] = 'У нас нет зарегистрированных пользователей'; // # registered users
$lang['REGISTERED_USERS_TOTAL'] = 'Всего зарегистрированных пользователей: %s'; // # registered users
-$lang['USERS_TOTAL_GENDER'] = 'Парней: %d, Девушек: %d, Не указан: %d';
+$lang['USERS_TOTAL_GENDER'] = 'Парней: %d, Девушек: %d, Не указали: %d';
$lang['NEWEST_USER'] = 'Последний зарегистрированный пользователь: %s'; // username
// Tracker stats
@@ -185,7 +185,7 @@ $lang['USER_WELCOME'] = 'Рады видеть вас, ';
//
$lang['HOME'] = 'Главная';
$lang['NO_POSTS'] = 'Нет сообщений';
-$lang['NO_FORUMS'] = 'На этом сайте нет форумов';
+$lang['NO_FORUMS'] = 'Нет доступных для показа форумов';
$lang['PRIVATE_MESSAGE'] = 'Личное сообщение';
$lang['PRIVATE_MESSAGES'] = 'Личные сообщения';
@@ -509,6 +509,7 @@ $lang['OUTBOX_EXPL'] = 'В папке Исходящие находятс
// Profiles/Registration
//
$lang['VIEWING_USER_PROFILE'] = 'Профиль пользователя %s';
+$lang['VIEWING_MY_PROFILE'] = 'Мой профиль [ Настройки / Изменить профиль ]';
$lang['DISABLED_USER'] = 'Пользователь деактивирован';
$lang['MANAGE_USER'] = 'Администрирование';
@@ -556,7 +557,7 @@ $lang['ALWAYS_NOTIFY_EXPLAIN'] = 'Когда кто-нибудь ответит
$lang['BOARD_LANG'] = 'Язык';
$lang['GENDER'] = 'Пол';
$lang['GENDER_SELECT'] = array(
- 0 => 'Не определилось',
+ 0 => 'Не указан',
1 => 'Мужской',
2 => 'Женский'
);
@@ -590,7 +591,7 @@ $lang['PUBLIC_VIEW_EMAIL'] = 'Показывать мой адрес e-mail в
$lang['EMAIL_EXPLAIN'] = 'На этот адрес вам будет отправлено письмо для завершения регистрации';
$lang['CURRENT_PASSWORD'] = 'Текущий пароль';
-$lang['NEW_PASSWORD'] = 'Новый пароль';
+$lang['NEW_PASSWORD'] = "Новый пароль\n";
$lang['CONFIRM_PASSWORD'] = 'Подтвердите пароль';
$lang['CONFIRM_PASSWORD_EXPLAIN'] = 'Вы должны указать ваш текущий пароль, если хотите изменить его или поменять свой email.';
$lang['PASSWORD_IF_CHANGED'] = 'Указывайте пароль только если вы хотите его поменять';
@@ -602,7 +603,7 @@ $lang['RESET_AUTOLOGIN_EXPL'] = 'включая все места, где вы
$lang['AVATAR'] = 'Аватара';
$lang['AVATAR_EXPLAIN'] = 'Показывает небольшое изображение под информацией о вас в сообщениях. Может быть показано только одно изображение, шириной не более %d пикселов, высотой не более %d пикселов и объемом не более %d кб.';
-$lang['UPLOAD_AVATAR_FILE'] = 'Загрузить аватару с вашего компьютера';
+$lang['UPLOAD_AVATAR_FILE'] = 'Загрузить аватару';
$lang['SELECT_AVATAR'] = 'Выберите аватару';
$lang['RETURN_PROFILE'] = 'Вернуться к профилю';
@@ -1163,8 +1164,8 @@ $lang['SPEED_DOWN'] = 'Скорость скачивания';
$lang['SEEDERS'] = 'Сидов';
$lang['LEECHERS'] = 'Личеров';
$lang['RELEASING'] = 'Свои';
-$lang['SEEDING'] = 'Раздает';
-$lang['LEECHING'] = 'Качает';
+$lang['SEEDING'] = 'Сидер';
+$lang['LEECHING'] = 'Личер';
$lang['IS_REGISTERED'] = 'Зарегистрирован';
$lang['MAGNET'] = 'Magnet';
@@ -1319,9 +1320,7 @@ $lang['NOT_TORRENT'] = 'Это не торрент-файл';
$lang['ONLY_1_TOR_PER_POST'] = 'Вы не можете зарегистрировать еще один торрент для этого сообщения';
$lang['ONLY_1_TOR_PER_TOPIC'] = 'Вы не можете зарегистрировать еще один торрент для этого топика';
$lang['VIEWING_USER_BT_PROFILE'] = 'Торрент-профиль'; // %s is username
-$lang['CUR_ACTIVE_DLS'] = 'Текущие активные торренты';
-$lang['CUR_ACTIVE_DLS_ERROR'] = 'Пользователь ничего не скачивает и не сидирует';
-$lang['CUR_ACTIVE_DLS_DISALLOWED'] = 'Пользователь запретил просматривать его активные торренты';
+$lang['CUR_ACTIVE_DLS'] = 'Активные раздачи';
$lang['TD_TRAF'] = 'Сегодня';
$lang['YS_TRAF'] = 'Вчера';
@@ -1559,8 +1558,6 @@ $lang['NOTICE'] = '!ВНИМАНИЕ!';
$lang['POWERED'] = 'UG93ZXJlZCBieSA8YSB0YXJnZXQ9Il9ibGFuayIgaHJlZj0iaHR0cDovL3RvcnJlbnRwaWVyLm1lIj5Ub3JyZW50UGllciBJSTwvYT4gJmNvcHk7IE1laXRoYXIsIFRvcnJlbnRQaWVyIElJIFRlYW0=';
$lang['COPY'] = 'Сайт не предоставляет электронные версии произведений, а занимается лишь коллекционированием и каталогизацией ссылок, присылаемых и публикуемых на форуме нашими читателями. Если вы являетесь правообладателем какого-либо представленного материала и не желаете, чтобы ссылка на него находилась в нашем каталоге, свяжитесь с нами, и мы незамедлительно удалим ее. Файлы для обмена на трекере предоставлены пользователями сайта, и администрация не несет ответственности за их содержание. Просьба не заливать файлы, защищенные авторскими правами, а также файлы нелегального содержания!';
-$lang['CALLSEED'] = 'Позвать скачавших';
-
// FILELIST
$lang['FILELIST'] = 'Список файлов';
$lang['COLLAPSE'] = 'Свернуть директории';
@@ -1742,7 +1739,6 @@ $lang['INDEXER'] = "Переиндексировать поиск";
$lang['FORUM_STYLE'] = 'Стиль форума';
$lang['LINKS_ARE_FORBIDDEN'] = 'Ссылки запрещены';
-$lang['YOU_ARE_BEING_CHEATED'] = 'Похоже, вас пытаются обмануть
Сайт открыт во фрейме. Текущий адрес';
$lang['DONATION'] = 'Помощь трекеру';
@@ -2873,18 +2869,13 @@ $lang['BOT_TOPIC_MOVED_FROM_TO'] = 'Топик был перенесен из ф
$lang['BOT_MESS_SPLITS'] = 'Сообщения из этой темы были выделены в отдельный топик [b]%s[/b][br][br]%s';
$lang['BOT_TOPIC_SPLITS'] = 'Тема была выделена из [b]%s[/b][br][br]%s';
-$lang['CALLSEED_SUBJ'] = 'Помогите скачать %s';
-$lang['CALLSEED_TEXT'] = 'Здравствуйте!
Ваша помощь необходима в раздаче %s :: %s
Если вы решили помочь, но уже удалили торрент-файл, можете скачать его здесь
Надеюсь на вашу помощь!';
-
-$lang['CALLSEED_MSG_OK'] = 'Сообщение (ЛС) успешно отправлено всем скачавшим данный релиз';
-$lang['CALLSEED_MSG_SPAM'] = 'Запрос уже был однажды успешно отослан (возможно не Вами)
-
Следующая возможность отослать запрос будет через %s часов.
- Позвать скачавших можно лишь один раз в сутки';
-$lang['CALLSEED_MSG_MSG'] = 'Ошибка отправки сообщения';
-$lang['CALLSEED_MSG_MSG_TEXT'] = 'Ошибка сохранения текста сообщения';
-$lang['CALLSEED_MSG_POPUP'] = 'Ошибка работы всплывающего окна';
-$lang['CALLSEED_MSG_TIME'] = 'Не удалось установить время последнего запроса';
-$lang['CALLSEED_HAVE_SEED'] = 'Раздача не нуждается в помощи (Сидеров: %d, Личеров: %d)';
+$lang['CALLSEED'] = 'Позвать скачавших';
+$lang['CALLSEED_EXPLAIN'] = 'Принимать уведомления с просьбой вернуться на раздачу?';
+$lang['CALLSEED_SUBJECT'] = 'Помогите скачать %s';
+$lang['CALLSEED_TEXT'] = 'Здравствуйте![br]Ваша помощь необходима в раздаче [url=%s]%s[/url][br]Если Вы решили помочь, но уже удалили торрент-файл, Вы можете скачать его [url=%s]здесь[/url][br][br]Надеюсь на Вашу помощь!';
+$lang['CALLSEED_MSG_OK'] = 'Сообщения успешно отправлены всем скачавшим данный релиз';
+$lang['CALLSEED_MSG_SPAM'] = 'Запрос уже был отправлен (возможно не Вами)
Следующая возможность отправить запрос будет через %s.';
+$lang['CALLSEED_HAVE_SEED'] = 'Раздача не нуждается в помощи (Сидеров: %d)';
$lang['LOG_ACTION']['LOG_TYPE'] = array(
'mod_topic_delete' => 'Топик:
удален',
diff --git a/upload/language/ua/main.php b/upload/language/ua/main.php
index 74333316b..ae5b24c46 100644
--- a/upload/language/ua/main.php
+++ b/upload/language/ua/main.php
@@ -148,7 +148,7 @@ $lang['POSTED_ARTICLES_ZERO_TOTAL'] = 'Наші користувачі не за
$lang['POSTED_ARTICLES_TOTAL'] = 'Наші користувачі залишили повідомлень: %s'; // Number of posts
$lang['REGISTERED_USERS_ZERO_TOTAL'] = 'У нас немає зареєстрованих користувачів'; // # registered users
$lang['REGISTERED_USERS_TOTAL'] = 'Всього зареєстрованих користувачів: %s'; // # registered users
-$lang['USERS_TOTAL_GENDER'] = 'Хлопців: %d, Дівчат: %d, Не зазначено: %d';
+$lang['USERS_TOTAL_GENDER'] = 'Хлопців: %d, Дівчат: %d, Не вказали: %d';
$lang['NEWEST_USER'] = 'Останній зареєстрований користувач: %s'; // username
// Tracker stats
@@ -183,8 +183,7 @@ $lang['USER_WELCOME'] = 'Приємно бачити вас, ';
// Index page
//
$lang['HOME'] = 'Головна';
-$lang['NO_POSTS'] = 'Немає повідомлень';
-$lang['NO_FORUMS'] = 'На цьому сайті немає форумів';
+$lang['NO_FORUMS'] = 'Немає доступних для показу форумів';
$lang['PRIVATE_MESSAGE'] = 'Приватне повідомлення';
$lang['PRIVATE_MESSAGES'] = 'Приватні повідомлення';
@@ -508,6 +507,7 @@ $lang['OUTBOX_EXPL'] = 'В папці Вихідні знаходятьс
// Profiles/Registration
//
$lang['VIEWING_USER_PROFILE'] = 'Профіль користувача %s';
+$lang['VIEWING_MY_PROFILE'] = 'Мій профіль [ Налаштування / Змінити профіль ]';
$lang['DISABLED_USER'] = 'Користувача деактивовано';
$lang['MANAGE_USER'] = 'Адміністрування';
@@ -555,7 +555,7 @@ $lang['ALWAYS_NOTIFY_EXPLAIN'] = 'Коли хто-небудь відповіс
$lang['BOARD_LANG'] = 'Мова';
$lang['GENDER'] = 'Стать';
$lang['GENDER_SELECT'] = array(
- 0 => 'Не визначилося',
+ 0 => 'Не вказаний',
1 => 'Чоловічий',
2 => 'Жіночий'
);
@@ -589,7 +589,7 @@ $lang['PUBLIC_VIEW_EMAIL'] = 'Показувати мою адресу e-mail в
$lang['EMAIL_EXPLAIN'] = 'На цю адресу вам буде відіслано лист для завершення реєстрації';
$lang['CURRENT_PASSWORD'] = 'Поточний пароль';
-$lang['NEW_PASSWORD'] = 'Новий пароль';
+$lang['NEW_PASSWORD'] = "Новий пароль\n";
$lang['CONFIRM_PASSWORD'] = 'Підтвердіть пароль';
$lang['CONFIRM_PASSWORD_EXPLAIN'] = 'Ви повинні вказати ваш поточний пароль, якщо хочете змінити його або змінити свій email.';
$lang['PASSWORD_IF_CHANGED'] = 'Вказуйте свій пароль, якщо ви хочете його змінити';
@@ -601,7 +601,7 @@ $lang['RESET_AUTOLOGIN_EXPL'] = 'включаючи всі місця, де ви
$lang['AVATAR'] = 'Аватар';
$lang['AVATAR_EXPLAIN'] = "Показує невелике зображення під інформацією про вас в повідомленнях. Може бути показано тільки одне зображення, шириною не більше %d пікселів, висотою не більше %d пікселів і об'ємом не більше %d кб.";
-$lang['UPLOAD_AVATAR_FILE'] = "Завантажити аватару з вашого комп'ютера";
+$lang['UPLOAD_AVATAR_FILE'] = "Завантажити аватару";
$lang['SELECT_AVATAR'] = 'Виберіть аватару';
$lang['RETURN_PROFILE'] = 'Повернутися до профілю';
@@ -1161,8 +1161,8 @@ $lang['SPEED_DOWN'] = 'Швидкість завантаження';
$lang['SEEDERS'] = 'Сидів';
$lang['LEECHERS'] = 'Лічерів';
$lang['RELEASING'] = 'Свої';
-$lang['SEEDING'] = 'Роздає';
-$lang['LEECHING'] = 'Качає';
+$lang['SEEDING'] = 'Сідер';
+$lang['LEECHING'] = 'Лічер';
$lang['IS_REGISTERED'] = 'Зареєстрований';
$lang['MAGNET'] = 'Magnet';
@@ -1317,9 +1317,7 @@ $lang['NOT_TORRENT'] = 'Це не торрент-файл';
$lang['ONLY_1_TOR_PER_POST'] = 'Ви не можете зареєструвати ще один торрент для цього повідомлення';
$lang['ONLY_1_TOR_PER_TOPIC'] = 'Ви не можете зареєструвати ще один торрент для цього топіка';
$lang['VIEWING_USER_BT_PROFILE'] = 'Торрент-профіль'; // %s username is
-$lang['CUR_ACTIVE_DLS'] = 'Поточні активні торренти';
-$lang['CUR_ACTIVE_DLS_ERROR'] = 'Користувач нічого не завантажує і не сидирует';
-$lang['CUR_ACTIVE_DLS_DISALLOWED'] = 'Користувач заборонив переглядати його активні торренти';
+$lang['CUR_ACTIVE_DLS'] = 'Активні роздачі';
$lang['TD_TRAF'] = 'Сьогодні';
$lang['YS_TRAF'] = 'Вчора';
@@ -1557,8 +1555,6 @@ $lang['NOTICE'] = '!УВАГА!';
$lang['POWERED'] = 'UG93ZXJlZCBieSA8YSB0YXJnZXQ9Il9ibGFuayIgaHJlZj0iaHR0cDovL3RvcnJlbnRwaWVyLm1lIj5Ub3JyZW50UGllciBJSTwvYT4gJmNvcHk7IE1laXRoYXIsIFRvcnJlbnRQaWVyIElJIFRlYW0=';
$lang['COPY'] = "Сайт не надає електронні версії творів, а займається лише колекціонуванням і каталогізацією посилань, що присилаються та публікуються на форумі нашими читачами. Якщо ви є правовласником якого-небудь представленого матеріалу і не бажаєте щоб посилання на нього знаходилася в нашому каталозі, зв'яжіться з нами і ми негайно видалимо її. Файли для обміну на трекері надані користувачами сайту, і адміністрація не несе відповідальності за їх зміст. Прохання не заливати файли, захищені авторськими правами, а також файли нелегального змісту!";
-$lang['CALLSEED'] = 'Покликати, кто завантажил';
-
// FILELIST
$lang['FILELIST'] = 'Список файлів';
$lang['COLLAPSE'] = 'Згорнути директорії';
@@ -1740,7 +1736,6 @@ $lang['INDEXER'] = "Переіндексувати пошук";
$lang['FORUM_STYLE'] = 'Стиль форуму';
$lang['LINKS_ARE_FORBIDDEN'] = 'Посилання заборонені';
-$lang['YOU_ARE_BEING_CHEATED'] = 'Схоже, вас намагаються обдурити
Сайт відкритий у фреймі. Поточна адреса';
$lang['DONATION'] = 'Допомога трекеру';
@@ -2871,18 +2866,13 @@ $lang['BOT_TOPIC_MOVED_FROM_TO'] = 'Топік був перенесений з
$lang['BOT_MESS_SPLITS'] = 'Повідомлення з цієї теми були виділені в окремий топік [b]%s[/b][br][br]%s';
$lang['BOT_TOPIC_SPLITS'] = 'Тема була виділена з [b]%s[/b][br][br]%s';
-$lang['CALLSEED_SUBJ'] = 'Допоможіть завантажити %s';
-$lang['CALLSEED_TEXT'] = 'Привіт!
Ваша допомога необхідна в роздачі %s:% s
Якщо ви вирішили допомогти, але вже видалили торрент-файл, можете завантажити його тут
Сподіваюся на вашу допомогу!';
-
-$lang['CALLSEED_MSG_OK'] = 'Повідомлення (ОП) успішно відправлено всім скачавшим даний реліз';
-$lang['CALLSEED_MSG_SPAM'] = 'Запит вже одного разу успішно надісланий (можливо не Вами)
-
Наступна можливість відіслати запит буде через %s годин.
-Покликати тих, хто завантажив, можна лише один раз у добу';
-$lang['CALLSEED_MSG_MSG'] = 'Помилка відправки повідомлення';
-$lang['CALLSEED_MSG_MSG_TEXT'] = 'Помилка збереження тексту повідомлення';
-$lang['CALLSEED_MSG_POPUP'] = 'Помилка роботи спливаючого вікна';
-$lang['CALLSEED_MSG_TIME'] = 'Не вдалося встановити час останнього запиту';
-$lang['CALLSEED_HAVE_SEED'] = 'Роздача не потребує допомоги (Сидерів: %d Лічерів: %d)';
+$lang['CALLSEED'] = 'Покликати, кто завантажил';
+$lang['CALLSEED_EXPLAIN'] = 'Приймати повідомлення з проханням повернутися на роздачу?';
+$lang['CALLSEED_SUBJECT'] = 'Допоможіть завантажити %s';
+$lang['CALLSEED_TEXT'] = 'Привіт![br]Ваша допомога необхідна в роздачі [url=%s]%s[/url][br]Якщо ви вирішили допомогти, але вже видалили торрент-файл, можете завантажити його [url=%s]здесь[/url][br][br]Сподіваюся на вашу допомогу!';
+$lang['CALLSEED_MSG_OK'] = 'Повідомлення успішно відправлено всім скачавшим даний реліз';
+$lang['CALLSEED_MSG_SPAM'] = 'Запит вже одного разу успішно надісланий (можливо не Вами)
Наступна можливість відіслати запит буде через %s.';
+$lang['CALLSEED_HAVE_SEED'] = 'Роздача не потребує допомоги (Сидерів: %d)';
$lang['LOG_ACTION']['LOG_TYPE'] = array(
'mod_topic_delete' => 'Топік:
видалений',
diff --git a/upload/memberlist.php b/upload/memberlist.php
index 83f5df5da..1b579990d 100644
--- a/upload/memberlist.php
+++ b/upload/memberlist.php
@@ -171,7 +171,7 @@ if ($result = DB()->fetch_rowset($sql))
$posts = $row['user_posts'];
$pm = ($bb_cfg['text_buttons']) ? ''. $lang['SEND_PM_TXTB'] .'' : '
';
- if (bf($row['user_opt'], 'user_opt', 'viewemail') || IS_AM)
+ if (bf($row['user_opt'], 'user_opt', 'user_viewemail') || IS_AM)
{
$email_uri = ($bb_cfg['board_email_form']) ? ("profile.php?mode=email&". POST_USERS_URL ."=$user_id") : 'mailto:'. $row['user_email'];
$email = ''. $row['user_email'] .'';
diff --git a/upload/posting.php b/upload/posting.php
index ae712f752..a045cfd4e 100644
--- a/upload/posting.php
+++ b/upload/posting.php
@@ -49,7 +49,7 @@ switch ($mode)
{
case 'newtopic':
case 'new_rel':
- if (bf($userdata['user_opt'], 'user_opt', 'allow_topic'))
+ if (bf($userdata['user_opt'], 'user_opt', 'dis_topic'))
{
bb_die($lang['RULES_POST_CANNOT']);
}
@@ -69,7 +69,7 @@ switch ($mode)
case 'reply':
case 'quote':
- if (bf($userdata['user_opt'], 'user_opt', 'allow_post'))
+ if (bf($userdata['user_opt'], 'user_opt', 'dis_post'))
{
bb_die($lang['RULES_REPLY_CANNOT']);
}
@@ -77,7 +77,7 @@ switch ($mode)
break;
case 'editpost':
- if (bf($userdata['user_opt'], 'user_opt', 'allow_post_edit'))
+ if (bf($userdata['user_opt'], 'user_opt', 'dis_post_edit'))
{
bb_die($lang['RULES_EDIT_CANNOT']);
}
@@ -270,7 +270,7 @@ if ($submit || $refresh)
}
else
{
- $notify_user = bf($userdata['user_opt'], 'user_opt', 'notify');
+ $notify_user = bf($userdata['user_opt'], 'user_opt', 'user_notify');
if (!IS_GUEST && $mode != 'newtopic' && !$notify_user)
{
diff --git a/upload/privmsg.php b/upload/privmsg.php
index 4f5b60c2a..f140b4f34 100644
--- a/upload/privmsg.php
+++ b/upload/privmsg.php
@@ -991,7 +991,7 @@ else if ( $submit || $refresh || $mode != '' )
//
// Has admin prevented user from sending PM's?
//
- if ( bf($userdata['user_opt'], 'user_opt', 'allow_pm') )
+ if (bf($userdata['user_opt'], 'user_opt', 'dis_pm'))
{
bb_die($lang['CANNOT_SEND_PRIVMSG']);
}
@@ -1101,7 +1101,7 @@ else if ( $submit || $refresh || $mode != '' )
cache_rm_user_sessions ($to_userdata['user_id']);
- if ( bf($to_userdata['user_opt'], 'user_opt', 'notify_pm') && !empty($to_userdata['user_email']) && $to_userdata['user_active'] && $bb_cfg['pm_notify_enabled'] )
+ if (bf($to_userdata['user_opt'], 'user_opt', 'user_notify_pm') && $to_userdata['user_active'] && $bb_cfg['pm_notify_enabled'])
{
require(INC_DIR .'emailer.class.php');
$emailer = new emailer($bb_cfg['smtp_delivery']);
@@ -1116,7 +1116,7 @@ else if ( $submit || $refresh || $mode != '' )
'NAME_FROM' => $userdata['username'],
'MSG_SUBJECT' => html_entity_decode($privmsg_subject),
'SITENAME' => $bb_cfg['sitename'],
- 'U_INBOX' => make_url(PM_URL . "?folder=inbox&mode=read&p=". $privmsg_sent_id),
+ 'U_INBOX' => make_url(PM_URL ."?folder=inbox&mode=read&p=$privmsg_sent_id"),
));
$emailer->send();
@@ -1136,7 +1136,7 @@ else if ( $submit || $refresh || $mode != '' )
$to_username = (isset($_POST['username']) ) ? clean_username($_POST['username']) : '';
$privmsg_subject = ( isset($_POST['subject']) ) ? clean_title($_POST['subject']) : '';
- $privmsg_message = ( isset($_POST['message']) ) ? trim($_POST['message']) : '';
+ $privmsg_message = ( isset($_POST['message']) ) ? prepare_message($_POST['message']) : '';
//
// Do mode specific things
@@ -1269,7 +1269,7 @@ else if ( $submit || $refresh || $mode != '' )
//
// Has admin prevented user from sending PM's?
//
- if ( bf($userdata['user_opt'], 'user_opt', 'allow_pm') && $mode != 'edit' )
+ if (bf($userdata['user_opt'], 'user_opt', 'dis_pm') && $mode != 'edit')
{
$message = ($lang['CANNOT_SEND_PRIVMSG']);
}
@@ -1429,8 +1429,7 @@ else
'body' => 'privmsgs.tpl')
);
- $orig_word = array();
- $replacement_word = array();
+ $orig_word = $replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
//
diff --git a/upload/templates/default/css/main.css b/upload/templates/default/css/main.css
index 709051300..48efe1052 100644
--- a/upload/templates/default/css/main.css
+++ b/upload/templates/default/css/main.css
@@ -79,7 +79,7 @@ body, th, td, font {
position: relative; width: 100%;
}
#page_content {
- padding: 12px 4px 0; margin: 0 auto;
+ padding: 12px 10px 0; margin: 0 auto;
clear: both; position: relative;
}
#sidebar1 {}
@@ -412,7 +412,7 @@ table.forumline {
.forumline th {
border: 1px solid #B7C0C5; border-width: 1px; border-top-color: #92A3A4;
padding: 6px 3px 4px; color: #000000; background-color: #CFD4D8;
- font-size: 10px; text-transform: uppercase;
+ font-size: 9px !important; text-transform: uppercase;
}
.forumline td {
border: 1px solid #B7C0C5; border-width: 0 1px 1px;
diff --git a/upload/templates/default/index.tpl b/upload/templates/default/index.tpl
index b10509e7c..08294e66e 100644
--- a/upload/templates/default/index.tpl
+++ b/upload/templates/default/index.tpl
@@ -46,13 +46,12 @@
-
-
{L_HIDE_CAT_MESS}
-
+
+
@@ -142,7 +141,7 @@
-
+
diff --git a/upload/templates/default/page_header.tpl b/upload/templates/default/page_header.tpl
index b633a5b22..463c206b5 100644
--- a/upload/templates/default/page_header.tpl
+++ b/upload/templates/default/page_header.tpl
@@ -225,17 +225,6 @@ function go_to_page ()
-
-
@@ -243,6 +232,15 @@ if (top != self) {