".$fSettings["ForumName"]." : ".$BoardName." : $TopicName"; if ($TopicStatus == 1) $CurrentLocation .= " \"This"; $MessageOptions = ""."\"New"; if ($TopicStatus == 0) $MessageOptions .= " "."\"Post"; $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); $CurrentUserPass = GrabUserPass(); // Killing the extra is_mod call --Derrick Hopkins 5-8 if (is_mod($CurrentUserPass[UserName],$CurrentUserPass[Password],$BoardID)) $ent["ModFunctions"] = "Moderator Functions: $txt[LockTopic] | $txt[MoveTopic]"; $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"]); //New PostIcon Grabber Code --Derrick Hopkins 5-10 $msgIcon = $d_Icons[$msgInfo["PostIcon"]]; $PosterInfo = "$UserInfo[UserName]"; $PosterInfo .= ""; $PosterInfo .= "
$txt[UserLevel]: $UserInfo[UserLevel]"; if ($UserInfo["Icon"]) {$PosterInfo .= "
";} if ($UserInfo["RegDate"]) {$PosterInfo .= "
$txt[Registered]: ".FormatDate($UserInfo[RegDate]);} 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"; } 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"]); $ent["TimePosted"] = FormatTime($msgInfo["DatePosted"]); if (($CurrentUserInfo["UserName"] == $UserInfo["UserName"]) || (is_mod($CurrentUserPass[UserName],$CurrentUserPass[Password],$BoardID))) $ent["MsgOptions"] = "$txt[Edit]"; if ($msgInfo["Locked"] == 0) $ent["MsgOptions"] .= " | $txt[QuoteReply]"; if ($UserInfo["Signature"]) {$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(); ?>