mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
r391
обновление дампера для TBDev фиксы недочетов git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@391 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
3b7f9034b4
commit
5982453a9e
16 changed files with 153 additions and 170 deletions
|
@ -311,7 +311,7 @@ CREATE TABLE IF NOT EXISTS `bb_bt_last_torstat` (
|
|||
`bonus_add` bigint(20) unsigned NOT NULL DEFAULT '0',
|
||||
`speed_up` bigint(20) unsigned NOT NULL DEFAULT '0',
|
||||
`speed_down` bigint(20) unsigned NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`topic_id`,`user_id`) USING BTREE
|
||||
PRIMARY KEY USING BTREE (`topic_id`,`user_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
|
|
@ -6,10 +6,10 @@ define ('USER_ID_DIFF', 1); // User_id difference between TP and TBDev (tp_user_
|
|||
|
||||
// TorrentPier Database
|
||||
$dbhost = 'localhost';
|
||||
$dbname = 'torrentpier';
|
||||
$dbuser = 'root';
|
||||
$dbpasswd = 'root';
|
||||
$dbcharset = 'cp1251';
|
||||
$dbname = 'dbase';
|
||||
$dbuser = 'user';
|
||||
$dbpasswd = 'pass';
|
||||
$dbcharset = 'utf8';
|
||||
|
||||
// Start announce
|
||||
define ('IN_ANNOUNCE', true);
|
||||
|
@ -60,5 +60,3 @@ unset($res, $user, $dbpasswd, $passkey, $user_id);
|
|||
// Execute TP's announce
|
||||
chdir(TP_ROOT .'bt/');
|
||||
require ('announce.php');
|
||||
|
||||
?>
|
|
@ -7,13 +7,13 @@ dbconn();
|
|||
loggedinorreturn();
|
||||
|
||||
$new_tr_url = "http://pushchino.tv/forum/"; // with ending slash
|
||||
$subject = "Переезд на новый движок";
|
||||
$msg = '[b]Внимание![/b] Наш трекер переехал на новый движок! Адрес трекера - [url='.$new_tr_url.']'.$new_tr_url.'[/url]
|
||||
Вся база перенесена на новый движок, регистрироваться заново не надо.
|
||||
Войти на трекер можно [url='.$new_tr_url.'login.php]здесь[/url]. Ваши данные на новом трекере:
|
||||
[b]Логин:[/b] %s
|
||||
[b]Пароль:[/b] %s
|
||||
Сменить пароль можно после входа на трекер в [url='.$new_tr_url.'profile.php?mode=editprofile]настройках[/url].';
|
||||
$subject = "Переезд на новый движок";
|
||||
$msg = '[b]Внимание![/b] Наш трекер переехал на новый движок! Адрес трекера - [url='.$new_tr_url.']'.$new_tr_url.'[/url]
|
||||
Вся база перенесена на новый движок, регистрироваться заново не надо.
|
||||
Войти на трекер можно [url='.$new_tr_url.'login.php]здесь[/url]. Ваши данные на новом трекере:
|
||||
[b]Логин:[/b] %s
|
||||
[b]Пароль:[/b] %s
|
||||
Сменить пароль можно после входа на трекер в [url='.$new_tr_url.'profile.php?mode=editprofile]настройках[/url].';
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2,10 +2,11 @@
|
|||
|
||||
define ('IN_PHPBB', true);
|
||||
define ('IN_SERVICE', true);
|
||||
require ("./common.php");
|
||||
require ("./converter/constants.php");
|
||||
require ("./converter/settings.php");
|
||||
require ("./converter/functions.php");
|
||||
define ('BB_ROOT', './');
|
||||
require (BB_ROOT .'common.php');
|
||||
require (BB_ROOT .'converter/constants.php');
|
||||
require (BB_ROOT .'converter/settings.php');
|
||||
require (BB_ROOT .'converter/functions.php');
|
||||
|
||||
// Start session management
|
||||
$user->session_start();
|
||||
|
@ -17,10 +18,11 @@ ob_implicit_flush();
|
|||
error_reporting(E_ALL);
|
||||
@ini_set('display_errors', 1);
|
||||
|
||||
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<title></title>
|
||||
</head>
|
||||
|
@ -57,7 +59,7 @@ if (CONVERT_USERS)
|
|||
print_ok ("Users cleared");
|
||||
}
|
||||
|
||||
$max_uid = (int) get_max_val(USERS_TABLE, 'user_id');
|
||||
$max_uid = (int) get_max_val(BB_USERS, 'user_id');
|
||||
$max_uid = ($max_uid > 1) ? $max_uid : 1;
|
||||
|
||||
$users_count = (int) get_count(TB_USERS_TABLE, 'id');
|
||||
|
@ -89,8 +91,8 @@ if (CONVERT_USERS)
|
|||
ORDER BY id
|
||||
LIMIT $start, $offset";
|
||||
|
||||
$users = $db->fetch_rowset($sql);
|
||||
$db->sql_freeresult();
|
||||
$users = DB()->fetch_rowset($sql);
|
||||
DB()->sql_freeresult();
|
||||
|
||||
foreach ($users as $user)
|
||||
{
|
||||
|
@ -109,7 +111,7 @@ if (CONVERT_USERS)
|
|||
$to_write .= '$passwords = '. var_export($pass, true) .';';
|
||||
fwrite($passf, $to_write);
|
||||
fclose($passf);
|
||||
set_auto_increment(USERS_TABLE, 'user_id');
|
||||
set_auto_increment(BB_USERS, 'user_id');
|
||||
|
||||
print_ok ("Total $users_count users from TBDev converted");
|
||||
unset($users, $pass, $to_write);
|
||||
|
@ -117,8 +119,8 @@ if (CONVERT_USERS)
|
|||
|
||||
if (CONVERT_TORRENTS)
|
||||
{
|
||||
require_once('./includes/functions_post.php');
|
||||
require_once('./includes/bbcode.php');
|
||||
require_once(INC_DIR .'functions_post.php');
|
||||
require_once(INC_DIR .'bbcode.php');
|
||||
|
||||
if (CLEAN)
|
||||
{
|
||||
|
@ -131,7 +133,7 @@ if (CONVERT_TORRENTS)
|
|||
$max_uid = !empty($max_uid) ? $max_uid : 1;
|
||||
|
||||
//Create a category for torrents
|
||||
$max_cat_id = (int) get_max_val(CATEGORIES_TABLE, 'cat_id');
|
||||
$max_cat_id = (int) get_max_val(BB_CATEGORIES, 'cat_id');
|
||||
$tr_cat_id = $max_cat_id + 1;
|
||||
|
||||
$tp_cat_data = array(
|
||||
|
@ -139,13 +141,13 @@ if (CONVERT_TORRENTS)
|
|||
"cat_title" => 'Tracker',
|
||||
);
|
||||
tp_add_category($tp_cat_data);
|
||||
set_auto_increment(CATEGORIES_TABLE, 'cat_id');
|
||||
set_auto_increment(BB_CATEGORIES, 'cat_id');
|
||||
unset($tp_cat_data);
|
||||
|
||||
$cats = $db->fetch_rowset("SELECT id, sort, name FROM ". TB_CATEGORIES_TABLE);
|
||||
$db->sql_freeresult();
|
||||
DB()->sql_freeresult();
|
||||
|
||||
$max_forum_id = (int) get_max_val(FORUMS_TABLE, 'forum_id');
|
||||
$max_forum_id = (int) get_max_val(BB_FORUMS, 'forum_id');
|
||||
|
||||
foreach ($cats as $cat)
|
||||
{
|
||||
|
@ -153,7 +155,7 @@ if (CONVERT_TORRENTS)
|
|||
$cat['cat_id'] = $tr_cat_id;
|
||||
convert_cat($cat);
|
||||
}
|
||||
set_auto_increment(FORUMS_TABLE, 'forum_id');
|
||||
set_auto_increment(BB_FORUMS, 'forum_id');
|
||||
print_ok ("Categories from TBDev converted");
|
||||
unset($cats);
|
||||
|
||||
|
@ -173,9 +175,9 @@ if (CONVERT_TORRENTS)
|
|||
break;
|
||||
}
|
||||
|
||||
$max_topic_id = (int) get_max_val(TOPICS_TABLE, 'topic_id');
|
||||
$max_post_id = (int) get_max_val(POSTS_TABLE, 'post_id');
|
||||
$max_attach_id = (int) get_max_val(ATTACHMENTS_TABLE, 'attach_id');
|
||||
$max_topic_id = (int) get_max_val(BB_TOPICS, 'topic_id');
|
||||
$max_post_id = (int) get_max_val(BB_POSTS, 'post_id');
|
||||
$max_attach_id = (int) get_max_val(BB_ATTACHMENTS, 'attach_id');
|
||||
|
||||
$torrents_count = (int) get_count(TB_TORRENTS_TABLE, 'id');
|
||||
$loops = (int) ceil($torrents_count / C_TORRENTS_PER_ONCE);
|
||||
|
@ -193,8 +195,8 @@ if (CONVERT_TORRENTS)
|
|||
ORDER BY id
|
||||
LIMIT $start, $offset";
|
||||
|
||||
$torrents = $db->fetch_rowset($sql);
|
||||
$db->sql_freeresult();
|
||||
$torrents = DB()->fetch_rowset($sql);
|
||||
DB()->sql_freeresult();
|
||||
|
||||
foreach ($torrents as $torrent)
|
||||
{
|
||||
|
@ -207,16 +209,16 @@ if (CONVERT_TORRENTS)
|
|||
//print_r($torrent);
|
||||
}
|
||||
}
|
||||
set_auto_increment(TOPICS_TABLE, 'topic_id');
|
||||
set_auto_increment(POSTS_TABLE, 'post_id');
|
||||
set_auto_increment(BB_TOPICS, 'topic_id');
|
||||
set_auto_increment(BB_POSTS, 'post_id');
|
||||
print_ok ("Total $torrents_count torrents from TBDev converted");
|
||||
unset($torrents);
|
||||
|
||||
if (CONVERT_COMMENTS)
|
||||
{
|
||||
$max_post_id = (int) get_max_val(POSTS_TABLE, 'post_id');
|
||||
$max_topic_id = (int) get_max_val(TOPICS_TABLE, 'topic_id');
|
||||
$max_attach_id = (int) get_max_val(ATTACHMENTS_TABLE, 'attach_id');
|
||||
$max_post_id = (int) get_max_val(BB_POSTS, 'post_id');
|
||||
$max_topic_id = (int) get_max_val(BB_TOPICS, 'topic_id');
|
||||
$max_attach_id = (int) get_max_val(BB_ATTACHMENTS, 'attach_id');
|
||||
|
||||
$comments_count = (int) get_count(TB_COMMENTS_TABLE, 'id');
|
||||
$loops = (int) ceil($comments_count / C_COMMENTS_PER_ONCE);
|
||||
|
@ -235,8 +237,8 @@ if (CONVERT_TORRENTS)
|
|||
ORDER BY c.id
|
||||
LIMIT $start, $offset";
|
||||
|
||||
$comments = $db->fetch_rowset($sql);
|
||||
$db->sql_freeresult();
|
||||
$comments = DB()->fetch_rowset($sql);
|
||||
DB()->sql_freeresult();
|
||||
|
||||
foreach ($comments as $comment)
|
||||
{
|
||||
|
@ -246,7 +248,7 @@ if (CONVERT_TORRENTS)
|
|||
}
|
||||
}
|
||||
unset($comments);
|
||||
set_auto_increment(POSTS_TABLE, 'post_id');
|
||||
set_auto_increment(BB_POSTS, 'post_id');
|
||||
print_ok ("Total $comments_count comments from TBDev converted");
|
||||
}
|
||||
}
|
||||
|
@ -262,4 +264,4 @@ if (CONVERT_MYBB_FORUMS)
|
|||
Converting completed.
|
||||
</body>
|
||||
</html>
|
||||
<? } ?>
|
||||
<?php } ?>
|
|
@ -21,51 +21,43 @@ function hex2bin($h)
|
|||
}
|
||||
|
||||
function get_max_val($table_name, $column)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$row = $db->fetch_row("SELECT MAX($column) AS $column FROM $table_name LIMIT 1");
|
||||
{
|
||||
$row = DB()->fetch_row("SELECT MAX($column) AS $column FROM $table_name LIMIT 1");
|
||||
return $row[$column];
|
||||
}
|
||||
|
||||
function get_count($table_name, $column)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$row = $db->fetch_row("SELECT COUNT($column) AS $column FROM $table_name LIMIT 1");
|
||||
$row = DB()->fetch_row("SELECT COUNT($column) AS $column FROM $table_name LIMIT 1");
|
||||
return $row[$column];
|
||||
}
|
||||
|
||||
function set_auto_increment($table_name, $column, $val = null)
|
||||
{
|
||||
global $db;
|
||||
|
||||
if (empty($val))
|
||||
{
|
||||
$row = $db->fetch_row("SELECT MAX($column) AS val FROM $table_name LIMIT 1");
|
||||
$db->sql_freeresult();
|
||||
$row = DB()->fetch_row("SELECT MAX($column) AS val FROM $table_name LIMIT 1");
|
||||
DB()->sql_freeresult();
|
||||
$val = (int) $row['val'] + 1;
|
||||
}
|
||||
$db->query("ALTER TABLE $table_name auto_increment = $val");
|
||||
DB()->query("ALTER TABLE $table_name auto_increment = $val");
|
||||
}
|
||||
|
||||
//Users functions
|
||||
function tp_users_cleanup()
|
||||
{
|
||||
global $db;
|
||||
|
||||
/*
|
||||
if (!function_exists('user_delete')) require_once('./includes/functions_admin.php');
|
||||
if (!function_exists('user_delete')) require_once(INC_DIR .'functions_admin.php');
|
||||
|
||||
if ($row = $db->fetch_row("SELECT user_id FROM ". USERS_TABLE ." WHERE user_id NOT IN(". EXCLUDED_USERS_CSV .');'))
|
||||
if ($row = DB()->fetch_row("SELECT user_id FROM ". BB_USERS ." WHERE user_id NOT IN(". EXCLUDED_USERS_CSV .');'))
|
||||
{
|
||||
foreach ($row as $user)
|
||||
{
|
||||
user_delete($user['user_id']);
|
||||
}
|
||||
}*/
|
||||
$db->query('DELETE FROM '. USERS_TABLE .' WHERE user_id NOT IN('. EXCLUDED_USERS_CSV .')');
|
||||
$db->query('TRUNCATE '. BT_USERS_TABLE);
|
||||
DB()->query('DELETE FROM '. BB_USERS .' WHERE user_id NOT IN('. EXCLUDED_USERS_CSV .')');
|
||||
DB()->query('TRUNCATE '. BB_BT_USERS);
|
||||
}
|
||||
|
||||
function tp_user_level($tb_class)
|
||||
|
@ -95,8 +87,6 @@ function tp_user_level($tb_class)
|
|||
|
||||
function convert_user($user)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$user_data = array(
|
||||
"user_id" => $user['id'],
|
||||
"user_active" => ($user['enabled'] == 'yes') ? true : false,
|
||||
|
@ -107,15 +97,11 @@ function convert_user($user)
|
|||
"user_level" => tp_user_level($user['class']),
|
||||
"user_lang" => $user['language'],
|
||||
"user_dateformat" => "Y-m-d H:i",
|
||||
//"user_opt" => ,
|
||||
"user_opt" => 0,
|
||||
"user_avatar" => !empty($user['avatar']) ? $user['avatar'] : null,
|
||||
"user_avatar_type" => !empty($user['avatar']) ? 2 : null,
|
||||
"user_email" => $user['email'],
|
||||
"user_website" => $user['website'],
|
||||
"user_icq" => $user['icq'],
|
||||
"user_aim" => $user['aim'],
|
||||
"user_yim" => $user['yahoo'],
|
||||
"user_msnm" => $user['msn'],
|
||||
"user_website" => $user['website'],
|
||||
);
|
||||
|
||||
$columns = $values = array();
|
||||
|
@ -123,12 +109,12 @@ function convert_user($user)
|
|||
foreach ($user_data as $column => $value)
|
||||
{
|
||||
$columns[] = $column;
|
||||
$values[] = "'". $db->escape($value) ."'";
|
||||
$values[] = "'". DB()->escape($value) ."'";
|
||||
}
|
||||
$sql_columns = implode(',', $columns);
|
||||
$sql_values = implode(',', $values);
|
||||
|
||||
$db->query("INSERT IGNORE INTO ". USERS_TABLE . " ($sql_columns) VALUES($sql_values);");
|
||||
DB()->query("INSERT IGNORE INTO ". BB_USERS . " ($sql_columns) VALUES($sql_values);");
|
||||
|
||||
$bt_user_data = array(
|
||||
"user_id" => $user['id'],
|
||||
|
@ -141,63 +127,55 @@ function convert_user($user)
|
|||
foreach ($bt_user_data as $column => $value)
|
||||
{
|
||||
$columns[] = $column;
|
||||
$values[] = "'". $db->escape($value) ."'";
|
||||
$values[] = "'". DB()->escape($value) ."'";
|
||||
}
|
||||
$sql_bt_columns = implode(',', $columns);
|
||||
$sql_bt_values = implode(',', $values);
|
||||
|
||||
$db->query("INSERT IGNORE INTO ". BT_USERS_TABLE . " ($sql_bt_columns) VALUES($sql_bt_values);");
|
||||
DB()->query("INSERT IGNORE INTO ". BB_BT_USERS . " ($sql_bt_columns) VALUES($sql_bt_values);");
|
||||
}
|
||||
|
||||
//Torrents and categories functions
|
||||
function tp_categories_cleanup()
|
||||
{
|
||||
global $db;
|
||||
|
||||
$db->query('DELETE FROM '. CATEGORIES_TABLE);
|
||||
DB()->query('DELETE FROM '. BB_CATEGORIES);
|
||||
}
|
||||
|
||||
function tp_add_category_old($id, $cat_title)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$db->query("INSERT IGNORE INTO ". CATEGORIES_TABLE ." (cat_id, cat_title)
|
||||
VALUES ($id, '". $db->escape($cat_title) ."')");
|
||||
DB()->query("INSERT IGNORE INTO ". BB_CATEGORIES ." (cat_id, cat_title)
|
||||
VALUES ($id, '". DB()->escape($cat_title) ."')");
|
||||
return;
|
||||
}
|
||||
|
||||
function tp_add_category($cat_data)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$columns = $values = array();
|
||||
|
||||
foreach ($cat_data as $column => $value)
|
||||
{
|
||||
$columns[] = $column;
|
||||
$values[] = "'". $db->escape($value) ."'";
|
||||
$values[] = "'". DB()->escape($value) ."'";
|
||||
}
|
||||
$sql_bt_columns = implode(',', $columns);
|
||||
$sql_bt_values = implode(',', $values);
|
||||
|
||||
$db->query("INSERT IGNORE INTO ". CATEGORIES_TABLE . " ($sql_bt_columns) VALUES($sql_bt_values);");
|
||||
DB()->query("INSERT IGNORE INTO ". BB_CATEGORIES . " ($sql_bt_columns) VALUES($sql_bt_values);");
|
||||
}
|
||||
|
||||
function tp_topics_cleanup()
|
||||
{
|
||||
global $db;
|
||||
DB()->query("TRUNCATE ". BB_ATTACHMENTS);
|
||||
DB()->query("TRUNCATE ". BB_ATTACHMENTS_DESC);
|
||||
DB()->query("TRUNCATE ". BB_BT_TORRENTS);
|
||||
DB()->query("TRUNCATE ". BB_POSTS);
|
||||
DB()->query("TRUNCATE ". BB_POSTS_HTML);
|
||||
DB()->query("TRUNCATE ". BB_POSTS_SEARCH);
|
||||
DB()->query("TRUNCATE ". BB_POSTS_TEXT);
|
||||
DB()->query("TRUNCATE ". BB_TOPICS);
|
||||
/*if (!function_exists('topic_delete')) require_once(INC_DIR .'functions_admin.php');
|
||||
|
||||
$db->query("TRUNCATE ". ATTACHMENTS_TABLE);
|
||||
$db->query("TRUNCATE ". ATTACHMENTS_DESC_TABLE);
|
||||
$db->query("TRUNCATE ". BT_TORRENTS_TABLE);
|
||||
$db->query("TRUNCATE ". POSTS_TABLE);
|
||||
$db->query("TRUNCATE ". POSTS_HTML_TABLE);
|
||||
$db->query("TRUNCATE ". POSTS_SEARCH_TABLE);
|
||||
$db->query("TRUNCATE ". POSTS_TEXT_TABLE);
|
||||
$db->query("TRUNCATE ". TOPICS_TABLE);
|
||||
/*if (!function_exists('topic_delete')) require_once('./includes/functions_admin.php');
|
||||
|
||||
if ($row = $db->fetch_row("SELECT topic_id FROM ". TOPICS_TABLE))
|
||||
if ($row = DB()->fetch_row("SELECT topic_id FROM ". BB_TOPICS))
|
||||
{
|
||||
foreach ($row as $topic)
|
||||
{
|
||||
|
@ -210,57 +188,51 @@ function tp_topics_cleanup()
|
|||
|
||||
function tp_add_topic($topic_data)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$columns = $values = array();
|
||||
foreach ($topic_data as $column => $value)
|
||||
{
|
||||
$columns[] = $column;
|
||||
$values[] = "'". $db->escape($value) ."'";
|
||||
$values[] = "'". DB()->escape($value) ."'";
|
||||
}
|
||||
$sql_columns = implode(',', $columns);
|
||||
$sql_values = implode(',', $values);
|
||||
|
||||
$db->query("INSERT IGNORE INTO ". TOPICS_TABLE . " ($sql_columns) VALUES($sql_values);");
|
||||
DB()->query("INSERT IGNORE INTO ". BB_TOPICS . " ($sql_columns) VALUES($sql_values);");
|
||||
return;
|
||||
}
|
||||
|
||||
function tp_add_post($post_data)
|
||||
{
|
||||
global $db;
|
||||
|
||||
foreach ($post_data as $key => $data)
|
||||
{
|
||||
$columns = $values = array();
|
||||
foreach ($data as $column => $value)
|
||||
{
|
||||
$columns[] = $column;
|
||||
$values[] = "'". $db->escape($value) ."'";
|
||||
$values[] = "'". DB()->escape($value) ."'";
|
||||
}
|
||||
$sql_columns = implode(',', $columns);
|
||||
$sql_values = implode(',', $values);
|
||||
|
||||
$db->query("INSERT IGNORE INTO bb_{$key} ($sql_columns) VALUES($sql_values);");
|
||||
DB()->query("INSERT IGNORE INTO bb_{$key} ($sql_columns) VALUES($sql_values);");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
function tp_add_attach($attach_data)
|
||||
{
|
||||
global $db;
|
||||
|
||||
foreach ($attach_data as $key => $data)
|
||||
{
|
||||
$columns = $values = array();
|
||||
foreach ($data as $column => $value)
|
||||
{
|
||||
$columns[] = $column;
|
||||
$values[] = "'". $db->escape($value) ."'";
|
||||
$values[] = "'". DB()->escape($value) ."'";
|
||||
}
|
||||
$sql_columns = implode(',', $columns);
|
||||
$sql_values = implode(',', $values);
|
||||
|
||||
$db->query("INSERT IGNORE INTO bb_{$key} ($sql_columns) VALUES($sql_values);");
|
||||
DB()->query("INSERT IGNORE INTO bb_{$key} ($sql_columns) VALUES($sql_values);");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -284,7 +256,7 @@ function append_images($tor)
|
|||
}
|
||||
if(!empty($tor['image2']))
|
||||
{
|
||||
$screens = '[spoiler="Ñêðèíøîòû"][img]'.make_img_path($tor['image2'])."[/img][/spoiler]";
|
||||
$screens = '[spoiler="Скриншоты"][img]'.make_img_path($tor['image2'])."[/img][/spoiler]";
|
||||
}
|
||||
break;
|
||||
case 'sky':
|
||||
|
@ -295,7 +267,7 @@ function append_images($tor)
|
|||
$has_screens = !empty($tor['screenshot1']) || !empty($tor['screenshot2']) || !empty($tor['screenshot3']) || !empty($tor['screenshot4']);
|
||||
if ($has_screens)
|
||||
{
|
||||
$screens .= '[spoiler="Ñêðèíøîòû"]';
|
||||
$screens .= '[spoiler="Скриншоты"]';
|
||||
for ($i = 1; $i<=4; $i++)
|
||||
{
|
||||
if(!empty($tor['screenshot'.$i]))
|
||||
|
@ -312,8 +284,6 @@ function append_images($tor)
|
|||
|
||||
function convert_torrent($torrent)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$topic_data = array(
|
||||
"topic_id" => $torrent['topic_id'],
|
||||
"forum_id" => $torrent['category'],
|
||||
|
@ -329,10 +299,8 @@ function convert_torrent($torrent)
|
|||
"topic_last_post_time" => $torrent['added'],
|
||||
);
|
||||
tp_add_topic($topic_data);
|
||||
|
||||
$bbcode_uid = make_bbcode_uid();
|
||||
//$post_text = prepare_message($torrent['descr'], true, true, $bbcode_uid);
|
||||
$post_text = stripslashes(prepare_message(addslashes(unprepare_message($torrent['descr'])), true, true, $bbcode_uid));
|
||||
//$post_text = prepare_message($torrent['descr'], true, true);
|
||||
$post_text = stripslashes(prepare_message(addslashes(unprepare_message($torrent['descr'])), true, true));
|
||||
|
||||
$post_data = array(
|
||||
"posts" => array(
|
||||
|
@ -345,7 +313,6 @@ function convert_torrent($torrent)
|
|||
),
|
||||
"posts_text" => array(
|
||||
"post_id" => $torrent['post_id'],
|
||||
"bbcode_uid" => $bbcode_uid,
|
||||
"post_text" => $post_text,
|
||||
),
|
||||
"posts_search" => array(
|
||||
|
@ -382,11 +349,11 @@ function convert_torrent($torrent)
|
|||
{
|
||||
return;
|
||||
}
|
||||
if (!function_exists('bdecode_file')) include_once('./includes/functions_torrent.php');
|
||||
if (!function_exists('bdecode_file')) include_once(INC_DIR .'functions_torrent.php');
|
||||
$tor = bdecode_file($filename);
|
||||
$info = ($tor['info']) ? $tor['info'] : array();
|
||||
$info_hash = pack('H*', sha1(bencode($info)));
|
||||
$info_hash_sql = rtrim($db->escape($info_hash), ' ');
|
||||
$info_hash_sql = rtrim(DB()->escape($info_hash), ' ');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -416,17 +383,14 @@ function convert_torrent($torrent)
|
|||
$sql_columns = implode(', ', $columns);
|
||||
$sql_values = implode(', ', $values);
|
||||
|
||||
$db->query("INSERT IGNORE INTO ". BT_TORRENTS_TABLE . " ($sql_columns) VALUES($sql_values);");
|
||||
DB()->query("INSERT IGNORE INTO ". BB_BT_TORRENTS . " ($sql_columns) VALUES($sql_values);");
|
||||
return;
|
||||
}
|
||||
|
||||
//Comments functions
|
||||
function convert_comment($comment)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$bbcode_uid = make_bbcode_uid();
|
||||
$post_text = prepare_message($comment['text'], true, true, $bbcode_uid);
|
||||
$post_text = prepare_message($comment['text'], true, true);
|
||||
|
||||
$post_data = array(
|
||||
"posts" => array(
|
||||
|
@ -441,7 +405,6 @@ function convert_comment($comment)
|
|||
),
|
||||
"posts_text" => array(
|
||||
"post_id" => $comment['id'],
|
||||
"bbcode_uid" => $bbcode_uid,
|
||||
"post_text" => $post_text,
|
||||
),
|
||||
);
|
||||
|
@ -453,22 +416,18 @@ function convert_comment($comment)
|
|||
//Forums functions
|
||||
function tp_forums_cleanup()
|
||||
{
|
||||
global $db;
|
||||
|
||||
$db->query('TRUNCATE '. FORUMS_TABLE);
|
||||
DB()->query('TRUNCATE '. BB_FORUMS);
|
||||
}
|
||||
|
||||
function convert_cat($forum, $allow_torrents = true)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$forum_data = array(
|
||||
"forum_id" => $forum['id'],
|
||||
"cat_id" => $forum['cat_id'],
|
||||
"forum_name" => $forum['name'],
|
||||
"forum_order" => $forum['sort'],
|
||||
"allow_reg_tracker" => $allow_torrents,
|
||||
"allow_dl_topic" => $allow_torrents,
|
||||
"allow_porno_topic" => $allow_torrents,
|
||||
);
|
||||
|
||||
$columns = $values = array();
|
||||
|
@ -476,11 +435,11 @@ function convert_cat($forum, $allow_torrents = true)
|
|||
foreach ($forum_data as $column => $value)
|
||||
{
|
||||
$columns[] = $column;
|
||||
$values[] = "'". $db->escape($value) ."'";
|
||||
$values[] = "'". DB()->escape($value) ."'";
|
||||
}
|
||||
$sql_columns = implode(',', $columns);
|
||||
$sql_values = implode(',', $values);
|
||||
|
||||
$db->query("INSERT IGNORE INTO ". FORUMS_TABLE . " ($sql_columns) VALUES($sql_values);");
|
||||
DB()->query("INSERT IGNORE INTO ". BB_FORUMS . " ($sql_columns) VALUES($sql_values);");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
<?php
|
||||
|
||||
define ('IN_PHPBB', true);
|
||||
define ('IN_SERVICE', true);
|
||||
require ("./common.php");
|
||||
require ('./includes/functions_torrent.php');
|
||||
require ("./converter/settings.php");
|
||||
require ("./converter/functions.php");
|
||||
define('IN_PHPBB', true);
|
||||
define('IN_SERVICE', true);
|
||||
define('BB_ROOT', './');
|
||||
require(BB_ROOT .'common.php');
|
||||
require(INC_DIR .'functions_torrent.php');
|
||||
require(BB_ROOT .'converter/settings.php');
|
||||
require(BB_ROOT .'converter/functions.php');
|
||||
|
||||
// Init userdata
|
||||
$user->session_start();
|
||||
|
@ -13,10 +14,11 @@ $user->session_start();
|
|||
while (@ob_end_flush());
|
||||
ob_implicit_flush();
|
||||
|
||||
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<title></title>
|
||||
</head>
|
||||
|
@ -44,7 +46,7 @@ else
|
|||
@ini_set('memory_limit', '512M');
|
||||
@ini_set('max_execution_time', @ini_get('max_execution_time') + 1200);
|
||||
|
||||
$torrents_count = (int) get_count(BT_TORRENTS_TABLE, 'attach_id');
|
||||
$torrents_count = (int) get_count(BB_BT_TORRENTS, 'attach_id');
|
||||
$loops = (int) ceil($torrents_count / C_TORRENTS_PER_ONCE);
|
||||
|
||||
$not_exist = array();
|
||||
|
@ -58,13 +60,13 @@ for ($i = 0; $i < $loops; $i++)
|
|||
|
||||
$sql = "SELECT
|
||||
tor.attach_id, tor.topic_id, ad.physical_filename
|
||||
FROM ". BT_TORRENTS_TABLE ." tor
|
||||
LEFT JOIN ". ATTACHMENTS_DESC_TABLE ." ad ON(ad.attach_id = tor.attach_id)
|
||||
FROM ". BB_BT_TORRENTS ." tor
|
||||
LEFT JOIN ". BB_ATTACHMENTS_DESC ." ad ON(ad.attach_id = tor.attach_id)
|
||||
ORDER BY tor.attach_id
|
||||
LIMIT $start, $offset";
|
||||
|
||||
$torrents = $db->fetch_rowset($sql);
|
||||
$db->sql_freeresult();
|
||||
$torrents = DB()->fetch_rowset($sql);
|
||||
DB()->sql_freeresult();
|
||||
|
||||
foreach ($torrents as $torrent)
|
||||
{
|
||||
|
@ -78,9 +80,9 @@ for ($i = 0; $i < $loops; $i++)
|
|||
$tor = bdecode_file($filename);
|
||||
$info = (!empty($tor['info'])) ? $tor['info'] : array();
|
||||
$info_hash = pack('H*', sha1(bencode($info)));
|
||||
$info_hash_sql = rtrim($db->escape($info_hash), ' ');
|
||||
$info_hash_sql = rtrim(DB()->escape($info_hash), ' ');
|
||||
|
||||
$db->query("UPDATE ". BT_TORRENTS_TABLE ."
|
||||
DB()->query("UPDATE ". BB_BT_TORRENTS ."
|
||||
SET info_hash = '$info_hash_sql'
|
||||
WHERE attach_id = {$torrent['attach_id']}");
|
||||
}
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
<?php
|
||||
|
||||
define ('IN_PHPBB', true);
|
||||
define ('IN_SERVICE', true);
|
||||
require ("./common.php");
|
||||
require ('./includes/functions_torrent.php');
|
||||
require ("./converter/settings.php");
|
||||
require ("./converter/functions.php");
|
||||
define('IN_PHPBB', true);
|
||||
define('IN_SERVICE', true);
|
||||
define('BB_ROOT', './');
|
||||
require(BB_ROOT .'common.php');
|
||||
require(INC_DIR .'functions_torrent.php');
|
||||
require(BB_ROOT .'converter/settings.php');
|
||||
require(BB_ROOT .'converter/functions.php');
|
||||
|
||||
|
||||
// Init userdata
|
||||
$user->session_start();
|
||||
|
@ -16,7 +18,7 @@ ob_implicit_flush();
|
|||
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<title></title>
|
||||
</head>
|
||||
|
|
|
@ -10,7 +10,7 @@ require('./pagestart.php');
|
|||
// ACP Header - END
|
||||
|
||||
$max_forum_name_len = 30;
|
||||
$max_forum_rows = 35;
|
||||
$max_forum_rows = 25;
|
||||
|
||||
require(INC_DIR .'functions_admin_torrent.php');
|
||||
require(LANG_DIR .'lang_admin_bt.php');
|
||||
|
@ -83,7 +83,7 @@ if ($submit && $confirm)
|
|||
|
||||
$datastore->update('cat_forums');
|
||||
|
||||
$message = $lang['CONFIG_UPD'] .'<br /><br />'. sprintf($lang['RETURN_CONFIG'], '<a href=""admin_bt_forum_cfg.php">', '</a>') .'<br /><br />'. sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>');
|
||||
$message = $lang['CONFIG_UPD'] .'<br /><br />'. sprintf($lang['RETURN_CONFIG'], '<a href="admin_bt_forum_cfg.php">', '</a>') .'<br /><br />'. sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>');
|
||||
message_die(GENERAL_MESSAGE, $message);
|
||||
}
|
||||
|
||||
|
|
|
@ -473,8 +473,15 @@ if ($tor_reged && $tor_info)
|
|||
$template->assign_block_vars("$x_full.porthead", array());
|
||||
}
|
||||
}
|
||||
$compl_size = ($peer['remain'] && $tor_size && $tor_size > $peer['remain']) ? ($tor_size - $peer['remain']) : 0;
|
||||
$compl_perc = ($compl_size) ? floor($compl_size * 100 / $tor_size) : 0;
|
||||
$compl_size = ($peer['remain'] && $tor_size && $tor_size > $peer['remain']) ? ($tor_size - $peer['remain']) : 0;
|
||||
if($bb_cfg['announce_type'] == 'xbt')
|
||||
{
|
||||
$compl_perc = $peer['complete_percent'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$compl_perc = ($compl_size) ? floor($compl_size * 100 / $tor_size) : 0;
|
||||
}
|
||||
}
|
||||
|
||||
$rel_sign = (!$guest && $peer['releaser']) ? ' <b><sup>®</sup></b>' : '';
|
||||
|
|
|
@ -51,8 +51,8 @@ if (!defined('BB_ROOT')) die(basename(__FILE__));
|
|||
$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'] = 'R390';
|
||||
$bb_cfg['tp_version'] = '2.4 (RC)';
|
||||
$bb_cfg['tp_release_state'] = 'R391';
|
||||
$bb_cfg['tp_release_date'] = '9-04-2012';
|
||||
|
||||
// Database
|
||||
|
|
|
@ -201,6 +201,7 @@ if($bb_cfg['seed_bonus_enabled'] && $bb_cfg['seed_bonus_points'] && $bb_cfg['see
|
|||
FROM ". BB_BT_TRACKER ." bt, ". BB_BT_TORRENTS ." tor
|
||||
WHERE tor.topic_id = bt.topic_id
|
||||
AND tor.size > $tor_size
|
||||
AND bt.seeder > 0
|
||||
GROUP BY user_id
|
||||
");
|
||||
|
||||
|
@ -221,6 +222,8 @@ if($bb_cfg['seed_bonus_enabled'] && $bb_cfg['seed_bonus_points'] && $bb_cfg['see
|
|||
WHERE u.user_id = b.user_id
|
||||
AND b.release_count <= $release
|
||||
AND u.user_regdate < $user_regdate
|
||||
AND u.user_active = 1
|
||||
AND u.user_id not IN(". EXCLUDED_USERS_CSV .")
|
||||
");
|
||||
}
|
||||
|
||||
|
|
|
@ -2760,9 +2760,9 @@ function set_die_append_msg ($forum_id = null, $topic_id = null)
|
|||
global $userdata, $lang, $template;
|
||||
|
||||
$msg = '';
|
||||
$msg .= ($topic_id) ? '<p class="mrg_10"><a href="viewtopic.php?t='. $topic_id .'">'. $lang['CLICK_RETURN_TOPIC'] .'</a></p>' : '';
|
||||
$msg .= ($forum_id) ? '<p class="mrg_10"><a href="viewforum.php?f='. $forum_id .'">'. $lang['CLICK_RETURN_FORUM'] .'</a></p>' : '';
|
||||
$msg .= '<p class="mrg_10"><a href="index.php">'. $lang['CLICK_RETURN_INDEX'] .'</a></p>';
|
||||
$msg .= ($topic_id) ? '<p class="mrg_10"><a href="viewtopic.php?t='. $topic_id .'">'. $lang['TOPIC_RETURN'] .'</a></p>' : '';
|
||||
$msg .= ($forum_id) ? '<p class="mrg_10"><a href="viewforum.php?f='. $forum_id .'">'. $lang['FORUM_RETURN'] .'</a></p>' : '';
|
||||
$msg .= '<p class="mrg_10"><a href="index.php">'. $lang['INDEX_RETURN'] .'</a></p>';
|
||||
$template->assign_var('BB_DIE_APPEND_MSG', $msg);
|
||||
}
|
||||
|
||||
|
|
|
@ -398,7 +398,7 @@ if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled'])
|
|||
continue;
|
||||
}
|
||||
|
||||
$today_list[] = profile_url($today) .' <span class="small">('. birthday_age($today['age'], 1) .')</span>';
|
||||
$today_list[] = profile_url($today) .' <span class="small">('. birthday_age($today['age']) .')</span>';
|
||||
}
|
||||
$today_all = ($today_all) ? ' <a class="txtb" href="#" onclick="ajax.exec({action: \'index_data\', mode: \'birthday_today\'}); return false;" title="'. $lang['ALL'] .'">...</a>' : '';
|
||||
$today_list = $lang['BIRTHDAY_TODAY'] . join(', ', $today_list) . $today_all;
|
||||
|
|
|
@ -1192,7 +1192,7 @@ $lang['PASSKEY_ERR_EMPTY'] = 'Could not add passkey (passkey is empty)<br /><br
|
|||
$lang['BT_PASSKEY'] = 'Passkey';
|
||||
$lang['BT_GEN_PASSKEY'] = 'create a new';
|
||||
$lang['BT_PASSKEY_VIEW'] = 'show';
|
||||
$lang['BT_GEN_PASSKEY_NEW'] = "Attention! After changing the new passkey, you will need to re-download all the active torrents! \ n Are you sure you want to create a new passkey?";
|
||||
$lang['BT_GEN_PASSKEY_NEW'] = "Attention! After changing the new passkey, you will need to re-download all the active torrents! \n Are you sure you want to create a new passkey?";
|
||||
$lang['BT_NO_SEARCHABLE_FORUMS'] = 'No searchable forums found';
|
||||
|
||||
$lang['SEEDS'] = 'Seed';
|
||||
|
@ -1724,4 +1724,9 @@ $lang['RESTORE_ALL_POSTS'] = 'Restore all posts';
|
|||
$lang['DEL_LIST_MY_MESSAGE'] = 'Delete the selected topic from the list';
|
||||
$lang['DEL_LIST_MY_MESSAGE_INFO'] = 'After removal of up to update the <b>entire list</b> it can be shown already deleted threads';
|
||||
$lang['DEL_LIST_INFO'] = 'To delete an order from the list, click on the icon to the left of the names of any section';
|
||||
|
||||
// set_die_append_msg
|
||||
$lang['INDEX_RETURN'] = 'Back to home page';
|
||||
$lang['FORUM_RETURN'] = 'Back to Forum';
|
||||
$lang['TOPIC_RETURN'] = 'Back to the topic';
|
||||
$lang['POST_RETURN'] = 'Go to post';
|
||||
|
|
|
@ -1732,4 +1732,9 @@ $lang['RESTORE_ALL_POSTS'] = 'Восстановить все сообщения
|
|||
$lang['DEL_LIST_MY_MESSAGE'] = 'Удалить выбранные темы из списка';
|
||||
$lang['DEL_LIST_MY_MESSAGE_INFO'] = 'После удаления и до обновления <b>всего списка</b> в нём могут быть показаны уже удаленные темы';
|
||||
$lang['DEL_LIST_INFO'] = 'Для удаления тем из списка нажмите на иконку слева от названия любого раздела';
|
||||
$lang['INDEX_RETURN'] = 'Вернуться на главную страницу';
|
||||
|
||||
// set_die_append_msg
|
||||
$lang['INDEX_RETURN'] = 'Вернуться на главную';
|
||||
$lang['FORUM_RETURN'] = 'Вернуться в форум';
|
||||
$lang['TOPIC_RETURN'] = 'Вернуться в тему';
|
||||
$lang['POST_RETURN'] = 'Перейти к сообщению';
|
|
@ -11,7 +11,7 @@
|
|||
<th colspan="3">{L_BT_SELECT_FORUMS}</th>
|
||||
</tr>
|
||||
<tr class="row2 tCenter">
|
||||
<td>{L_ALLOW_REG_TRACKER}</td>
|
||||
<td>{L_ALLOW_REG_TRACKER} <input onclick="$('select').each(function(){ this.size += 5; }); return false;" class="mainoption" type="button" value="+" /></td>
|
||||
<td>{L_SELF_MODERATED}</td>
|
||||
<td>{L_ALLOW_PORNO_TOPIC}</td>
|
||||
</tr>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue