mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 21:33:54 -07:00
r381
ALTER TABLE `bb_posts` ADD `user_post` TINYINT( 1 ) NOT NULL DEFAULT '1'; мои сообщения аля рутрекер (часть 1) git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@381 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
cb1e567f6e
commit
85c0ee4559
5 changed files with 15 additions and 13 deletions
|
@ -917,6 +917,7 @@ CREATE TABLE `bb_posts` (
|
||||||
`post_edit_count` smallint(5) unsigned NOT NULL default '0',
|
`post_edit_count` smallint(5) unsigned NOT NULL default '0',
|
||||||
`post_attachment` tinyint(1) NOT NULL default '0',
|
`post_attachment` tinyint(1) NOT NULL default '0',
|
||||||
`post_reported` tinyint(1) NOT NULL default '0',
|
`post_reported` tinyint(1) NOT NULL default '0',
|
||||||
|
`user_post` tinyint(1) NOT NULL default '1',
|
||||||
PRIMARY KEY (`post_id`),
|
PRIMARY KEY (`post_id`),
|
||||||
KEY `topic_id` (`topic_id`),
|
KEY `topic_id` (`topic_id`),
|
||||||
KEY `poster_id` (`poster_id`),
|
KEY `poster_id` (`poster_id`),
|
||||||
|
@ -928,7 +929,7 @@ CREATE TABLE `bb_posts` (
|
||||||
-- Дамп данных таблицы `bb_posts`
|
-- Дамп данных таблицы `bb_posts`
|
||||||
--
|
--
|
||||||
|
|
||||||
INSERT INTO `bb_posts` VALUES (1, 1, 1, 2, 1309421220, '', '', 0, 0, 0, 0);
|
INSERT INTO `bb_posts` VALUES (1, 1, 1, 2, 1309421220, '', '', 0, 0, 0, 0, 1);
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ define('TOR_TYPE_GOLD', 1);
|
||||||
define('TOR_TYPE_SILVER', 2);
|
define('TOR_TYPE_SILVER', 2);
|
||||||
|
|
||||||
define('ANONYMOUS', -1);
|
define('ANONYMOUS', -1);
|
||||||
|
define('BOT_UID', -746);
|
||||||
|
|
||||||
// DBS
|
// DBS
|
||||||
class DBS
|
class DBS
|
||||||
|
|
|
@ -52,8 +52,8 @@ $bb_cfg = $tr_cfg = $page_cfg = array();
|
||||||
|
|
||||||
// Increase number of revision after update
|
// Increase number of revision after update
|
||||||
$bb_cfg['tp_version'] = '2.4 (beta)';
|
$bb_cfg['tp_version'] = '2.4 (beta)';
|
||||||
$bb_cfg['tp_release_state'] = 'R380';
|
$bb_cfg['tp_release_state'] = 'R381';
|
||||||
$bb_cfg['tp_release_date'] = '04-03-2012';
|
$bb_cfg['tp_release_date'] = '06-03-2012';
|
||||||
|
|
||||||
// Database
|
// Database
|
||||||
$charset = 'utf8';
|
$charset = 'utf8';
|
||||||
|
@ -474,8 +474,6 @@ $bb_cfg['ad_blocks'] = array(
|
||||||
);
|
);
|
||||||
|
|
||||||
// Misc
|
// Misc
|
||||||
define('BOT_UID', -746);
|
|
||||||
|
|
||||||
define('LOADAVG', function_exists('get_loadavg') ? get_loadavg() : 0);
|
define('LOADAVG', function_exists('get_loadavg') ? get_loadavg() : 0);
|
||||||
define('MEM_USAGE', function_exists('memory_get_usage'));
|
define('MEM_USAGE', function_exists('memory_get_usage'));
|
||||||
|
|
||||||
|
|
|
@ -1209,7 +1209,8 @@ function get_bt_userdata ($user_id)
|
||||||
return DB()->fetch_row("SELECT bt.*, SUM(tr.speed_up) as speed_up, SUM(tr.speed_down) as speed_down
|
return DB()->fetch_row("SELECT bt.*, SUM(tr.speed_up) as speed_up, SUM(tr.speed_down) as speed_down
|
||||||
FROM ". BB_BT_USERS ." bt
|
FROM ". BB_BT_USERS ." bt
|
||||||
LEFT JOIN ". BB_BT_TRACKER ." tr ON (bt.user_id = tr.user_id)
|
LEFT JOIN ". BB_BT_TRACKER ." tr ON (bt.user_id = tr.user_id)
|
||||||
WHERE bt.user_id = ". (int) $user_id);
|
WHERE bt.user_id = ". (int) $user_id ."
|
||||||
|
GROUP BY bt.user_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_bt_ratio ($btu)
|
function get_bt_ratio ($btu)
|
||||||
|
|
|
@ -618,6 +618,7 @@ else
|
||||||
if ($new_topics) $SQL['WHERE'][] = "t.topic_time > $lastvisit";
|
if ($new_topics) $SQL['WHERE'][] = "t.topic_time > $lastvisit";
|
||||||
if ($prev_days) $SQL['WHERE'][] = "$tbl.$time_field > ". $time_opt[$time_val]['sql'];
|
if ($prev_days) $SQL['WHERE'][] = "$tbl.$time_field > ". $time_opt[$time_val]['sql'];
|
||||||
if ($my_posts) $SQL['WHERE'][] = "p.poster_id = $poster_id_val";
|
if ($my_posts) $SQL['WHERE'][] = "p.poster_id = $poster_id_val";
|
||||||
|
if ($my_posts && $user->id == $poster_id_val) $SQL['WHERE'][] = "p.user_post = 1";
|
||||||
if ($my_topics) $SQL['WHERE'][] = "t.topic_poster = $poster_id_val";
|
if ($my_topics) $SQL['WHERE'][] = "t.topic_poster = $poster_id_val";
|
||||||
|
|
||||||
if ($text_match_sql)
|
if ($text_match_sql)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue