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

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__);
$Cache->delete_value('post_'.$postid.'_content');
//send pm
$postUrl = sprintf('[url=forums.php?action=viewtopic&topicid=%s&page=p%s#pid%s]%s[/url]', $topicid, $id, $id, $topicInfo->subject);
if ($postInfo->userid != $CURUSER['id']) {
$postUrl = sprintf('[url=[siteurl]forums.php?action=viewtopic&topicid=%s&page=p%s#pid%s]%s[/url]', $topicid, $id, $id, $topicInfo->subject);
if (!empty($postInfo->userid) && $postInfo->userid != $CURUSER['id']) {
$receiver = $postInfo->user;
$locale = $receiver->locale;
$notify = [
@@ -432,9 +432,7 @@ if ($action == "post")
'msg' => nexus_trans('forum.post.edited_notify_body', ['topic_subject' => $postUrl, 'editor' => $CURUSER['username']], $locale),
'added' => now(),
];
\App\Models\Message::query()->insert($notify);
\Nexus\Database\NexusDB::cache_del("user_{$postInfo->userid}_unread_message_count");
\Nexus\Database\NexusDB::cache_del("user_{$postInfo->userid}_inbox_count");
\App\Models\Message::add($notify);
}
}
else
@@ -470,7 +468,7 @@ if ($action == "post")
//send pm
$topicInfo = \App\Models\Topic::query()->findOrFail($topicid);
$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') {
/** @var \App\Models\User $receiver */
@@ -486,9 +484,7 @@ if ($action == "post")
'msg' => nexus_trans('forum.topic.replied_notify_body', ['topic_subject' => $postUrl], $locale),
'added' => now(),
];
\App\Models\Message::query()->insert($notify);
\Nexus\Database\NexusDB::cache_del("user_{$topicInfo->userid}_unread_message_count");
\Nexus\Database\NexusDB::cache_del("user_{$topicInfo->userid}_inbox_count");
\App\Models\Message::add($notify);
}
}
@@ -504,9 +500,7 @@ if ($action == "post")
'msg' => nexus_trans('forum.reply.replied_notify_body', ['topic_subject' => $postUrl, 'replyer' => $CURUSER['username']], $locale),
'added' => now(),
];
\App\Models\Message::query()->insert($notify);
\Nexus\Database\NexusDB::cache_del("user_{$postInfo->userid}_unread_message_count");
\Nexus\Database\NexusDB::cache_del("user_{$postInfo->userid}_inbox_count");
\App\Models\Message::add($notify);
}
}
}

View File

@@ -164,7 +164,7 @@ JS;
} else {
list($pagertop, $pagerbottom, $limit) = pager($pageSize, $number, "?id=$id&menu=$menuSelected&");
$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);
print("<tr>