mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -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_attachment` 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`),
|
||||
KEY `topic_id` (`topic_id`),
|
||||
KEY `poster_id` (`poster_id`),
|
||||
|
@ -928,7 +929,7 @@ CREATE TABLE `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('ANONYMOUS', -1);
|
||||
define('BOT_UID', -746);
|
||||
|
||||
// DBS
|
||||
class DBS
|
||||
|
@ -1762,7 +1763,7 @@ switch ($bb_cfg['datastore_type'])
|
|||
case 'apc':
|
||||
$datastore = new datastore_apc();
|
||||
break;
|
||||
|
||||
|
||||
case 'filecache':
|
||||
default: $datastore = new datastore_file($bb_cfg['cache']['db_dir'] . 'datastore/');
|
||||
}
|
||||
|
|
|
@ -52,8 +52,8 @@ $bb_cfg = $tr_cfg = $page_cfg = array();
|
|||
|
||||
// Increase number of revision after update
|
||||
$bb_cfg['tp_version'] = '2.4 (beta)';
|
||||
$bb_cfg['tp_release_state'] = 'R380';
|
||||
$bb_cfg['tp_release_date'] = '04-03-2012';
|
||||
$bb_cfg['tp_release_state'] = 'R381';
|
||||
$bb_cfg['tp_release_date'] = '06-03-2012';
|
||||
|
||||
// Database
|
||||
$charset = 'utf8';
|
||||
|
@ -474,8 +474,6 @@ $bb_cfg['ad_blocks'] = array(
|
|||
);
|
||||
|
||||
// Misc
|
||||
define('BOT_UID', -746);
|
||||
|
||||
define('LOADAVG', function_exists('get_loadavg') ? get_loadavg() : 0);
|
||||
define('MEM_USAGE', function_exists('memory_get_usage'));
|
||||
|
||||
|
|
|
@ -1206,10 +1206,11 @@ function wbr ($text, $max_word_length = HTML_WBR_LENGTH)
|
|||
|
||||
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
|
||||
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)
|
||||
|
@ -1224,7 +1225,7 @@ function get_bt_ratio ($btu)
|
|||
function show_bt_userdata ($user_id)
|
||||
{
|
||||
global $lang;
|
||||
|
||||
|
||||
$btu = get_bt_userdata($user_id);
|
||||
|
||||
$GLOBALS['template']->assign_vars(array(
|
||||
|
@ -2731,13 +2732,13 @@ function create_magnet($infohash, $auth_key, $logged_in)
|
|||
function get_avatar ($avatar, $type, $allow_avatar = true, $height = '', $width = '')
|
||||
{
|
||||
global $bb_cfg, $lang;
|
||||
|
||||
|
||||
$height = ($height != '') ? 'height="'. $height .'"' : '';
|
||||
$width = ($width != '') ? 'width="'. $width .'"' : '';
|
||||
|
||||
|
||||
$user_avatar = '<img src="'. $bb_cfg['no_avatar'] .'" alt="" border="0" '. $height .' '. $width .' />';
|
||||
|
||||
|
||||
|
||||
|
||||
if ($allow_avatar)
|
||||
{
|
||||
switch($type)
|
||||
|
|
|
@ -618,6 +618,7 @@ else
|
|||
if ($new_topics) $SQL['WHERE'][] = "t.topic_time > $lastvisit";
|
||||
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 && $user->id == $poster_id_val) $SQL['WHERE'][] = "p.user_post = 1";
|
||||
if ($my_topics) $SQL['WHERE'][] = "t.topic_poster = $poster_id_val";
|
||||
|
||||
if ($text_match_sql)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue