".$fSettings["ForumName"]." : ".$BoardName." : $TopicName"; if ($TopicStatus == 1) $CurrentLocation .= " \"This"; $MessageOptions = ""."\"New"; $MessageOptions.= " "."\"New"; if ($TopicStatus == 0) $MessageOptions .= " "."\"Post"; if ($TopicInfo["IsPoll"]) $ent["PollResults"] = GrabPollBox($TopicID); $ent["fTitleBGColor"] = $fSettings["title_backcolor"]; $ent["fTitleTColor"] = $fSettings["title_textcolor"]; $ent["fCatBGColor"] = $fSettings["cat_backcolor"]; $ent["fCatTColor"] = $fSettings["cat_textcolor"]; $ent["fMsgBGColor1"] = $fSettings["msg_backcolor"]; $ent["fMsgBGColor2"] = $fSettings["msg_backcolor2"]; $ent["fBorderColor"] = $fSettings["bordercolor"]; $ent["AnnouncementMSG"] = GrabAnnouncement($BoardID); $ent["NavPath"] = $CurrentLocation; $ent["NewandReply"] = $MessageOptions; $ent["PageSpan"] = $pages; $ent["LoginBox"] = GrabLoginBox("$fSettings[ScriptURL]/viewtopic.php?TopicID=$TopicID"); $ent["Moderator"] = GrabModerators($BoardID); if (in_array($CurrentUserInfo["UserName"], $d_BoardModerator)) $ent["ModFunctions"] = "Moderator Functions: $txt[LockTopic] | $txt[MoveTopic] | $txt[TopTopic]"; $template = ReadTemplate("viewtopic"); $pos_start = strpos($template,"")+strlen(""); $pos_end = strpos($template,"",$pos_start); $first_part = substr($template,0,$pos_start-strlen("")); $last_part = substr($template,$pos_end,strlen($template)-$pos_end); print ParseTemp($first_part,$ent); $first_loop = substr($template,$pos_start,$pos_end-$pos_start); $table = ""; $limit = $page*$messagesperpage; $query = "select * from t_messages where TopicID = $TopicID Order By DatePosted ASC LIMIT $limit,$messagesperpage"; $result = mysql_query($query); if ($row = mysql_fetch_array($result)) { $i=0; do { $msgInfo = $row; $ent["MsgOptions"] = ""; if ($i%2) $ent["fMsgBGColorAlt"] = $fSettings["msg_backcolor2"]; else $ent["fMsgBGColorAlt"] = $fSettings["msg_backcolor"]; $UserInfo = GrabUserInfo($msgInfo["Poster"]); $msgIcon = GrabPostIcon($msgInfo["ID"]); $PosterInfo = "$UserInfo[UserName]"; $PosterInfo .= ""; $PosterInfo .= "
$txt[UserLevel]: $UserInfo[UserLevel]"; if ($UserInfo["Icon"]) {$PosterInfo .= "
";} if ($UserInfo["Avatar"]) {$PosterInfo .= "
";} if ($UserInfo["RegDate"]) {$PosterInfo .= "
$txt[Registered]: ".FormatDate($UserInfo[RegDate],$CurrentUserInfo[timezone]);} if ($UserInfo["NumPost"]) {$PosterInfo .= "
$txt[Posts]: $UserInfo[NumPost]";} $PosterInfo .= "
IP: "; if ($CurrentUserInfo["LevelID"] <= 2) {$PosterInfo .= $msgInfo["PosterIP"];} else {$PosterInfo .= "Logged";} $PosterInfo .= "


"; if ($UserInfo["UserLevel"] != "Guest") { $PosterInfo .= "\"View"; $PosterInfo .= " \"Send"; $PosterInfo .= " \"".$txt["ShowPosts"]."\""; } if ($UserInfo["Homepage"]) {$PosterInfo .= " \"Visit";} if ($UserInfo["ICQNumber"]) {$PosterInfo .= " ICQ";} $ent["PosterInfo"] = $PosterInfo; $ent["MsgID"] = $msgInfo["ID"]; $ent["MsgIcon"] = "icon"; $ent["Subject"] = SensorWord(stripslashes($msgInfo["Subject"])); $ent["DatePosted"] = FormatDate($msgInfo["DatePosted"],$CurrentUserInfo[timezone]); $ent["TimePosted"] = FormatTime($msgInfo["DatePosted"],$CurrentUserInfo[timezone]); if (($CurrentUserInfo["UserName"] == $UserInfo["UserName"]) || in_array($CurrentUserInfo["UserName"], $d_BoardModerator)) $ent["MsgOptions"] = "$txt[Edit]"; if ($msgInfo["Locked"] == 0) $ent["MsgOptions"] .= " | $txt[QuoteReply]"; if (($UserInfo["Signature"]) && ($msgInfo["AddSig"])){$ent["Message"] = ParseMSG($msgInfo["Message"]."\n\n____________________________\n".$UserInfo["Signature"],$msgInfo["Emoticon"]);} else {$ent["Message"] = ParseMSG($msgInfo["Message"],$msgInfo["Emoticon"]);} print ParseTemp($first_loop,$ent); $i++; } while ($row = mysql_fetch_array($result)); } print ParseTemp($last_part,$ent); PrintForumRules($BoardID); fFooter(); ?>