From 8b9903c09446fd563e00aceda9b53df21e8ef6e9 Mon Sep 17 00:00:00 2001 From: Exile Date: Sun, 13 Mar 2016 01:46:55 +0300 Subject: [PATCH] Old database aliases removed, link to the Crowding project and small changes in README. --- README.md | 13 ++++++++++--- ajax.php | 4 +++- library/includes/functions_torrent.php | 10 +++++----- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 241c91bc1..c3dc09ef2 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,16 @@ TorrentPier ====================== -[![Join the chat at https://gitter.im/torrentpier/torrentpier](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/torrentpier/torrentpier?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Crowdin](https://d322cqt584bo4o.cloudfront.net/torrentpier/localized.svg)](https://crowdin.com/project/torrentpier) [![Join the chat at https://gitter.im/torrentpier/torrentpier](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/torrentpier/torrentpier?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +## Current status + +TorrentPier is currently in active development. The goal is to remove all legacy code and rewrite existing to modern standards. If you want to go deep on the code, check out https://github.com/torrentpier/torrentpier/issues and go from there. The documentation will be translated into english in the near future, currently russian is the main language of project. + +## About + TorrentPier - движок торрент-трекера, написанный на php. Высокая скорость работы, простота модификации, устойчивость к высоким нагрузкам, в том числе и поддержка альтернативных анонсеров (например, Ocelot). Помимо этого, крайне развитый официальный форум поддержки, где помимо прочего можно испытать движок в работе на демо-версии, не устанавливая его, а также получить любую другую интересующую вас информацию и скачать моды. -## Установка +## Installation Для установки вам необходимо выполнить несколько простых шагов: @@ -36,7 +43,7 @@ TorrentPier - движок торрент-трекера, написанный ## Необходимая версия php -Минимально поддерживаемой версией в настоящий момент является 5.3. Существует поддержка вплоть до версии 5.5 (в данной версии в логах будет уведомление об использовании устаревших функций). Версия php 5.6 в настоящее время движком не поддерживается и его работа на ней не гарантируется. Мы делаем все возможное чтобы в самое ближайшее время добавить его поддержку. +Минимально поддерживаемой версией в настоящий момент является 5.5. Существует поддержка вплоть до версии 7.0. ## Необходимые настройки php diff --git a/ajax.php b/ajax.php index 34c61fb65..be55bfcc0 100644 --- a/ajax.php +++ b/ajax.php @@ -12,10 +12,12 @@ $ajax->init(); // Init userdata $user->session_start(); +$di = \TorrentPier\Di::getInstance(); + // Exit if board is disabled via ON/OFF trigger or by admin if ($ajax->action != 'manage_admin') { - if ($bb_cfg['board_disable']) + if ($di->config->get('board_disable')) { $ajax->ajax_die($lang['BOARD_DISABLE']); } diff --git a/library/includes/functions_torrent.php b/library/includes/functions_torrent.php index bf13d061c..3ada637c3 100644 --- a/library/includes/functions_torrent.php +++ b/library/includes/functions_torrent.php @@ -370,12 +370,12 @@ function send_torrent_with_passkey ($t_data) } // число скачиваний - $daily_dls_cnt = (int) DB('dls')->fetch_row("SELECT dls_cnt FROM ". BB_USER_DLS_DAILY ." WHERE user_id = $user_id LIMIT 1", 'dls_cnt'); + $daily_dls_cnt = (int) DB()->fetch_row("SELECT dls_cnt FROM ". BB_USER_DLS_DAILY ." WHERE user_id = $user_id LIMIT 1", 'dls_cnt'); if ($daily_dls_cnt >= $daily_dls_limit) { // повторное скачивание - $can_redownload = DB('dls')->fetch_row("SELECT 1 FROM ". BB_BT_DLS_COUNT ." WHERE topic_id = $topic_id AND user_id = $user_id LIMIT 1"); + $can_redownload = DB()->fetch_row("SELECT 1 FROM ". BB_BT_DLS_COUNT ." WHERE topic_id = $topic_id AND user_id = $user_id LIMIT 1"); if (!$can_redownload) { @@ -390,12 +390,12 @@ function send_torrent_with_passkey ($t_data) } // счетчик количества скачиваний торрент-файла (для `complete_count` в BB_BT_TORRENTS) - DB('dls')->query("INSERT IGNORE INTO ". BB_BT_DLS_COUNT ." (topic_id, user_id) VALUES ($topic_id, $user_id)"); + DB()->query("INSERT IGNORE INTO ". BB_BT_DLS_COUNT ." (topic_id, user_id) VALUES ($topic_id, $user_id)"); // если файл еще не был скачан этим юзером, увеличиваем счетчик скачиваний - if (DB('dls')->affected_rows() > 0) + if (DB()->affected_rows() > 0) { - DB('dls')->query(" + DB()->query(" INSERT IGNORE INTO ". BB_USER_DLS_DAILY ." (user_id, dls_cnt) VALUES ($user_id, 1) ON DUPLICATE KEY UPDATE dls_cnt = dls_cnt + 1 "); }