Merge branch 'php8' of https://github.com/koalang/nexusphp into php8

This commit is contained in:
tonghoil
2025-09-16 20:16:17 +08:00
2 changed files with 7 additions and 13 deletions
+6 -12
View File
@@ -421,8 +421,8 @@ if ($action == "post")
sql_query("UPDATE posts SET body=".sqlesc($body).", editdate=".sqlesc($date).", editedby=".sqlesc($CURUSER['id'])." WHERE id=".sqlesc($id)) or sqlerr(__FILE__, __LINE__); sql_query("UPDATE posts SET body=".sqlesc($body).", editdate=".sqlesc($date).", editedby=".sqlesc($CURUSER['id'])." WHERE id=".sqlesc($id)) or sqlerr(__FILE__, __LINE__);
$Cache->delete_value('post_'.$postid.'_content'); $Cache->delete_value('post_'.$postid.'_content');
//send pm //send pm
$postUrl = sprintf('[url=forums.php?action=viewtopic&topicid=%s&page=p%s#pid%s]%s[/url]', $topicid, $id, $id, $topicInfo->subject); $postUrl = sprintf('[url=[siteurl]forums.php?action=viewtopic&topicid=%s&page=p%s#pid%s]%s[/url]', $topicid, $id, $id, $topicInfo->subject);
if ($postInfo->userid != $CURUSER['id']) { if (!empty($postInfo->userid) && $postInfo->userid != $CURUSER['id']) {
$receiver = $postInfo->user; $receiver = $postInfo->user;
$locale = $receiver->locale; $locale = $receiver->locale;
$notify = [ $notify = [
@@ -432,9 +432,7 @@ if ($action == "post")
'msg' => nexus_trans('forum.post.edited_notify_body', ['topic_subject' => $postUrl, 'editor' => $CURUSER['username']], $locale), 'msg' => nexus_trans('forum.post.edited_notify_body', ['topic_subject' => $postUrl, 'editor' => $CURUSER['username']], $locale),
'added' => now(), 'added' => now(),
]; ];
\App\Models\Message::query()->insert($notify); \App\Models\Message::add($notify);
\Nexus\Database\NexusDB::cache_del("user_{$postInfo->userid}_unread_message_count");
\Nexus\Database\NexusDB::cache_del("user_{$postInfo->userid}_inbox_count");
} }
} }
else else
@@ -470,7 +468,7 @@ if ($action == "post")
//send pm //send pm
$topicInfo = \App\Models\Topic::query()->findOrFail($topicid); $topicInfo = \App\Models\Topic::query()->findOrFail($topicid);
$postInfo = \App\Models\Post::query()->findOrFail($quotepostid); $postInfo = \App\Models\Post::query()->findOrFail($quotepostid);
$postUrl = sprintf('[url=forums.php?action=viewtopic&topicid=%s&page=p%s#pid%s]%s[/url]', $topicid, $postid, $postid, $topicInfo->subject); $postUrl = sprintf('[url=[siteurl]forums.php?action=viewtopic&topicid=%s&page=p%s#pid%s]%s[/url]', $topicid, $postid, $postid, $topicInfo->subject);
if ($type == 'reply') { if ($type == 'reply') {
/** @var \App\Models\User $receiver */ /** @var \App\Models\User $receiver */
@@ -486,9 +484,7 @@ if ($action == "post")
'msg' => nexus_trans('forum.topic.replied_notify_body', ['topic_subject' => $postUrl], $locale), 'msg' => nexus_trans('forum.topic.replied_notify_body', ['topic_subject' => $postUrl], $locale),
'added' => now(), 'added' => now(),
]; ];
\App\Models\Message::query()->insert($notify); \App\Models\Message::add($notify);
\Nexus\Database\NexusDB::cache_del("user_{$topicInfo->userid}_unread_message_count");
\Nexus\Database\NexusDB::cache_del("user_{$topicInfo->userid}_inbox_count");
} }
} }
@@ -504,9 +500,7 @@ if ($action == "post")
'msg' => nexus_trans('forum.reply.replied_notify_body', ['topic_subject' => $postUrl, 'replyer' => $CURUSER['username']], $locale), 'msg' => nexus_trans('forum.reply.replied_notify_body', ['topic_subject' => $postUrl, 'replyer' => $CURUSER['username']], $locale),
'added' => now(), 'added' => now(),
]; ];
\App\Models\Message::query()->insert($notify); \App\Models\Message::add($notify);
\Nexus\Database\NexusDB::cache_del("user_{$postInfo->userid}_unread_message_count");
\Nexus\Database\NexusDB::cache_del("user_{$postInfo->userid}_inbox_count");
} }
} }
} }
+1 -1
View File
@@ -164,7 +164,7 @@ JS;
} else { } else {
list($pagertop, $pagerbottom, $limit) = pager($pageSize, $number, "?id=$id&menu=$menuSelected&"); list($pagertop, $pagerbottom, $limit) = pager($pageSize, $number, "?id=$id&menu=$menuSelected&");
$haremAdditionFactor = (float)get_setting('bonus.harem_addition'); $haremAdditionFactor = (float)get_setting('bonus.harem_addition');
$ret = sql_query("SELECT id, username, email, uploaded, downloaded, status, warned, enabled, donor, email, seed_points_per_hour, seeding_torrent_count, seeding_torrent_size, last_announce_at FROM users WHERE $whereStr $limit") or sqlerr(); $ret = sql_query("SELECT id, username, email, uploaded, downloaded, status, warned, enabled, donor, email, seed_points_per_hour, seeding_torrent_count, seeding_torrent_size, seed_points_per_hour, last_announce_at FROM users WHERE $whereStr $limit") or sqlerr();
$num = mysql_num_rows($ret); $num = mysql_num_rows($ret);
print("<tr> print("<tr>