plugin management + user tables and torrents table text column migrate

This commit is contained in:
xiaomlove
2025-01-19 14:37:00 +08:00
parent 0f88ab8d82
commit 403a9447a9
66 changed files with 1432 additions and 786 deletions

View File

@@ -1,6 +1,6 @@
<?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.9.0');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-12-29');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2025-01-19');
defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");

View File

@@ -3363,16 +3363,17 @@ function linkcolor($num) {
}
function writecomment($userid, $comment, $oldModcomment = null) {
if (is_null($oldModcomment)) {
$res = sql_query("SELECT modcomment FROM users WHERE id = '$userid'") or sqlerr(__FILE__, __LINE__);
$arr = mysql_fetch_assoc($res);
$modcomment = date("Y-m-d") . " - " . $comment . "" . ($arr['modcomment'] != "" ? "\n" : "") . $arr['modcomment'];
} else {
$modcomment = date("Y-m-d") . " - " . $comment . "" . ($oldModcomment != "" ? "\n" : "") .$oldModcomment;
}
$modcom = sqlesc($modcomment);
do_log("update user: $userid prepend modcomment: $comment, with oldModcomment: $oldModcomment");
return sql_query("UPDATE users SET modcomment = $modcom WHERE id = '$userid'") or sqlerr(__FILE__, __LINE__);
\App\Models\UserModifyLog::query()->create(['user_id' => $userid, 'content' => date("Y-m-d") . " - " . $comment]);
// if (is_null($oldModcomment)) {
// $res = sql_query("SELECT modcomment FROM users WHERE id = '$userid'") or sqlerr(__FILE__, __LINE__);
// $arr = mysql_fetch_assoc($res);
// $modcomment = date("Y-m-d") . " - " . $comment . "" . ($arr['modcomment'] != "" ? "\n" : "") . $arr['modcomment'];
// } else {
// $modcomment = date("Y-m-d") . " - " . $comment . "" . ($oldModcomment != "" ? "\n" : "") .$oldModcomment;
// }
// $modcom = sqlesc($modcomment);
// do_log("update user: $userid prepend modcomment: $comment, with oldModcomment: $oldModcomment");
// return sql_query("UPDATE users SET modcomment = $modcom WHERE id = '$userid'") or sqlerr(__FILE__, __LINE__);
}
function return_torrent_bookmark_array($userid)

View File

@@ -264,6 +264,9 @@ function getLogFile($append = '')
if ($append) {
$name .= "-$append";
}
if (isRunningInConsole()) {
$name .= sprintf("-cli-%s-%s", get_current_user(), getmyuid());
}
$logFile = sprintf('%s-%s%s', $name, date('Y-m-d'), $suffix);
return $logFiles[$append] = $logFile;
@@ -1221,6 +1224,7 @@ function is_donor(array $userInfo): bool
}
/**
* @deprecated
* @param $authkey
* @return false|int|mixed|string|null
* @throws \App\Exceptions\NexusException