예제 #1
0
파일: index.php 프로젝트: faosclass/gz_news
<?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');
?>
예제 #2
0
파일: item.php 프로젝트: faosclass/gz_news
<?php

define('ABS_PATH', dirname(dirname(dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME']))))) . '/');
require_once ABS_PATH . 'oc-load.php';
$dao = GzNewsDao::newInstance();
$item_id = (int) Params::getParam('i');
$item = $dao->findByPrimaryKey($item_id);
$images = GzNewsUtils::getImagesUrl($item_id);
$model = new GzNewsModel();
if ($item) {
    Params::setParam('themeCustomtitle', $item['gn_title']);
} else {
    $model->redirectTo(GzNewsUtils::getIndexUrl());
}
?>
<!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');
?>
        <meta name="robots" content="index, follow" />
        <meta name="googlebot" content="index, follow" />
    </head>
    <body>

		<?php 
/** Header that includes menu, logo, etc * */