diff --git a/README.md b/README.md
new file mode 100644
index 000000000..05ffc6e54
--- /dev/null
+++ b/README.md
@@ -0,0 +1,59 @@
+TorrentPier II
+======================
+
+TorrentPier II - движок торрент-трекера, написанный на php. Высокая скорость работы, простота модификации, устойчивость к высоким нагрузкам, в том числе и поддержка альтернативных анонсеров (например, Ocelot). Помимо этого, крайне развитый официальный форум поддержки, где помимо прочего можно испытать движок в работе на демо-версии, не устанавливая его а также получить любую другую интересующую вас информацию и скачать моды.
+
+## Установка
+
+Для установки вам необходимо выполнить несколько простых шагов:
+
+1. Распаковываем на сервер содержимое папки **upload**
+
+2. Создаем базу данных, в которую при помощи phpmyadmin (или любого другого удобного инструмента) импортируем дамп, расположенный в папке **install/sql/mysql.sql**
+3. Правим файл конфигурации **config.php**, загруженный на сервер:
+> $bb_cfg['db']['db1'] = array('localhost', 'dbase', 'user', 'pass', $charset, $pconnect);
+> В данной строке изменяем данные входа в базу данных, остальные правки в файле вносятся по усмотрению, исходя из необходимости из внесения (ориентируйтесь на описания, указанные у полей).
+
+4. Редактируем указанные файлы:
+ + **favicon.ico** (меняем на свою иконку, если есть)
+ + **robots.txt** (меняем адреса в строках **Host** и **Sitemap** на свои)
+
+## Права доступа на папки и файлы
+
+Исходя из настроек вашего сервера, устанавливаем рекомендуемые права доступа (chmod) на указанные папки **777**, а на файлы внутри этих папок (кроме файлов **.htaccess** и **.keep**) **666**:
+- ajax/html
+- cache
+- cache/filecache
+- files
+- files/thumbs
+- images
+- images/avatars
+- images/captcha
+- images/ranks
+- images/smiles
+- log
+- sitemap
+- triggers
+
+## Необходимые настройки php
+
+ mbstring.internal_encoding = UTF-8
+ magic_quotes_gpc = Off
+Внести данные настройки необходимо в файл **php.ini**. Их вам может установить ваш хостер по запросу, если у вас возникают какие-либо проблемы с их самостоятельной установкой. Впрочем, эти настройки могут быть установлены на сервере по-умолчанию, поэтому их внесение требуется исключительно по необходимости.
+
+## Необходимые модули php
+
+ php5-tidy
+
+Начиная с версии 2.0.9 (ревизия 592 в старой нумерации) данный модуль не является обязательным, но его установка крайне рекомендуется для повышения качества обработки html-кода тем и сообщений пользователей.
+
+## Рекомендуемый способ запуска cron.php
+
+Для значительного ускорения работы трекера может потребоваться отвязка встроенного форумного крона. С более подробной информацией об отвязке крона, вы можете ознакомиться в данной теме http://torrentpier.me/threads/52/ на нашем форуме поддержки.
+
+## Полезные ссылки
+
++ Наш форум http://torrentpier.me/
++ Центр загрузки http://get.torrentpier.me/
++ Часто задаваемые вопросы http://faq.torrentpier.me/
++ Где задать вопрос http://torrentpier.me/forums/10/
diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql
index fe0a74fb6..66c0e5ab7 100644
--- a/install/sql/mysql.sql
+++ b/install/sql/mysql.sql
@@ -557,8 +557,10 @@ INSERT INTO `bb_config` VALUES ('seed_bonus_points', '');
INSERT INTO `bb_config` VALUES ('seed_bonus_tor_size', '0');
INSERT INTO `bb_config` VALUES ('seed_bonus_user_regdate', '0');
INSERT INTO `bb_config` VALUES ('site_desc', 'A little text to describe your forum');
+INSERT INTO `bb_config` VALUES ('sitemap_time', '');
INSERT INTO `bb_config` VALUES ('sitename', 'TorrentPier II - Torrent Tracker');
INSERT INTO `bb_config` VALUES ('smilies_path', 'images/smiles');
+INSERT INTO `bb_config` VALUES ('static_sitemap', '');
INSERT INTO `bb_config` VALUES ('topics_per_page', '50');
INSERT INTO `bb_config` VALUES ('xs_use_cache', '1');
INSERT INTO `bb_config` VALUES ('active_ads', '');
@@ -642,6 +644,7 @@ INSERT INTO `bb_cron` VALUES (18, 1, 'Seeder last seen', 'tr_update_seeder_last_
INSERT INTO `bb_cron` VALUES (19, 1, 'Captcha', 'captcha_gen_gc.php', 'daily', NULL, '05:00:00', 120, '', '', NULL, 0, '', 0, 0, 0);
INSERT INTO `bb_cron` VALUES (20, 1, 'Tracker dl-complete count', 'tr_complete_count.php', 'interval', NULL, NULL, 255, '', '', '06:00:00', 0, '', 0, 0, 0);
INSERT INTO `bb_cron` VALUES (21, 1, 'Cache garbage collector', 'cache_gc.php', 'interval', NULL, NULL, 255, '', '', '00:05:00', 0, '', 0, 0, 0);
+INSERT INTO `bb_cron` VALUES (22, 1, 'Sitemap update', 'sitemap.php', 'daily', NULL, '06:00:00', 30, '', '', NULL, 0, '', 0, 0, 0);
-- --------------------------------------------------------
diff --git a/other/converter/TBDevYSE_pre6/ReadMe.txt b/other/converter/TBDevYSE_pre6/ReadMe.txt
index dd8137e3e..198424165 100644
--- a/other/converter/TBDevYSE_pre6/ReadMe.txt
+++ b/other/converter/TBDevYSE_pre6/ReadMe.txt
@@ -14,8 +14,8 @@ Quick guide:
copy two files: automatically generated 'converter/passwords.php' and 'for_tbdev/pass.php' to your TBDevYSE root and run pass.php
(Don't forget to remove these files after completion).
You allow to change message text, see $msg in pass.php for this.
-10. If you want to redirect peers from older announce to new announce everytime, replace original TBDev's announce.php with
- 'for_tbdev/announce.php'
+10. If you want to redirect peers from older announce to new announce everytime, replace original TBDev's announce.php with
+ 'for_tbdev/announce.php'
Cheers, RoadTrain.
http://torrentpier.me/
\ No newline at end of file
diff --git a/other/converter/TBDevYSE_pre6/for_tbdev/announce.php b/other/converter/TBDevYSE_pre6/for_tbdev/announce.php
index 7385a89f8..b69fed877 100644
--- a/other/converter/TBDevYSE_pre6/for_tbdev/announce.php
+++ b/other/converter/TBDevYSE_pre6/for_tbdev/announce.php
@@ -42,10 +42,10 @@ mysql_close();
mysql_query("SET NAMES $dbcharset");
// Get passkey for TorrentPier
-$user_id += USER_ID_DIFF;
+$user_id += USER_ID_DIFF;
$res = mysql_query("SELECT auth_key FROM bb_bt_users WHERE user_id = $user_id") or err(mysql_error());
-if (mysql_affected_rows() == 0)
+if (mysql_affected_rows() == 0)
{
err('Passkey doesn\'t created on new tracker or user doesn\'t exist');
}
diff --git a/other/converter/TBDevYSE_pre6/for_tbdev/pass.php b/other/converter/TBDevYSE_pre6/for_tbdev/pass.php
index 827609c81..b16622d6d 100644
--- a/other/converter/TBDevYSE_pre6/for_tbdev/pass.php
+++ b/other/converter/TBDevYSE_pre6/for_tbdev/pass.php
@@ -8,14 +8,12 @@ loggedinorreturn();
$new_tr_url = "http://torrentpier.me/"; // 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
+$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].';
-
-
if (empty($_POST['confirm']))
{
@@ -32,14 +30,14 @@ if (empty($_POST['confirm']))
else
{
if(!file_exists('passwords.php')) stderr($tracker_lang['error'], 'passwords.php not exists');
-
+
include('passwords.php');
stdhead();
foreach ($passwords as $user)
{
$msg_sql = sprintf($msg, $user['username'], $user['new_passwd']);
sql_query("INSERT INTO messages (receiver, added, subject, msg) VALUES({$user['tb_user_id']}, NOW(), ".sqlesc($subject).", ".sqlesc($msg_sql).")");
- }
+ }
stdmsg('OK', 'Mass PM succesful');
}
diff --git a/other/converter/TBDevYSE_pre6/root/convert.php b/other/converter/TBDevYSE_pre6/root/convert.php
index e3bd985f7..dec5874d0 100644
--- a/other/converter/TBDevYSE_pre6/root/convert.php
+++ b/other/converter/TBDevYSE_pre6/root/convert.php
@@ -81,18 +81,18 @@ if (CONVERT_USERS)
{
$start = $i * C_USERS_PER_ONCE;
$offset = C_USERS_PER_ONCE;
-
+
$sql = "
- SELECT
- id, username, email, status, UNIX_TIMESTAMP(added) AS added, UNIX_TIMESTAMP(last_access) AS last_access,
+ SELECT
+ id, username, email, status, UNIX_TIMESTAMP(added) AS added, UNIX_TIMESTAMP(last_access) AS last_access,
class, icq, msn, aim, yahoo, website, $_sql
uploaded, downloaded, enabled, language
- FROM ". TB_USERS_TABLE ."
+ FROM ". TB_USERS_TABLE ."
ORDER BY id
LIMIT $start, $offset";
$users = DB()->fetch_rowset($sql);
- DB()->sql_freeresult();
+ DB()->sql_freeresult();
foreach ($users as $user)
{
@@ -159,17 +159,17 @@ if (CONVERT_TORRENTS)
print_ok ("Categories from TBDev converted");
unset($cats);
- // Start of torrents converting
+ // Start of torrents converting
switch(TR_TYPE)
- {
+ {
case 'yse':
$_sql = 'image1, image2, ';
break;
-
+
case 'sky':
$_sql = 'poster, screenshot1, screenshot2, screenshot3, screenshot4, ';
break;
-
+
default:
$_sql = '';
break;
@@ -187,9 +187,9 @@ if (CONVERT_TORRENTS)
$start = $i * C_TORRENTS_PER_ONCE;
$offset = C_TORRENTS_PER_ONCE;
$sql = "
- SELECT
+ SELECT
id, info_hash, name, filename, search_text, descr, $_sql
- category, UNIX_TIMESTAMP(added) AS added, size, views,
+ category, UNIX_TIMESTAMP(added) AS added, size, views,
UNIX_TIMESTAMP(last_action) AS lastseed, times_completed, owner, sticky
FROM ". TB_TORRENTS_TABLE ."
ORDER BY id
@@ -197,7 +197,7 @@ if (CONVERT_TORRENTS)
$torrents = DB()->fetch_rowset($sql);
DB()->sql_freeresult();
-
+
foreach ($torrents as $torrent)
{
$torrent['topic_id'] = $torrent['id'] + $max_topic_id;
@@ -219,16 +219,16 @@ if (CONVERT_TORRENTS)
$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);
-
+
for ($i = 0; $i < $loops; $i++)
{
$start = $i * C_COMMENTS_PER_ONCE;
- $offset = C_COMMENTS_PER_ONCE;
+ $offset = C_COMMENTS_PER_ONCE;
$sql = "
- SELECT
+ SELECT
c.id, c.user, c.torrent, c.text, tor.category,
UNIX_TIMESTAMP(c.added) AS added, UNIX_TIMESTAMP(c.editedat) AS editedat, c.ip
FROM ". TB_COMMENTS_TABLE ." c
@@ -236,10 +236,10 @@ if (CONVERT_TORRENTS)
WHERE c.torrent <> 0
ORDER BY c.id
LIMIT $start, $offset";
-
+
$comments = DB()->fetch_rowset($sql);
DB()->sql_freeresult();
-
+
foreach ($comments as $comment)
{
$comment['user'] += $max_uid;
diff --git a/other/converter/TBDevYSE_pre6/root/converter/functions.php b/other/converter/TBDevYSE_pre6/root/converter/functions.php
index f014f5307..65b1fde53 100644
--- a/other/converter/TBDevYSE_pre6/root/converter/functions.php
+++ b/other/converter/TBDevYSE_pre6/root/converter/functions.php
@@ -21,7 +21,7 @@ function hex2bin($h)
}
function get_max_val($table_name, $column)
-{
+{
$row = DB()->fetch_row("SELECT MAX($column) AS $column FROM $table_name LIMIT 1");
return $row[$column];
}
@@ -43,19 +43,9 @@ function set_auto_increment($table_name, $column, $val = null)
DB()->query("ALTER TABLE $table_name auto_increment = $val");
}
-//Users functions
+// Users functions
function tp_users_cleanup()
{
- /*
- if (!function_exists('user_delete')) require_once(INC_DIR .'functions_admin.php');
-
- 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 '. BB_USERS .' WHERE user_id NOT IN('. EXCLUDED_USERS_CSV .')');
DB()->query('TRUNCATE '. BB_BT_USERS);
}
@@ -91,7 +81,7 @@ function convert_user($user)
"user_id" => $user['id'],
"user_active" => ($user['enabled'] == 'yes') ? true : false,
"username" => $user['username'],
- "user_password" => md5($user['password']),
+ "user_password" => md5($user['password']),
"user_lastvisit" => $user['last_access'],
"user_regdate" => $user['added'],
"user_level" => tp_user_level($user['class']),
@@ -101,11 +91,11 @@ function convert_user($user)
"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_website" => $user['website'],
);
$columns = $values = array();
-
+
foreach ($user_data as $column => $value)
{
$columns[] = $column;
@@ -113,9 +103,9 @@ function convert_user($user)
}
$sql_columns = implode(',', $columns);
$sql_values = implode(',', $values);
-
+
DB()->query("INSERT IGNORE INTO ". BB_USERS . " ($sql_columns) VALUES($sql_values);");
-
+
$bt_user_data = array(
"user_id" => $user['id'],
"auth_key" => make_rand_str(BT_AUTH_KEY_LENGTH),
@@ -123,7 +113,7 @@ function convert_user($user)
"u_down_total" => $user['downloaded'],
);
$columns = $values = array();
-
+
foreach ($bt_user_data as $column => $value)
{
$columns[] = $column;
@@ -131,7 +121,7 @@ function convert_user($user)
}
$sql_bt_columns = implode(',', $columns);
$sql_bt_values = implode(',', $values);
-
+
DB()->query("INSERT IGNORE INTO ". BB_BT_USERS . " ($sql_bt_columns) VALUES($sql_bt_values);");
}
@@ -143,7 +133,7 @@ function tp_categories_cleanup()
function tp_add_category_old($id, $cat_title)
{
- DB()->query("INSERT IGNORE INTO ". BB_CATEGORIES ." (cat_id, cat_title)
+ DB()->query("INSERT IGNORE INTO ". BB_CATEGORIES ." (cat_id, cat_title)
VALUES ($id, '". DB()->escape($cat_title) ."')");
return;
}
@@ -151,7 +141,7 @@ function tp_add_category_old($id, $cat_title)
function tp_add_category($cat_data)
{
$columns = $values = array();
-
+
foreach ($cat_data as $column => $value)
{
$columns[] = $column;
@@ -159,7 +149,7 @@ function tp_add_category($cat_data)
}
$sql_bt_columns = implode(',', $columns);
$sql_bt_values = implode(',', $values);
-
+
DB()->query("INSERT IGNORE INTO ". BB_CATEGORIES . " ($sql_bt_columns) VALUES($sql_bt_values);");
}
@@ -173,16 +163,7 @@ function tp_topics_cleanup()
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');
-
- if ($row = DB()->fetch_row("SELECT topic_id FROM ". BB_TOPICS))
- {
- foreach ($row as $topic)
- {
- topic_delete($topic['topic_id']);
- }
- }*/
-
+
return;
}
@@ -196,7 +177,7 @@ function tp_add_topic($topic_data)
}
$sql_columns = implode(',', $columns);
$sql_values = implode(',', $values);
-
+
DB()->query("INSERT IGNORE INTO ". BB_TOPICS . " ($sql_columns) VALUES($sql_values);");
return;
}
@@ -213,7 +194,7 @@ function tp_add_post($post_data)
}
$sql_columns = implode(',', $columns);
$sql_values = implode(',', $values);
-
+
DB()->query("INSERT IGNORE INTO bb_{$key} ($sql_columns) VALUES($sql_values);");
}
return;
@@ -231,7 +212,7 @@ function tp_add_attach($attach_data)
}
$sql_columns = implode(',', $columns);
$sql_values = implode(',', $values);
-
+
DB()->query("INSERT IGNORE INTO bb_{$key} ($sql_columns) VALUES($sql_values);");
}
return;
@@ -248,19 +229,19 @@ function append_images($tor)
{
$poster = $screens = '';
switch(TR_TYPE)
- {
+ {
case 'yse':
- if(!empty($tor['image1']))
+ if(!empty($tor['image1']))
{
$poster = "[img=right]".make_img_path($tor['image1'])."[/img]";
}
- if(!empty($tor['image2']))
+ if(!empty($tor['image2']))
{
$screens = '[spoiler="Скриншоты"][img]'.make_img_path($tor['image2'])."[/img][/spoiler]";
}
break;
case 'sky':
- if(!empty($tor['poster']))
+ if(!empty($tor['poster']))
{
$poster = "[img=right]".make_img_path($tor['poster'])."[/img]";
}
@@ -270,7 +251,7 @@ function append_images($tor)
$screens .= '[spoiler="Скриншоты"]';
for ($i = 1; $i<=4; $i++)
{
- if(!empty($tor['screenshot'.$i]))
+ if(!empty($tor['screenshot'.$i]))
{
$screens .= "[img]".make_img_path($tor['screenshot'.$i])."[/img] \n";
}
@@ -299,9 +280,8 @@ function convert_torrent($torrent)
"topic_last_post_time" => $torrent['added'],
);
tp_add_topic($topic_data);
- //$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(
"post_id" => $torrent['post_id'],
@@ -321,7 +301,7 @@ function convert_torrent($torrent)
),
);
tp_add_post($post_data);
-
+
$attach_data = array(
"attachments" => array(
"attach_id" => $torrent['attach_id'],
@@ -340,11 +320,11 @@ function convert_torrent($torrent)
),
);
tp_add_attach($attach_data);
-
+
//Torrents
if (BDECODE)
{
- $filename = get_attachments_dir() .'/'. $torrent['id'] .".torrent";
+ $filename = get_attachments_dir() .'/'. $torrent['id'] .".torrent";
if (!file_exists($filename))
{
return;
@@ -359,7 +339,7 @@ function convert_torrent($torrent)
{
$info_hash_sql = hex2bin($torrent['info_hash']);
}
-
+
$torrent_data = array(
"info_hash" => $info_hash_sql,
"post_id" => $torrent['post_id'],
@@ -374,7 +354,7 @@ function convert_torrent($torrent)
);
$columns = $values = array();
-
+
foreach ($torrent_data as $column => $value)
{
$columns[] = $column;
@@ -382,16 +362,16 @@ function convert_torrent($torrent)
}
$sql_columns = implode(', ', $columns);
$sql_values = implode(', ', $values);
-
+
DB()->query("INSERT IGNORE INTO ". BB_BT_TORRENTS . " ($sql_columns) VALUES($sql_values);");
return;
}
-//Comments functions
+// Comments functions
function convert_comment($comment)
{
$post_text = prepare_message($comment['text'], true, true);
-
+
$post_data = array(
"posts" => array(
"post_id" => $comment['id'],
@@ -409,7 +389,6 @@ function convert_comment($comment)
),
);
tp_add_post($post_data);
- //add_search_words($comment['id'], stripslashes($post_text));
return;
}
@@ -431,7 +410,7 @@ function convert_cat($forum, $allow_torrents = true)
);
$columns = $values = array();
-
+
foreach ($forum_data as $column => $value)
{
$columns[] = $column;
@@ -439,7 +418,7 @@ function convert_cat($forum, $allow_torrents = true)
}
$sql_columns = implode(',', $columns);
$sql_values = implode(',', $values);
-
+
DB()->query("INSERT IGNORE INTO ". BB_FORUMS . " ($sql_columns) VALUES($sql_values);");
return;
}
diff --git a/other/converter/TBDevYSE_pre6/root/converter/passwords.php b/other/converter/TBDevYSE_pre6/root/converter/passwords.php
index 5f7aafe87..63c2de744 100644
--- a/other/converter/TBDevYSE_pre6/root/converter/passwords.php
+++ b/other/converter/TBDevYSE_pre6/root/converter/passwords.php
@@ -1,2 +1,3 @@
-fetch_rowset($sql);
DB()->sql_freeresult();
-
+
foreach ($torrents as $torrent)
{
- $filename = $attach_dir . $torrent['physical_filename'];
+ $filename = $attach_dir . $torrent['physical_filename'];
if (!file_exists($filename))
{
$not_exist[] = ''. $filename .'';
}
else
- {
+ {
$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), ' ');
-
+
DB()->query("UPDATE ". BB_BT_TORRENTS ."
SET info_hash = '$info_hash_sql'
WHERE attach_id = {$torrent['attach_id']}");
@@ -91,9 +91,9 @@ for ($i = 0; $i < $loops; $i++)
print_ok ("Completed");
-if(!empty($not_exist))
+if (!empty($not_exist))
{
print_ok ("These torrents doesn't exist in filesystem: ". implode(', ', array_unique($not_exist)));
}
-}
+}
\ No newline at end of file
diff --git a/other/recover/converter/functions.php b/other/recover/converter/functions.php
index ebed5f614..640832cab 100644
--- a/other/recover/converter/functions.php
+++ b/other/recover/converter/functions.php
@@ -100,7 +100,7 @@ function convert_user($user)
);
$columns = $values = array();
-
+
foreach ($user_data as $column => $value)
{
$columns[] = $column;
@@ -108,9 +108,9 @@ function convert_user($user)
}
$sql_columns = implode(',', $columns);
$sql_values = implode(',', $values);
-
+
DB()->query("INSERT IGNORE INTO ". BB_USERS . " ($sql_columns) VALUES ($sql_values);");
-
+
$bt_user_data = array(
"user_id" => $user['id'],
"auth_key" => make_rand_str(BT_AUTH_KEY_LENGTH),
@@ -118,7 +118,7 @@ function convert_user($user)
"u_down_total" => $user['downloaded'],
);
$columns = $values = array();
-
+
foreach ($bt_user_data as $column => $value)
{
$columns[] = $column;
@@ -126,7 +126,7 @@ function convert_user($user)
}
$sql_bt_columns = implode(',', $columns);
$sql_bt_values = implode(',', $values);
-
+
DB()->query("INSERT IGNORE INTO ". BB_BT_USERS . " ($sql_bt_columns) VALUES ($sql_bt_values);");
}
@@ -138,7 +138,7 @@ function tp_categories_cleanup()
function tp_add_category_old($id, $cat_title)
{
- DB()->query("INSERT IGNORE INTO ". BB_CATEGORIES ." (cat_id, cat_title)
+ DB()->query("INSERT IGNORE INTO ". BB_CATEGORIES ." (cat_id, cat_title)
VALUES ($id, '". DB()->escape($cat_title) ."')");
return;
}
@@ -146,7 +146,7 @@ function tp_add_category_old($id, $cat_title)
function tp_add_category($cat_data)
{
$columns = $values = array();
-
+
foreach ($cat_data as $column => $value)
{
$columns[] = $column;
@@ -154,12 +154,12 @@ function tp_add_category($cat_data)
}
$sql_bt_columns = implode(',', $columns);
$sql_bt_values = implode(',', $values);
-
+
DB()->query("INSERT IGNORE INTO ". BB_CATEGORIES . " ($sql_bt_columns) VALUES ($sql_bt_values);");
}
function tp_topics_cleanup()
-{
+{
DB()->query("TRUNCATE ". BB_ATTACHMENTS);
DB()->query("TRUNCATE ". BB_ATTACHMENTS_DESC);
DB()->query("TRUNCATE ". BB_BT_TORRENTS);
@@ -168,21 +168,12 @@ function tp_topics_cleanup()
DB()->query("TRUNCATE ". BB_POSTS_SEARCH);
DB()->query("TRUNCATE ". BB_POSTS_TEXT);
DB()->query("TRUNCATE ". BB_TOPICS);
- /*if (!function_exists('topic_delete')) require_once('./includes/functions_admin.php');
-
- if ($row = DB()->fetch_row("SELECT topic_id FROM ". TOPICS))
- {
- foreach ($row as $topic)
- {
- topic_delete($topic['topic_id']);
- }
- }*/
-
+
return;
}
function tp_add_topic($topic_data)
-{
+{
$columns = $values = array();
foreach ($topic_data as $column => $value)
{
@@ -191,13 +182,13 @@ function tp_add_topic($topic_data)
}
$sql_columns = implode(',', $columns);
$sql_values = implode(',', $values);
-
+
DB()->query("INSERT IGNORE INTO ". BB_TOPICS . " ($sql_columns) VALUES ($sql_values);");
return;
}
function tp_add_post($post_data)
-{
+{
foreach ($post_data as $key => $data)
{
$columns = $values = array();
@@ -208,14 +199,14 @@ function tp_add_post($post_data)
}
$sql_columns = implode(',', $columns);
$sql_values = implode(',', $values);
-
+
DB()->query("INSERT IGNORE INTO bb_{$key} ($sql_columns) VALUES ($sql_values);");
}
return;
}
function tp_add_attach($attach_data)
-{
+{
foreach ($attach_data as $key => $data)
{
$columns = $values = array();
@@ -226,7 +217,7 @@ function tp_add_attach($attach_data)
}
$sql_columns = implode(',', $columns);
$sql_values = implode(',', $values);
-
+
DB()->query("INSERT IGNORE INTO bb_{$key} ($sql_columns) VALUES ($sql_values);");
}
return;
@@ -243,19 +234,19 @@ function append_images($tor)
{
$poster = $screens = '';
switch(TR_TYPE)
- {
+ {
case 'yse':
- if(!empty($tor['image1']))
+ if(!empty($tor['image1']))
{
$poster = "[img=right]".make_img_path($tor['image1'])."[/img]";
}
- if(!empty($tor['image2']))
+ if(!empty($tor['image2']))
{
$screens = '[spoiler="Скриншоты"][img]'.make_img_path($tor['image2'])."[/img][/spoiler]";
}
break;
case 'sky':
- if(!empty($tor['poster']))
+ if(!empty($tor['poster']))
{
$poster = "[img=right]".make_img_path($tor['poster'])."[/img]";
}
@@ -265,7 +256,7 @@ function append_images($tor)
$screens .= '[spoiler="Скриншоты"]';
for ($i = 1; $i<=4; $i++)
{
- if(!empty($tor['screenshot'.$i]))
+ if(!empty($tor['screenshot'.$i]))
{
$screens .= "[img]".make_img_path($tor['screenshot'.$i])."[/img] \n";
}
@@ -294,9 +285,9 @@ function convert_torrent($torrent)
"topic_last_post_time" => $torrent['added'],
);
tp_add_topic($topic_data);
-
+
$post_text = stripslashes(prepare_message(addslashes(unprepare_message($torrent['descr'])), true, true));
-
+
$post_data = array(
"posts" => array(
"post_id" => $torrent['post_id'],
@@ -316,7 +307,7 @@ function convert_torrent($torrent)
),
);
tp_add_post($post_data);
-
+
$attach_data = array(
"attachments" => array(
"attach_id" => $torrent['attach_id'],
@@ -335,11 +326,11 @@ function convert_torrent($torrent)
),
);
tp_add_attach($attach_data);
-
+
//Torrents
if (BDECODE)
{
- $filename = get_attachments_dir() .'/'. $torrent['id'] .".torrent";
+ $filename = get_attachments_dir() .'/'. $torrent['id'] .".torrent";
if (!file_exists($filename))
{
return;
@@ -354,7 +345,7 @@ function convert_torrent($torrent)
{
$info_hash_sql = hex2bin($torrent['info_hash']);
}
-
+
$torrent_data = array(
"info_hash" => $info_hash_sql,
"post_id" => $torrent['post_id'],
@@ -362,14 +353,14 @@ function convert_torrent($torrent)
"topic_id" => $torrent['topic_id'],
"forum_id" => $torrent['category'],
"attach_id" => $torrent['attach_id'],
- "size" => $torrent['size'],
+ "size" => $torrent['size'],
"reg_time" => $torrent['added'],
"complete_count" => $torrent['times_completed'],
"seeder_last_seen" => $torrent['lastseed'],
);
$columns = $values = array();
-
+
foreach ($torrent_data as $column => $value)
{
$columns[] = $column;
@@ -377,7 +368,7 @@ function convert_torrent($torrent)
}
$sql_columns = implode(', ', $columns);
$sql_values = implode(', ', $values);
-
+
DB()->query("INSERT IGNORE INTO ". BB_BT_TORRENTS . " ($sql_columns) VALUES($sql_values);");
return;
}
@@ -386,7 +377,7 @@ function convert_torrent($torrent)
function convert_comment($comment)
{
$post_text = prepare_message($comment['text'], true, true);
-
+
$post_data = array(
"posts" => array(
"post_id" => $comment['id'],
@@ -404,13 +395,12 @@ function convert_comment($comment)
),
);
tp_add_post($post_data);
- //add_search_words($comment['id'], stripslashes($post_text));
return;
}
//Forums functions
function tp_forums_cleanup()
-{
+{
DB()->query('TRUNCATE '. BB_FORUMS);
}
@@ -426,7 +416,7 @@ function convert_cat($forum, $allow_torrents = true)
);
$columns = $values = array();
-
+
foreach ($forum_data as $column => $value)
{
$columns[] = $column;
@@ -434,7 +424,7 @@ function convert_cat($forum, $allow_torrents = true)
}
$sql_columns = implode(',', $columns);
$sql_values = implode(',', $values);
-
+
DB()->query("INSERT IGNORE INTO ". BB_FORUMS . " ($sql_columns) VALUES ($sql_values);");
return;
-}
+}
\ No newline at end of file
diff --git a/other/recover/converter/passwords.php b/other/recover/converter/passwords.php
index 5f7aafe87..63c2de744 100644
--- a/other/recover/converter/passwords.php
+++ b/other/recover/converter/passwords.php
@@ -1,2 +1,3 @@
-session_start();
@@ -52,36 +51,36 @@ $loops = (int) ceil($torrents_count / C_TORRENTS_PER_ONCE);
$not_exist = array();
$attach_dir = get_attachments_dir() .'/';
-
+
for ($i = 0; $i < $loops; $i++)
{
$start = $i * C_TORRENTS_PER_ONCE;
- $offset = C_TORRENTS_PER_ONCE;
-
- $sql = "SELECT
+ $offset = C_TORRENTS_PER_ONCE;
+
+ $sql = "SELECT
tor.attach_id, tor.topic_id, ad.physical_filename
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();
-
+
foreach ($torrents as $torrent)
{
- $filename = $attach_dir . $torrent['physical_filename'];
+ $filename = $attach_dir . $torrent['physical_filename'];
if (!file_exists($filename))
{
$not_exist[] = ''. $filename .'';
}
else
- {
+ {
$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), ' ');
-
+
DB()->query("UPDATE ". BB_BT_TORRENTS ."
SET info_hash = '$info_hash_sql'
WHERE attach_id = {$torrent['attach_id']}");
@@ -91,9 +90,9 @@ for ($i = 0; $i < $loops; $i++)
print_ok ("Completed");
-if(!empty($not_exist))
+if (!empty($not_exist))
{
print_ok ("These torrents doesn't exist in filesystem: ". implode(', ', array_unique($not_exist)));
}
-}
+}
\ No newline at end of file
diff --git a/readme.txt b/readme.txt
index fd68905d4..568d8cf97 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,58 +1,3 @@
-********************
-** Установка **
-********************
+Для получения информации об установке движка, откройте в своем браузере указаную ссылку:
-Распаковываем на сервер содержимое папки upload.
-Заходим в phpmyadmin, открываем или создаем новую базу, потом импортируем дамп (install/sql/mysql.sql)
-Правим файл конфигурации config.php (изменяем данные входа в БД, остальное по усмотрению)
-
-* Файлы favicon.ico (меняем на свою иконку, если есть), robots.txt(допуск или запрет ботам поисковиков к серверу, блокирует не все, меняем адреса в строках Host: и Sitemap: на свои адреса)
-
-************************************
-** Права доступа на папки и файлы **
-************************************
-
-Устанавливаем права доступа на данные папки 777, на файлы внутри этих папок (кроме .htaccess) 666:
-- ajax/html
-- cache
-- cache/filecache
-- files
-- files/thumbs
-- images
-- images/avatars
-- images/captcha
-- images/ranks
-- images/smiles
-- log
-- triggers
-
-************************************
-** Необходимые значения в php.ini **
-************************************
-
-mbstring.internal_encoding = UTF-8
-magic_quotes_gpc = Off
-
-************************************
-** Необходимые модули для php **
-************************************
-
-php5-tidy
-
-************************************
-** Необходимый запуск cron.php **
-************************************
-
-Подробнее в теме http://torrentpier.me/threads/Отвязка-запуск-крона.52/
-
-************************************
-** Часто задаваемые вопросы **
-************************************
-
-http://torrentpier.me/threads/faq-для-новичков.260/
-
-************************************
-** Где задать вопрос **
-************************************
-
-http://torrentpier.me/forums/Основные-вопросы-по-torrentpier-ii.10/
\ No newline at end of file
+https://github.com/torrentpier/tracker/tree/master#torrentpier-ii
\ No newline at end of file
diff --git a/upload/admin/admin_attach_cp.php b/upload/admin/admin_attach_cp.php
index 6468f72e2..a285d4fc6 100644
--- a/upload/admin/admin_attach_cp.php
+++ b/upload/admin/admin_attach_cp.php
@@ -20,7 +20,7 @@ else
$upload_dir = '../' . $attach_config['upload_dir'];
}
-include(BB_ROOT .'attach_mod/includes/functions_selects.php');
+include(ATTACH_DIR .'includes/functions_selects.php');
// Check if the language got included
if (!isset($lang['TEST_SETTINGS_SUCCESSFUL']))
@@ -76,7 +76,6 @@ else
$sort_order = 'ASC';
}
-
// Pagination ?
$do_pagination = ($view != 'stats' && $view != 'search') ? true : false;
diff --git a/upload/admin/admin_attachments.php b/upload/admin/admin_attachments.php
index 9550e5db6..adf1bd92a 100644
--- a/upload/admin/admin_attachments.php
+++ b/upload/admin/admin_attachments.php
@@ -23,7 +23,7 @@ else
$upload_dir = '../' . $attach_config['upload_dir'];
}
-include(BB_ROOT .'attach_mod/includes/functions_selects.php');
+include(ATTACH_DIR .'includes/functions_selects.php');
// Check if the language got included
if (!isset($lang['TEST_SETTINGS_SUCCESSFUL']))
diff --git a/upload/admin/admin_board.php b/upload/admin/admin_board.php
index 074c83457..32761b3d4 100644
--- a/upload/admin/admin_board.php
+++ b/upload/admin/admin_board.php
@@ -40,9 +40,7 @@ else
if (isset($_POST['submit']) && $row['config_value'] != $new[$config_name])
{
- if ($config_name == 'seed_bonus_points' || $config_name == 'seed_bonus_release') $new[$config_name] = serialize($new[$config_name]);
- if ($config_name == 'bonus_upload' || $config_name == 'bonus_upload_price') $new[$config_name] = serialize($new[$config_name]);
-
+ if ($config_name == ('seed_bonus_points' || 'seed_bonus_release' || 'bonus_upload' || 'bonus_upload_price')) $new[$config_name] = serialize(str_replace(',', '.', $new[$config_name]));
bb_update_config(array($config_name => $new[$config_name]));
}
}
@@ -89,7 +87,7 @@ switch($mode)
if ($new['seed_bonus_points'] && $new['seed_bonus_release'])
{
- $seed_bonus = unserialize($new['seed_bonus_points']);
+ $seed_bonus = unserialize($new['seed_bonus_points']);
$seed_release = unserialize($new['seed_bonus_release']);
foreach ($seed_bonus as $i => $row)
@@ -106,7 +104,7 @@ switch($mode)
if ($new['bonus_upload'] && $new['bonus_upload_price'])
{
$upload_row = unserialize($new['bonus_upload']);
- $price_row = unserialize($new['bonus_upload_price']);
+ $price_row = unserialize($new['bonus_upload_price']);
foreach ($upload_row as $i => $row)
{
diff --git a/upload/admin/admin_extensions.php b/upload/admin/admin_extensions.php
index d894660d9..9092c3aee 100644
--- a/upload/admin/admin_extensions.php
+++ b/upload/admin/admin_extensions.php
@@ -26,7 +26,7 @@ else
$upload_dir = BB_ROOT . $attach_config['upload_dir'];
}
-include(BB_ROOT .'attach_mod/includes/functions_selects.php');
+include(ATTACH_DIR .'includes/functions_selects.php');
// Check if the language got included
if (!isset($lang['TEST_SETTINGS_SUCCESSFUL']))
diff --git a/upload/admin/admin_forumauth_list.php b/upload/admin/admin_forumauth_list.php
index d981ad6c4..846805280 100644
--- a/upload/admin/admin_forumauth_list.php
+++ b/upload/admin/admin_forumauth_list.php
@@ -9,7 +9,6 @@ if (!empty($setmodules))
require('./pagestart.php');
// ACP Header - END
-
// View Read Post Reply Edit Delete Sticky Announce Vote Poll PostAttach Download
$simple_auth_ary = array(
/* Public */ 0 => array(AUTH_ALL, AUTH_ALL, AUTH_ALL, AUTH_ALL, AUTH_REG, AUTH_REG, AUTH_MOD, AUTH_MOD, AUTH_REG, AUTH_REG, AUTH_REG, AUTH_ALL), // Public
diff --git a/upload/admin/admin_forums.php b/upload/admin/admin_forums.php
index 44d9c7906..c3264607f 100644
--- a/upload/admin/admin_forums.php
+++ b/upload/admin/admin_forums.php
@@ -951,7 +951,6 @@ function renumber_order ($mode, $cat = 0)
}
$sql .= " ORDER BY $orderfield ASC";
-
if (!$result = DB()->sql_query($sql))
{
bb_die('Could not get list of categories / forums #2');
diff --git a/upload/admin/admin_log.php b/upload/admin/admin_log.php
index 46d4f010f..4dcb6f772 100644
--- a/upload/admin/admin_log.php
+++ b/upload/admin/admin_log.php
@@ -245,7 +245,6 @@ else
generate_pagination($url, $items_count, $per_page, $start);
-
$filter = array();
if ($log_rowset)
diff --git a/upload/admin/admin_mass_email.php b/upload/admin/admin_mass_email.php
index d2d8debb4..884a738ba 100644
--- a/upload/admin/admin_mass_email.php
+++ b/upload/admin/admin_mass_email.php
@@ -36,10 +36,10 @@ if (isset($_POST['submit']))
if ($group_id != -1)
{
$user_list = DB()->fetch_rowset("
- SELECT u.username, u.user_email, u.user_lang
- FROM ". BB_USERS ." u, ". BB_USER_GROUP ." ug
- WHERE ug.group_id = $group_id
- AND ug.user_pending = 0
+ SELECT u.username, u.user_email, u.user_lang
+ FROM ". BB_USERS ." u, ". BB_USER_GROUP ." ug
+ WHERE ug.group_id = $group_id
+ AND ug.user_pending = 0
AND u.user_id = ug.user_id
AND u.user_active = 1
AND u.user_id NOT IN(". EXCLUDED_USERS_CSV . $user_id_sql .")
@@ -48,8 +48,8 @@ if (isset($_POST['submit']))
else
{
$user_list = DB()->fetch_rowset("
- SELECT username, user_email, user_lang
- FROM ". BB_USERS ."
+ SELECT username, user_email, user_lang
+ FROM ". BB_USERS ."
WHERE user_active = 1
AND user_id NOT IN(". EXCLUDED_USERS_CSV . $user_id_sql .")
");
diff --git a/upload/admin/admin_ranks.php b/upload/admin/admin_ranks.php
index 2c3e9f8aa..220d1e8f8 100644
--- a/upload/admin/admin_ranks.php
+++ b/upload/admin/admin_ranks.php
@@ -36,7 +36,6 @@ else
}
}
-
if ($mode != '')
{
if ($mode == 'edit' || $mode == 'add')
diff --git a/upload/admin/admin_sitemap.php b/upload/admin/admin_sitemap.php
new file mode 100644
index 000000000..122178815
--- /dev/null
+++ b/upload/admin/admin_sitemap.php
@@ -0,0 +1,52 @@
+sql_query($sql))
+{
+ bb_die('Could not query config information in admin_sitemap');
+}
+else
+{
+ $new_params = array();
+
+ while ($row = DB()->sql_fetchrow($result))
+ {
+ $config_name = $row['config_name'];
+ $config_value = $row['config_value'];
+ $default_config[$config_name] = $config_value;
+ $new[$config_name] = isset($_POST[$config_name]) ? $_POST[$config_name] : $default_config[$config_name];
+
+ if (isset($_POST['submit']) && $row['config_value'] != $new[$config_name])
+ {
+ $new_params[$config_name] = $new[$config_name];
+ }
+ }
+
+ if (isset($_POST['submit']))
+ {
+ if (!empty($new_params))
+ {
+ bb_update_config($new_params);
+ }
+ }
+}
+
+$s_mess = $lang['SITEMAP_CREATED'].': '.bb_date($new['sitemap_time'], $bb_cfg['post_date_format']).' '.$lang['SITEMAP_AVAILABLE'].': '.make_url('/sitemap/sitemap.xml').'';
+$message = (@file_exists(BB_ROOT. "/sitemap/sitemap.xml")) ? $s_mess : $lang['SITEMAP_NOT_CREATED'];
+
+$template->assign_vars(array(
+ 'STATIC_SITEMAP' => $new['static_sitemap'],
+ 'MESSAGE' => $message,
+));
+
+print_page('admin_sitemap.tpl', 'admin');
\ No newline at end of file
diff --git a/upload/admin/admin_user_search.php b/upload/admin/admin_user_search.php
index 51b31f0e3..b4113f27d 100644
--- a/upload/admin/admin_user_search.php
+++ b/upload/admin/admin_user_search.php
@@ -795,10 +795,7 @@ else
$base_url .= '&search_moderators=true&moderators_forum='. rawurlencode(stripslashes($moderators_forum));
$moderators_forum = intval($moderators_forum);
- $sql = "SELECT forum_name
- FROM ".BB_FORUMS."
- WHERE forum_id = ".$moderators_forum;
-
+ $sql = "SELECT forum_name FROM ".BB_FORUMS." WHERE forum_id = ".$moderators_forum;
if (!$result = DB()->sql_query($sql))
{
diff --git a/upload/admin/pagestart.php b/upload/admin/pagestart.php
index 735740990..40449b461 100644
--- a/upload/admin/pagestart.php
+++ b/upload/admin/pagestart.php
@@ -5,8 +5,8 @@ define('IN_FORUM', true);
define('IN_ADMIN', true);
require(BB_ROOT .'common.php');
-require(BB_ROOT .'attach_mod/attachment_mod.php');
-require(BB_ROOT .'attach_mod/includes/functions_admin.php');
+require(ATTACH_DIR .'attachment_mod.php');
+require(ATTACH_DIR .'includes/functions_admin.php');
require_once(INC_DIR .'functions_admin.php');
$user->session_start();
diff --git a/upload/ajax.php b/upload/ajax.php
index 27fad90d5..62c742b9f 100644
--- a/upload/ajax.php
+++ b/upload/ajax.php
@@ -34,12 +34,12 @@ switch ($ajax->action)
case 'mod_action':
case 'change_tor_status':
case 'gen_passkey':
- require(BB_ROOT . 'attach_mod/attachment_mod.php');
+ require(ATTACH_DIR . 'attachment_mod.php');
require(INC_DIR . 'functions_torrent.php');
break;
case 'change_torrent':
- require(BB_ROOT . 'attach_mod/attachment_mod.php');
+ require(ATTACH_DIR . 'attachment_mod.php');
require(INC_DIR . 'functions_torrent.php');
break;
@@ -55,6 +55,10 @@ switch ($ajax->action)
case 'group_membership':
require(INC_DIR . 'functions_group.php');
break;
+
+ case 'sitemap';
+ require(INC_DIR .'class.sitemap.php');
+ break;
}
// position in $ajax->valid_actions['xxx']
@@ -78,6 +82,7 @@ class ajax_common
'change_user_opt' => array('admin'),
'manage_user' => array('admin'),
'manage_admin' => array('admin'),
+ 'sitemap' => array('admin'),
'mod_action' => array('mod'),
'topic_tpl' => array('mod'),
@@ -116,7 +121,7 @@ class ajax_common
global $lang;
// Exit if we already have errors
- if (!empty($this->response['error_code']))
+ if (!empty($this->response['error_code']))
{
$this->send();
}
@@ -127,7 +132,7 @@ class ajax_common
if (!$action || !is_string($action))
{
$this->ajax_die('no action specified');
- }
+ }
elseif (!$action_params =& $this->valid_actions[$action])
{
$this->ajax_die('invalid action: ' . $action);
@@ -406,4 +411,9 @@ class ajax_common
{
require(AJAX_DIR . 'chat.php');
}
+
+ function sitemap()
+ {
+ require(AJAX_DIR .'sitemap.php');
+ }
}
\ No newline at end of file
diff --git a/upload/ajax/edit_user_profile.php b/upload/ajax/edit_user_profile.php
index 9f9aaec76..04e11f890 100644
--- a/upload/ajax/edit_user_profile.php
+++ b/upload/ajax/edit_user_profile.php
@@ -148,7 +148,7 @@ switch ($field)
$btu[$field] = $value;
$this->response['update_ids']['u_ratio'] = (string) get_bt_ratio($btu);
break;
-
+
case 'user_points':
$value = htmlCHR($value);
$value = (float) str_replace(',', '.', $this->request['value']);
diff --git a/upload/ajax/mod_action.php b/upload/ajax/mod_action.php
index f295ba29a..80153be06 100644
--- a/upload/ajax/mod_action.php
+++ b/upload/ajax/mod_action.php
@@ -72,13 +72,13 @@ switch ($mode)
if (!$user_id) $this->ajax_die($lang['NO_USER_ID_SPECIFIED']);
$reg_ip = DB()->fetch_rowset("SELECT username, user_id, user_rank FROM ". BB_USERS ."
- WHERE user_reg_ip = '{$profiledata['user_reg_ip']}'
+ WHERE user_reg_ip = '{$profiledata['user_reg_ip']}'
AND user_reg_ip != ''
AND user_id != {$profiledata['user_id']}
ORDER BY username ASC");
- $last_ip = DB()->fetch_rowset("SELECT username, user_id, user_rank FROM " .BB_USERS ."
- WHERE user_last_ip = '{$profiledata['user_last_ip']}'
+ $last_ip = DB()->fetch_rowset("SELECT username, user_id, user_rank FROM " .BB_USERS ."
+ WHERE user_last_ip = '{$profiledata['user_last_ip']}'
AND user_last_ip != ''
AND user_id != {$profiledata['user_id']}");
@@ -101,7 +101,7 @@ switch ($mode)
$link_last_ip .= profile_url($row) .' ';
}
}
-
+
if ($profiledata['user_level'] == ADMIN && !IS_ADMIN) $reg_ip = $last_ip = $lang['HIDDEN'];
elseif ($profiledata['user_level'] == MOD && IS_MOD) $reg_ip = $last_ip = $lang['HIDDEN'];
else
diff --git a/upload/ajax/post_mod_comment.php b/upload/ajax/post_mod_comment.php
index d8ae99fc7..3cc5e0f5a 100644
--- a/upload/ajax/post_mod_comment.php
+++ b/upload/ajax/post_mod_comment.php
@@ -10,7 +10,7 @@ $mc_text = (string) $this->request['mc_text'];
if (!$mc_text = prepare_message($mc_text)) $this->ajax_die($lang['EMPTY_MESSAGE']);
$post = DB()->fetch_row("
- SELECT
+ SELECT
p.post_id, p.poster_id
FROM ". BB_POSTS ." p
WHERE p.post_id = $post_id
diff --git a/upload/ajax/sitemap.php b/upload/ajax/sitemap.php
new file mode 100644
index 000000000..b5aa40e2a
--- /dev/null
+++ b/upload/ajax/sitemap.php
@@ -0,0 +1,64 @@
+request['mode'];
+$map = new sitemap();
+$html = '';
+
+switch ($mode)
+{
+ case 'create':
+ $map->create();
+ if (@file_exists(BB_ROOT. "/sitemap/sitemap.xml"))
+ {
+ $html .= $lang['SITEMAP_CREATED'].': '.bb_date(TIMENOW, $bb_cfg['post_date_format']).' '.$lang['SITEMAP_AVAILABLE'].': '.make_url('/sitemap/sitemap.xml').'';
+ } else {
+ $html .= $lang['SITEMAP_NOT_CREATED'];
+ }
+ break;
+
+ case 'search_update':
+ if (!@file_exists(BB_ROOT. "/sitemap/sitemap.xml"))
+ {
+ $map->create();
+ }
+
+ $map_link = make_url('/sitemap/sitemap.xml');
+
+ if (strpos($map->send_url("http://google.com/webmasters/sitemaps/ping?sitemap=", $map_link), "successfully added") !== false) {
+ $html .= '
'.$lang['SITEMAP_NOTIFY_SEARCH'].' Google: '.$lang['SITEMAP_SENT'].'';
+ } else {
+ $html .= '
'.$lang['SITEMAP_NOTIFY_SEARCH'].' Google: '.$lang['SITEMAP_ERROR'].' URL: http://google.com/webmasters/sitemaps/ping?sitemap='.$map_link.'';
+ }
+
+ if (strpos($map->send_url("http://ping.blogs.yandex.ru/ping?sitemap=", $map_link), "OK") !== false) {
+ $html .= '
'.$lang['SITEMAP_NOTIFY_SEARCH'].' Yandex: '.$lang['SITEMAP_SENT'].'';
+ } else {
+ $html .= '
'.$lang['SITEMAP_NOTIFY_SEARCH'].' Yandex: '.$lang['SITEMAP_ERROR'].' URL: http://ping.blogs.yandex.ru/ping?sitemap='.$map_link.'';
+ }
+
+ if ($map->send_url("http://www.bing.com/webmaster/ping.aspx?siteMap=", $map_link)) {
+ $html .= '
'.$lang['SITEMAP_NOTIFY_SEARCH'].' Bing: '.$lang['SITEMAP_SENT'].'';
+ } else {
+ $html .= '
'.$lang['SITEMAP_NOTIFY_SEARCH'].' Bing: '.$lang['SITEMAP_ERROR'].' URL: http://www.bing.com/webmaster/ping.aspx?siteMap='.$map_link.'';
+ }
+
+ if (strpos($map->send_url("http://rpc.weblogs.com/pingSiteForm?name=InfraBlog&url=", $map_link), "Thanks for the ping") !== false) {
+ $html .= '
'.$lang['SITEMAP_NOTIFY_SEARCH'].' Weblogs: '.$lang['SITEMAP_SENT'].'';
+ } else {
+ $html .= '
'.$lang['SITEMAP_NOTIFY_SEARCH'].' Weblogs: '.$lang['SITEMAP_ERROR'].' URL: http://rpc.weblogs.com/pingSiteForm?name=InfraBlog&url='.$map_link.'';
+ }
+
+ if ($map->send_url("http://search.yahooapis.com/SiteExplorerService/V1/ping?sitemap=", $map_link)) {
+ $html .= '
'.$lang['SITEMAP_NOTIFY_SEARCH'].' Yahoo: '.$lang['SITEMAP_SENT'].'';
+ } else {
+ $html .= '
'.$lang['SITEMAP_NOTIFY_SEARCH'].' Yahoo: '.$lang['SITEMAP_ERROR'].' URL: http://search.yahooapis.com/SiteExplorerService/V1/ping?sitemap='.$map_link.'';
+ }
+ break;
+}
+
+$this->response['html'] = $html;
+$this->response['mode'] = $mode;
\ No newline at end of file
diff --git a/upload/ajax/view_torrent.php b/upload/ajax/view_torrent.php
index cfd8657b2..5f9ed7227 100644
--- a/upload/ajax/view_torrent.php
+++ b/upload/ajax/view_torrent.php
@@ -10,6 +10,9 @@ if (!isset($this->request['attach_id']))
}
$attach_id = (int) $this->request['attach_id'];
+global $bnc_error;
+$bnc_error = 0;
+
$torrent = DB()->fetch_row("SELECT at.attach_id, at.physical_filename FROM ". BB_ATTACHMENTS_DESC ." at WHERE at.attach_id = $attach_id LIMIT 1");
if (!$torrent) $this->ajax_die($lang['EMPTY_ATTACH_ID']);
$filename = get_attachments_dir() .'/'. $torrent['physical_filename'];
@@ -79,7 +82,7 @@ class torrent
function build_filelist_array ()
{
global $lang;
-
+
$info = $this->tor_decoded['info'];
if (isset($info['name.utf-8']))
@@ -126,7 +129,8 @@ class torrent
{
if (is_string($cur_files_ary))
{
- bb_die($lang['ERROR_BUILD']);
+ $GLOBALS['bnc_error'] = 1;
+ break(1);
}
$cur_files_ary[] = $this->build_file_item($name, $length);
}
@@ -169,4 +173,6 @@ function clean_tor_dirname ($dirname)
return str_replace(array('[', ']', '<', '>', "'"), array('[', ']', '<', '>', '''), $dirname);
}
+if ($bnc_error) $tor_filelist = ''.$lang['ERROR_BUILD'].'
'.$tor_filelist;
+
$this->response['html'] = $tor_filelist;
\ No newline at end of file
diff --git a/upload/attach_mod/attachment_mod.php b/upload/attach_mod/attachment_mod.php
index 0e01672a6..3c87a76b0 100644
--- a/upload/attach_mod/attachment_mod.php
+++ b/upload/attach_mod/attachment_mod.php
@@ -2,11 +2,11 @@
if (!defined('IN_FORUM')) die("Hacking attempt");
-require(BB_ROOT .'attach_mod/includes/functions_includes.php');
-require(BB_ROOT .'attach_mod/includes/functions_attach.php');
-require(BB_ROOT .'attach_mod/includes/functions_delete.php');
-require(BB_ROOT .'attach_mod/includes/functions_thumbs.php');
-require(BB_ROOT .'attach_mod/includes/functions_filetypes.php');
+require(ATTACH_DIR .'includes/functions_includes.php');
+require(ATTACH_DIR .'includes/functions_attach.php');
+require(ATTACH_DIR .'includes/functions_delete.php');
+require(ATTACH_DIR .'includes/functions_thumbs.php');
+require(ATTACH_DIR .'includes/functions_filetypes.php');
if (defined('ATTACH_INSTALL'))
{
@@ -76,7 +76,7 @@ if (!($attach_config = CACHE('bb_cache')->get('attach_config')))
CACHE('bb_cache')->set('attach_config', $attach_config, 86400);
}
-include(BB_ROOT .'attach_mod/displaying.php');
-include(BB_ROOT .'attach_mod/posting_attachments.php');
+include(ATTACH_DIR .'displaying.php');
+include(ATTACH_DIR .'posting_attachments.php');
$upload_dir = $attach_config['upload_dir'];
\ No newline at end of file
diff --git a/upload/attach_mod/displaying.php b/upload/attach_mod/displaying.php
index 4c544a2a6..1efd81481 100644
--- a/upload/attach_mod/displaying.php
+++ b/upload/attach_mod/displaying.php
@@ -344,7 +344,7 @@ function display_attachments($post_id)
// bt
if ($link && ($attachments['_'. $post_id][$i]['extension'] === TORRENT_EXT))
{
- include(BB_ROOT .'attach_mod/displaying_torrent.php');
+ include(ATTACH_DIR .'displaying_torrent.php');
}
else if ($link)
{
diff --git a/upload/attach_mod/includes/functions_includes.php b/upload/attach_mod/includes/functions_includes.php
index 897a35760..a4e8708ad 100644
--- a/upload/attach_mod/includes/functions_includes.php
+++ b/upload/attach_mod/includes/functions_includes.php
@@ -1,21 +1,5 @@
_________________
';
-$bb_cfg['user_signature_end'] = ''; // Это позволит использовать html теги, которые требуют закрытия. Например