mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-23 19:37:23 +08:00
fix announce for directory change
This commit is contained in:
@@ -12,7 +12,6 @@ set_include_path(get_include_path() . PATH_SEPARATOR . $rootpath);
|
||||
$rootpath .= "/";
|
||||
require $rootpath . 'include/functions.php';
|
||||
require $rootpath . 'include/globalfunctions.php';
|
||||
require $rootpath . get_langfile_path("functions.php");
|
||||
require $rootpath . 'include/core.php';
|
||||
|
||||
|
||||
|
||||
+1
-2
@@ -62,7 +62,7 @@ if (file_exists('config/allconfig.php')) {
|
||||
*/
|
||||
|
||||
//load settings from database
|
||||
if (basename($_SERVER['SCRIPT_FILENAME']) == 'announce.php') {
|
||||
if (IS_ANNOUNCE) {
|
||||
dbconn_announce();
|
||||
} else {
|
||||
dbconn();
|
||||
@@ -408,4 +408,3 @@ $useCronTriggerCleanUp = $MAIN['use_cron_trigger_cleanup'];
|
||||
//some promotion rules
|
||||
//$promotionrules_torrent = array(0 => array("mediumid" => array(1), "promotion" => 5), 1 => array("mediumid" => array(3), "promotion" => 5), 2 => array("catid" => array(402), "standardid" => array(3), "promotion" => 4), 3 => array("catid" => array(403), "standardid" => array(3), "promotion" => 4));
|
||||
$promotionrules_torrent = array();
|
||||
?>
|
||||
|
||||
@@ -9,6 +9,7 @@ if (!empty($_SERVER['HTTP_X_REQUEST_ID'])) {
|
||||
define('REQUEST_ID', intval(NEXUS_START * 10000));
|
||||
}
|
||||
define('ROOT_PATH', $rootpath);
|
||||
define('IS_ANNOUNCE', (basename($_SERVER['SCRIPT_FILENAME']) == 'announce.php'));
|
||||
|
||||
require $rootpath . 'include/database/interface_db.php';
|
||||
require $rootpath . 'include/database/class_db_mysqli.php';
|
||||
@@ -19,6 +20,9 @@ require $rootpath . 'include/database/class_exception.php';
|
||||
require $rootpath . 'classes/class_advertisement.php';
|
||||
require $rootpath . 'classes/class_cache_redis.php';
|
||||
require $rootpath . 'include/config.php';
|
||||
if (!IS_ANNOUNCE) {
|
||||
require $rootpath . get_langfile_path("functions.php");
|
||||
}
|
||||
|
||||
ini_set('display_errors', $TWEAK['display_errors']);
|
||||
|
||||
|
||||
@@ -2703,7 +2703,9 @@ function get_langid_from_langcookie()
|
||||
function make_folder($pre, $folder_name)
|
||||
{
|
||||
$path = $pre . $folder_name;
|
||||
if(!file_exists($path))
|
||||
$path = ROOT_PATH . ltrim($path, './');
|
||||
do_log($path);
|
||||
if(!is_dir($path))
|
||||
mkdir($path,0777,true);
|
||||
return $path;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ function block_browser()
|
||||
//else
|
||||
// $headers = emu_getallheaders();
|
||||
|
||||
if($_SERVER["HTTPS"] != "on")
|
||||
if(isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] != "on")
|
||||
{
|
||||
if (isset($headers["Cookie"]) || isset($headers["Accept-Language"]) || isset($headers["Accept-Charset"]))
|
||||
err("Anti-Cheater: You cannot use this agent");
|
||||
@@ -59,7 +59,7 @@ function benc_resp_raw($x) {
|
||||
header("Content-Type: text/plain; charset=utf-8");
|
||||
header("Pragma: no-cache");
|
||||
|
||||
if ($_SERVER["HTTP_ACCEPT_ENCODING"] == "gzip" && function_exists('gzencode')) {
|
||||
if (isset($_SERVER["HTTP_ACCEPT_ENCODING"]) && $_SERVER["HTTP_ACCEPT_ENCODING"] == "gzip" && function_exists('gzencode')) {
|
||||
header("Content-Encoding: gzip");
|
||||
echo gzencode($x, 9, FORCE_GZIP);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user