function print_pages($page, $numpages) { $fmt = "showvisits.phtml?page=%d"; print "Page: " . gen_pagenav($fmt, $page, $numpages) . "<br>\n"; }
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 { $block = "normal"; } $new = false; if ($out['numshown'] > 0) { $count = 0; /* show stickies */ $i = 0; foreach ($out['threads'] as $t) { if (!$t['sticky']) { continue; } if ($count >= $start && $count < $end) {
$threadsperpage = $user->threadsperpage; } else { $threadsperpage = 50; } if (!$threadsperpage) { $threadsperpage = 50; } /* Figure out how many total threads the user can see */ $numthreads = 0; reset($indexes); while (list($key) = each($indexes)) { $numthreads += threads($key); } $numpages = ceil($numthreads / $threadsperpage); $fmt = "/" . $forum['shortname'] . "/pages/%d.phtml"; $tpl->set_var("PAGES", gen_pagenav($fmt, $curpage, $numpages)); $tpl->set_var("NUMTHREADS", $numthreads); $tpl->set_var("NUMPAGES", $numpages); $tpl->set_var("TIME", time()); $numshown = 0; $tthreadsshown = 0; if ($curpage == 1) { /******************************/ /* show global messages first */ /******************************/ if ($enable_global_messages) { /* PHP has a 32 bit limit even tho the type is a BIGINT, 64 bits */ $sth = db_query("select * from f_global_messages where gid < 32 order by date desc"); while ($gmsg = $sth->fetch()) { if (strlen($gmsg['url']) > 0) { if (!($user->gmsgfilter & 1 << $gmsg['gid']) && ($user->admin() || $gmsg['state'] == "Active")) {
function print_pages($page, $numpages) { $fmt = "admin.phtml?page=%d"; /* no maximum (maxjump=0)! */ print "Page: " . gen_pagenav($fmt, $page, $numpages, 0) . "<br>\n"; }
function print_pages($page, $numpages) { $fmt = "useracl.phtml?page=%d"; print "Page: " . gen_pagenav($fmt, $page, $numpages) . "<br>\n"; }