$row["new"] = ""; if ($PHORUM["DATA"]["LOGGEDIN"]) { if (!isset($PHORUM['user']['newinfo'][$row['message_id']]) && $row['message_id'] > $PHORUM['user']['newinfo']['min_id']) { $row["new"] = $PHORUM["DATA"]["LANG"]["newflag"]; } } $messages[$row["message_id"]] = $row; } if ($PHORUM["threaded_read"]) { // don't move this up. We want it to be conditional. include_once "./include/thread_sort.php"; // run read-threads mods if (isset($PHORUM["hooks"]["readthreads"])) { $messages = phorum_hook("readthreads", $messages); } $messages = phorum_sort_threads($messages); if ($PHORUM["DATA"]["LOGGEDIN"] && !isset($PHORUM['user']['newinfo'][$message_id]) && $message_id > $PHORUM['user']['newinfo']['min_id']) { $read_messages[] = array("id" => $message_id, "forum" => $messages[$message_id]['forum_id']); } // we have to loop again and create the urls for the Next and Previous links. foreach ($messages as $key => $row) { if ($PHORUM["count_views"]) { // show viewcount if enabled if ($PHORUM["count_views"] == 2) { // viewcount as column $PHORUM["DATA"]["VIEWCOUNT_COLUMN"] = true; $messages[$key]["viewcount"] = $row['viewcount']; } else { // viewcount added to the subject $messages[$key]["subject"] = $row["subject"] . " ({$row['viewcount']} {$PHORUM['DATA']['LANG']['Views']})"; }
$rows[$key]["subject"] = $row["subject"] . " ({$row['viewcount']} " . $PHORUM['DATA']['LANG']['Views_Subject'] . ")"; } } $rows[$key]["raw_datestamp"] = $row["datestamp"]; $rows[$key]["datestamp"] = phorum_date($PHORUM["short_date_time"], $row["datestamp"]); $rows[$key]["URL"]["READ"] = str_replace(array('%thread_id%', '%message_id%'), array($row['thread'], $row['message_id']), $read_url_template); if ($row["message_id"] == $row["thread"]) { $rows[$key]["threadstart"] = true; } else { $rows[$key]["threadstart"] = false; } $rows[$key]["new"] = ""; } // don't move this up. We want it to be conditional. include_once "./include/thread_sort.php"; $rows = phorum_sort_threads($rows); } else { $read_url_template = phorum_get_url(PHORUM_READ_URL, '%thread_id%'); $newpost_url_template = phorum_get_url(PHORUM_READ_URL, '%thread_id%', 'gotonewpost'); $read_page_url_template = phorum_get_url(PHORUM_READ_URL, '%thread_id%', 'page=%page_num%'); $recent_page_url_template = phorum_get_url(PHORUM_READ_URL, '%thread_id%', '%message_id%', 'page=%page_num%'); $recent_url_template = phorum_get_url(PHORUM_READ_URL, '%thread_id%', '%message_id%'); // loop through and read all the data in. foreach ($rows as $key => $row) { $rows[$key]["raw_lastpost"] = $row["modifystamp"]; $rows[$key]["raw_datestamp"] = $row["datestamp"]; $rows[$key]["lastpost"] = phorum_date($PHORUM["short_date_time"], $row["modifystamp"]); $rows[$key]["datestamp"] = phorum_date($PHORUM["short_date_time"], $row["datestamp"]); $rows[$key]["URL"]["READ"] = str_replace('%thread_id%', $row['thread'], $read_url_template); $rows[$key]["URL"]["NEWPOST"] = str_replace('%thread_id%', $row['thread'], $newpost_url_template); $rows[$key]["threadstart"] = true;