Ejemplo n.º 1
0
$oTemplate->set("Reads", $oThread->getRead());
$iOld = (int) ((time() - $oThread->getCreatedTimestamp()) / 86400);
if (!((double) $iOld == $oThread->getCreatedTimestamp() / 86400)) {
    $iOld++;
}
$oTemplate->set("Show_Thread_Answers", $oThread->getNumberPosts() - 1);
$oTemplate->set("Show_Thread_Old", $iOld);
$oTemplate->set("Show_Thread_Writer_Say", $a_oPosts[0]->getText());
// Loopa poster
$iN = count($a_oPosts);
for ($n = 1; $n < $iN; $n++) {
    $oUser = $a_oPosts[$n]->getUser();
    $oTemplate->set("Post_User_Status", $oUser->getOnline() ? "on" : "off");
    $oTemplate->set("Show_User_ID", $oUser->getID());
    $oTemplate->set("Show_User_Name", htmlspecialchars($oUser->getName()));
    $oTemplate->set("Show_Post_Date", fixDateFormat($a_oPosts[$n]->getCreatedTimestamp(), 2));
    $oTemplate->set("Show_Thread_Say", $a_oPosts[$n]->getText());
    $oTemplate->parse("Posts");
}
// G?m posts om det inte finns n?gra
if (!($iN > 1)) {
    $oTemplate->replace("Posts", "Empty");
}
// G?m orig om det inte ?r sida 1
if (!($_GET['Page'] == 1)) {
    $oTemplate->replace("Orig", "Tom");
}
// Visa
$oTemplate->set("Timer", timer());
$oTemplate->parse();
$oTemplate->spit();
Ejemplo n.º 2
0
    $oTemplate->replace("Login_Outside", "Login_Inside");
}
$oTemplate->set("Page", $_GET['Page']);
$oTemplate->set("Page_Next", $_GET['Page'] + 1);
$oTemplate->set("Page_Prev", $_GET['Page'] - 1);
$oTemplate->set("Sort", $_GET['Sort']);
$iCounter = 0;
foreach (array_keys($a_oThreads) as $iThread) {
    $oThread =& $a_oThreads[$iThread];
    $oUser = $oThread->getUser();
    $oLastUser = $oThread->getLastPostUser();
    $oTemplate->set("Thread_ID", $oThread->getThreadID());
    $oTemplate->set("Thread_Rubrik", $oThread->getRubrik());
    $oTemplate->set("Thread_Answers", $oThread->getNumberPosts() - 1);
    $oTemplate->set("Thread_Reads", $oThread->getNumberReads());
    $oTemplate->set("Thread_Last_Time", fixDateFormat($oThread->getLastPostTimestamp()));
    $oTemplate->set("Thread_User_ID", $oUser->getID());
    $oTemplate->set("Thread_User_Name", htmlspecialchars($oUser->getName()));
    $oTemplate->set("Thread_Last_Name", htmlspecialchars($oLastUser->getName()));
    $oTemplate->set("Thread_Last_ID", $oLastUser->getID());
    $oTemplate->set("Thread_Color", $iCounter % 2 ? "ntg" : "ntw");
    $oTemplate->set("New", $oThread->getNew() ? "Visible" : "Hidden");
    $oTemplate->set("User_Status", $oUser->getOnline() ? "on" : "off");
    $oTemplate->set("Last_User_Status", $oLastUser->getOnline() ? "on" : "off");
    $oLastUser->getOnline() ? $oTemplate->replace("Thread_Last_User_Offline", "Thread_User_Online") & $oTemplate->parse("Thread_Last_User_Online") : $oTemplate->parse("Thread_Last_User_Offline");
    $oTemplate->parse("Threads");
    $iCounter++;
}
// Visa inget om vi inte hade n?gra tr?dar
$iCounter ? TRUE : $oTemplate->replace("Threads", "Empty");
// Skicka till broswern