<?php define('ABS_PATH', dirname(dirname(dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME']))))) . '/'); require_once ABS_PATH . 'oc-load.php'; $dao = GzNewsDao::newInstance(); $index_url = GzNewsUtils::getIndexUrl(); $current_page = (int) Params::getParam('new_p'); $selected = 0; if ($current_page > 0) { $selected = $current_page - 1; } $total_items = $dao->count(); $total_per_page = GzNewsUtils::getMaxItemsPerPage(); $total_pages = ceil($total_items / $total_per_page); $params = array('total' => (int) $total_pages, 'selected' => $selected, 'url' => $index_url . '?new_p={PAGE}', 'sides' => 5); // set pagination $pagination = new Pagination($params); $paginator_html = $pagination->doPagination(); $options = array('page' => $current_page, 'total_per_page' => $total_per_page, 'language' => osc_current_user_locale()); $list = $dao->listItems($options); Params::setParam('themeCustomtitle', __('Noticias', 'gz_news')); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="<?php echo str_replace('_', '-', osc_current_user_locale()); ?> "> <head> <?php osc_current_web_theme_path('head.php'); ?>