This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0310b7f
commit 5e8d90d
Showing
4 changed files
with
222 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,14 +13,14 @@ | |
* 请不要使用弱密码!否则后果自负! | ||
* 若只在局域网开放,则可根据个人喜好开启或关闭密码。 | ||
* | ||
* @version 1.4.2 | ||
* @version 1.4.3 | ||
* | ||
* @author Yuan_Tuo <[email protected]> | ||
* @link https://imwcr.cn/ | ||
* @link https://space.bilibili.com/88197958 | ||
* | ||
*/ | ||
define('programVersion', '1.4.2'); | ||
define('programVersion', '1.4.3'); | ||
if (!defined('init')) { // 直接访问处理程序 | ||
http_response_code(403); | ||
header('Content-Type: text/plain; charset=utf-8'); | ||
|
@@ -31,9 +31,19 @@ | |
define('BDUSS', ''); // 你的 BDUSS | ||
define('STOKEN', ''); // 你的 STOKEN | ||
define('SVIP_BDUSS', ''); // 你的 SVIP BDUSS | ||
define('IsCheckPassword', false); // 设为 true 则要求密码为变量 Password 的值,否则提示密码错误;设为 false 则不需要密码。 | ||
define('Password', '请在这里填写密码啦!ヾ(≧▽≦*)o'); // 在下载器首页需要输入的密码,如果将 IsCheckPassWord 设为 false 则无论设置什么都会失效。 | ||
define('IsCheckPassword', true); // 设为 true 则要求密码为变量 Password 的值,否则提示密码错误;设为 false 则不需要密码。 | ||
define('Password', '请在这里填写密码'); // 在下载器首页需要输入的密码,如果将 IsCheckPassWord 设为 false 则无论设置什么都会失效。 | ||
define('Footer', ''); // 页脚统计代码放置处 | ||
|
||
define('APP_ID', '250528'); // 推荐应用ID:498065、309847、778750(油猴脚本默认)、250528(官方)、265486、266719; | ||
define('DEBUG', false);//WARNING! 请勿随意打开此模式,可能造成你的信息泄露。 打开此模式前请先修改密码。 | ||
define('DEBUG', false);//WARNING! 请勿随意打开此模式,可能造成你的信息泄露。 打开此模式前请先修改密码。 | ||
|
||
|
||
define('USING_DB', false); //是否开启数据库功能 | ||
define('DbConfig', array( | ||
"servername" => "localhost", | ||
"username" => "", | ||
"password" => "", | ||
"dbname" => "", | ||
"dbtable" => "bdwp" | ||
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
* | ||
* 请勿随意修改此文件!如需更改相关配置请到 config.php ! | ||
* | ||
* @version 1.4.2 | ||
* @version 1.4.3 | ||
* | ||
* @author Yuan_Tuo <[email protected]> | ||
* @link https://imwcr.cn/ | ||
|
@@ -272,4 +272,28 @@ function get_BDCLND($surl) | |
} | ||
return ''; | ||
} | ||
} | ||
function connectdb(bool $isAPI = false) | ||
{ | ||
$servername = DbConfig["servername"]; | ||
$username = DbConfig["username"]; | ||
$password = DbConfig["password"]; | ||
$dbname = DbConfig["dbname"]; | ||
$GLOBALS['dbtable'] = DbConfig["dbtable"]; | ||
$conn = mysqli_connect($servername, $username, $password, $dbname); | ||
$GLOBALS['conn'] = $conn; | ||
// Check connection | ||
if (!$conn) { | ||
if ($isAPI) { | ||
//api特殊处理 | ||
EchoInfo(-1, array("msg" => "数据库连接失败:" . mysqli_connect_error(), "sviptips" => "Error")); | ||
exit; | ||
} else { | ||
dl_error("服务器错误", "数据库连接失败:" . mysqli_connect_error()); | ||
exit; | ||
} | ||
} | ||
mysqli_query($conn, "set sql_mode = ''"); | ||
mysqli_query($conn, "set character set 'utf8'"); | ||
mysqli_query($conn, "set names 'utf8'"); | ||
} |
Oops, something went wrong.