--- fenglin/bbs/list.php 2025/04/27 04:18:22 1.7 +++ fenglin/bbs/list.php 2025/10/01 12:40:03 1.10 @@ -248,10 +248,25 @@ while ($row = mysqli_fetch_array($rs)) { + // Rewrite title with "Re: Re: " prefix into "Re: ... " + $title = $row["title"]; + if ($row["TID"] != 0) + { + $j = 0; + while (substr_compare($row["title"], "Re: ", $j, strlen("Re: ")) == 0) + { + $j += strlen("Re: "); + } + if ($j >= strlen("Re: Re: ")) + { + $title = "Re: ... " . substr($row["title"], $j); + } + } + array_push($result_set["data"]["articles"], array( "aid" => $row["AID"], "tid" => $row["TID"], - "title" => $row["title"], + "title" => $title, "sub_dt" => (new DateTimeImmutable($row["sub_dt"]))->setTimezone($_SESSION["BBS_user_tz"]), "length" => $row["length"], "icon" => $row["icon"], @@ -269,7 +284,7 @@ "last_reply_uid" => $row["last_reply_UID"], "last_reply_username" => $row["last_reply_username"], "last_reply_nickname" => $row["last_reply_nickname"], - "visited" => (($_SESSION["BBS_uid"] > 0 && in_array($row["AID"], $visited_aid_list)) ? 1 : 0), + "visited" => (($_SESSION["BBS_uid"] > 0 && ($row["UID"] == $_SESSION["BBS_uid"] || in_array($row["AID"], $visited_aid_list))) ? 1 : 0), )); if (!isset($author_list[$row["UID"]])) @@ -280,6 +295,8 @@ { $author_list[$row["last_reply_UID"]] = true; } + + unset($title); } mysqli_free_result($rs); @@ -343,4 +360,3 @@ exit(json_encode($result_set)); // Output data in Json } include $theme_view_file; -?>