$hdr->set_var("FORUM_NAME", $forum['name']); $hdr->set_var("FORUM_SHORTNAME", $forum['shortname']); $yatt = new YATT($template_dir, 'showtracking.yatt'); $yatt->set("forum_header", $hdr->parse("FORUM_HEADER", "forum_header")); $yatt->set("user_token", $user->token()); $yatt->set("page", $tpl->get_var("PAGE")); $yatt->set("forum", $forum); $yatt->set("time", time()); if (!isset($curpage)) { $curpage = 1; } $tpp = $user->threadsperpage; if ($tpp <= 0) { $tpp = 20; } $out = process_tthreads(); $numpages = ceil($out['numshown'] / $tpp); if ($numpages && $curpage > $numpages) { err_not_found("Page out of range"); exit; } $yatt->set('shown', $out['numshown']); $yatt->set('numpages', $numpages); /* calc start/end thread points */ $start = $tpp * ($curpage - 1); $end = $tpp * $curpage; $fmt = "/" . $forum['shortname'] . "/tracking/%d.phtml"; $yatt->set("pages", gen_pagenav($fmt, $curpage, $numpages)); if (isset($user->pref['SimpleHTML'])) { $block = "simple"; } else {
if (is_thread_bumped($thread)) { $tpl->set_var("CLASS", "trow" . $numshown % 2); $tthreadsshown++; } else { $tpl->set_var("CLASS", "row" . $numshown % 2); } } $threadlinks = gen_threadlinks($thread); $tpl->set_var("MESSAGES", $messagestr); $tpl->set_var("THREADLINKS", $threadlinks); $tpl->parse("_row", "row", true); $numshown++; } while ($thread = $sth->fetch()); $sth->closeCursor(); } if (!process_tthreads(true)) { $tpl->set_var("tracked_threads", ""); } if (!$tthreadsshown) { $tpl->set_var("update_all", ""); } if (!$numshown) { $tpl->set_var($table_block, "<font size=\"+1\">No messages in this forum</font><br>"); } /* $row = db_query_first("select count(*) from f_visits where UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(tstamp) <= 15 * 60 and aid != 0"); $active_users = $row ? $row[0] : 0; $row = db_query_first("select count(*) from f_visits where UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(tstamp) <= 15 * 60 and aid = 0"); $active_guests = $row ? $row[0] : 0; */ $tpl->set_var(array("ACTIVE_USERS" => $active_users, "ACTIVE_GUESTS" => $active_guests));