$fSettings[ForumName] : $BoardName"; $ent["PageSpan"] = $pages; $ent["LoginBox"] = GrabLoginBox("$fSettings[ScriptURL]/viewboard.php?BoardID=$BoardID"); $ent["Moderator"] = GrabModerators($BoardID); $ent["NewandReply"] = ""."\"New"; $CurrentUserPass = GrabUserPass(); if (is_mod($CurrentUserPass[UserName],$CurrentUserPass[Password],$BoardID)) $ent["ModFunctions"] = "Moderator Functions: $txt[LockTopic] | $txt[MoveTopic]"; $template = ReadTemplate("viewboard"); $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*$topicsperpage; $query = "SELECT ID,Subject,BoardID,TopicID,Poster,Locked,DatePosted,ReplyNotice,Emoticon,FirstMessage,PosterIP,PostIcon,numReplies,numViews from t_messages where BoardID = $BoardID AND FirstMessage = 'yes' Order By DateEdited DESC LIMIT $limit,$topicsperpage"; $result = mysql_query($query); if ($row = mysql_fetch_array($result)) { do { $tInfo = $row; $totalmessage = $tInfo["numReplies"]+1; $messagesperpage = $fSettings["messagesperpage"]; $div = ceil($totalmessage/$messagesperpage); $pages2 = ""; $temp = 0; $temp2 = 0; if ($totalmessage > $messagesperpage) { $temp = 0; $pages2 = "( "; while ($temp < $div) { $temp2 = $temp+1; if ($temp2 > 3) { $pages2 .= " .. Last page"; $temp = 4; } else $pages2 .= " $temp2"; $temp++; } $pages2 .= " )"; } $query = "SELECT DatePosted,Poster from t_messages where TopicID =".$tInfo["TopicID"]." Order By DatePosted DESC LIMIT 1"; $result2 = mysql_query($query); $row2 = mysql_fetch_row($result2); $tIcon = GrabPostIcon($row["ID"]); $row2[1] = trim($row2[1]); $ent["LatestMSGPoster"] = "$row2[1]"; $ent["LatestMSGDate"] = FormatDate($row2[0]); $ent["LatestMSGTime"] = FormatTime($row2[0]); $ent["TopicIcon"] = ""; $ent["tSubject"] = "".SensorWord(stripslashes($tInfo['Subject']))." "; $ent["tSubject"] .= " $pages2"; if (!is_read_topic($tInfo["TopicID"],$LastVisit)) { $ent['FolderIcon'] = "\"New"; if ($totalmessage > 25) $ent['FolderIcon'] = "\"New"; } else { $ent['FolderIcon'] = "\"Topic\""; if ($totalmessage > 25) $ent['FolderIcon'] = "\"Hot"; } //if ($tInfo["Locked"] == 1) {$ent['tSubject'] .= "\"This";} if ($tInfo["Locked"] == 1) {$ent['FolderIcon'] = "\"This";} $tInfo["Poster"] = trim($tInfo["Poster"]); $ent["tTopicStarter"] = "$tInfo[Poster]"; $ent["tReplies"] = $tInfo["numReplies"]; $ent["tViews"] = $tInfo["numViews"]; print ParseTemp($first_loop,$ent); } while ($row = mysql_fetch_array($result)); } print ParseTemp($last_part,$ent); // print_r ($_COOKIE['UserInfoCookie']); fFooter(); ?>