Author Servous License GPL **************************************************/ // make sure that config.php has been uploaded if(!file_exists('config.php') && file_exists('install/index.php')) { header('Location: install/index.php'); exit; } else if(!file_exists('config.php') && !file_exists('install/index.php')) { echo 'config.php is corrupt or missing!'; exit; } if(isset($_GET['date']) && strlen(intval($_GET['date'])) >= 6) { $year = substr($_GET['date'], 0, 4); $month = substr($_GET['date'], 4, 2); $day = substr($_GET['date'], 6, 2); $date = intval($_GET['date']); } else { $date = 0; } if(isset($_GET['cat']) && intval($_GET['cat']) > 0) { $cat = intval($_GET['cat']); } else { $cat = null; } // include headers require('inc/tpl_header.php'); // header require('inc/tpl_menu.php'); // menu // include blocks require('inc/block_custom.php'); // custom blocks // include functions require('inc/sRenderPost.php'); // declare truncate() is not already declared if(!function_exists('truncate')) { require('inc/func_truncate.php'); } /* start */ ob_start(); ?> 0) { $counter = 0; // set active page if(!isset($_GET['p'])) { $page = 1; } else { $page = $_GET['p']; } // prevent division by zero error if(isset($conf_page_disp) && $conf_page_disp > 0) { $pages = ceil($n / $conf_page_disp); } else { $conf_page_disp = 5; $pages = 0; } // jump to active page in database mysql_data_seek($q, (($page - 1) * $conf_page_disp)); while($r = mysql_fetch_assoc($q)) { $counter++; if($counter > $conf_page_disp) { break; } // render the post sRenderPost($r['id'], $r['category_id'], $r['category'], $r['date_created'], $r['date_modified'], $r['topic'], $r['text']); } if($pages > 1) { echo "\t\t\t" . '' . "\n"; echo "\t\t\t" . '
' . "\n"; echo "\t\t\t\t" . '
' . "\n"; if($page > 1) { echo "\t\t\t\t\t" . '« ' . lang('First') . ' « ' . lang('Previous') . '' . "\n"; } else { echo "\t\t\t\t\t" . '« ' . lang('First') . ' « ' . lang('Previous') . "\n"; } echo "\t\t\t\t" . '
' . "\n"; echo "\t\t\t\t" . '
' . "\n"; if($page < $pages) { echo "\t\t\t\t\t" . '' . lang('Next') . ' » ' . lang('Last') . ' »' . "\n"; } else { echo "\t\t\t\t\t" . lang('Next') . ' » ' . lang('Last') . ' »' . "\n"; } echo "\t\t\t\t" . '
' . "\n"; echo "\t\t\t\t" . '
' . "\n"; echo "\t\t\t\t\t" . $page . ' ' . lang('of') . ' ' . $pages . "\n"; echo "\t\t\t\t" . '
' . "\n"; echo "\t\t\t" . '
' . "\n"; echo "\t\t\t" . '' . "\n"; } } else { if(array_key_exists('cat', $_GET)) { echo '
' . lang('There are no posts assigned to this category.') . '
' . "\n"; } else if(array_key_exists('date', $_GET)) { echo '
' . lang('No posts were posted on this date.') . '
' . "\n"; } else { echo '
' . lang('The sBLOG is empty!') . '
' . "\n"; } } mysql_close(); ?> ', $tpl_temp, $tpl_main); ob_end_clean(); /* end */ require('inc/tpl_foot.php'); echo $tpl_main; ?>