} //include template handling require_once $rootpath . 'lib/common.inc.php'; require_once $stylepath . '/lib/icons.inc.php'; // this file use only database class. We don't need mysql_ connectors anymore. db_disconnect(); //Preprocessing if ($error == false) { //get the news $tplname = 'newlogs'; require $stylepath . '/newlogs.inc.php'; $LOGS_PER_PAGE = 50; $PAGES_LISTED = 10; $rsQuery = "SELECT count(id) FROM cache_logs WHERE deleted=0"; $db = new dataBase(); $total_logs = $db->simpleQueryValue($rsQuery, 0); $pages = ""; $total_pages = ceil($total_logs / $LOGS_PER_PAGE); if (!isset($_GET['start']) || intval($_GET['start']) < 0 || intval($_GET['start']) > $total_logs) { $start = 0; } else { $start = intval($_GET['start']); } $startat = max(0, floor(($start / $LOGS_PER_PAGE + 1) / $PAGES_LISTED) * $PAGES_LISTED); if ($start > 0) { $pages .= '<a href="newlogs.php?start=' . max(0, ($startat - $PAGES_LISTED - 1) * $LOGS_PER_PAGE) . '">{first_img}</a> '; $pages .= '<a href="newlogs.php?start=' . max(0, $start - $LOGS_PER_PAGE) . '">{prev_img}</a> '; } else { $pages .= "{first_img_inactive} {prev_img_inactive} "; } for ($i = max(1, $startat); $i < $startat + $PAGES_LISTED; $i++) {