mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 20:17:24 +08:00
do not requre lang_functions in announce request
This commit is contained in:
+4
-1
@@ -5,5 +5,8 @@ namespace App\Models;
|
|||||||
|
|
||||||
class Post extends NexusModel
|
class Post extends NexusModel
|
||||||
{
|
{
|
||||||
|
public function user()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'userid');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -411,7 +411,7 @@ class User extends Authenticatable
|
|||||||
$comment = addslashes($comment);
|
$comment = addslashes($comment);
|
||||||
do_log("update: " . json_encode($update) . ", $commentField: $comment", 'notice');
|
do_log("update: " . json_encode($update) . ", $commentField: $comment", 'notice');
|
||||||
$update[$commentField] = NexusDB::raw("if($commentField = '', '$comment', concat_ws('\n', '$comment', $commentField))");
|
$update[$commentField] = NexusDB::raw("if($commentField = '', '$comment', concat_ws('\n', '$comment', $commentField))");
|
||||||
return $this->update($update);
|
return $this->update($update);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function canAccessAdmin()
|
public function canAccessAdmin()
|
||||||
|
|||||||
+5
-2
@@ -17,9 +17,12 @@ require $rootpath . 'include/eloquent.php';
|
|||||||
ini_set('date.timezone', nexus_config('nexus.timezone'));
|
ini_set('date.timezone', nexus_config('nexus.timezone'));
|
||||||
$Cache = new class_cache_redis(); //Load the caching class
|
$Cache = new class_cache_redis(); //Load the caching class
|
||||||
$Cache->setLanguageFolderArray(get_langfolder_list());
|
$Cache->setLanguageFolderArray(get_langfolder_list());
|
||||||
|
$script = nexus()->getScript();
|
||||||
|
if (!in_array($script, ['announce'])) {
|
||||||
|
require $rootpath . get_langfile_path("functions.php");
|
||||||
|
}
|
||||||
require $rootpath . 'include/config.php';
|
require $rootpath . 'include/config.php';
|
||||||
require $rootpath . get_langfile_path("functions.php");
|
if (!isRunningInConsole() && !in_array($script, ['announce', 'scrape', 'torrentrss', 'download'])) {
|
||||||
if (!isRunningInConsole() && !in_array(nexus()->getScript(), ['announce', 'scrape', 'torrentrss', 'download'])) {
|
|
||||||
checkGuestVisit();
|
checkGuestVisit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user