From d8a3f5270fb69e0c2ae3ca5ee96ec42c8347ac44 Mon Sep 17 00:00:00 2001 From: xiaomlove <353856593@qq.com> Date: Mon, 4 Jan 2021 14:21:15 +0800 Subject: [PATCH] fix announce --- include/bittorrent_announce.php | 22 ++++++++++++++++++++-- include/functions_announce.php | 3 ++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/include/bittorrent_announce.php b/include/bittorrent_announce.php index ce8656a2..44b0c81e 100644 --- a/include/bittorrent_announce.php +++ b/include/bittorrent_announce.php @@ -2,6 +2,24 @@ # IMPORTANT: Do not edit below unless you know what you are doing! define('IN_TRACKER', true); $rootpath=realpath(dirname(__FILE__) . '/..')."/"; -include($rootpath . 'include/core.php'); -include_once($rootpath . 'include/functions_announce.php'); + +require $rootpath . 'include/config.php'; +require $rootpath . 'include/functions.php'; +require $rootpath . 'include/globalfunctions.php'; +require $rootpath . get_langfile_path("functions.php"); + +require $rootpath . 'include/database/interface_db.php'; +require $rootpath . 'include/database/class_db_mysqli.php'; +require $rootpath . 'include/database/class_db.php'; +require $rootpath . 'include/database/helpers.php'; +require $rootpath . 'include/database/class_exception.php'; + +require $rootpath . 'classes/class_cache_redis.php'; + +require $rootpath . 'include/core.php'; +require $rootpath . 'include/functions_announce.php'; + +if (!session_id()) { + session_start(); +} ?> diff --git a/include/functions_announce.php b/include/functions_announce.php index 8df4e70e..6e2d458d 100644 --- a/include/functions_announce.php +++ b/include/functions_announce.php @@ -7,8 +7,9 @@ include_once($rootpath . 'include/config.php'); function dbconn_announce() { global $mysql_host, $mysql_user, $mysql_pass, $mysql_db; + global $BASIC; - if (!@mysql_connect($mysql_host, $mysql_user, $mysql_pass)) + if (!@mysql_connect($mysql_host, $mysql_user, $mysql_pass, $BASIC['mysql_db'], $BASIC['mysql_port'])) { die('dbconn: mysql_connect: ' . mysql_error()); }