Exemplo n.º 1
0
<?php

$date = get_request_variable('date', '');
$id = get_request_variable('id', 0);
$news_conf = new news_config();
$news_conf->id = 1;
$news_conf->Load();
$am_news = $news_conf->am_news;
//количество новостей
$PreLengthC = $news_conf->PreLengthC;
//размер предпросмотра - число символов.
$tab_width = $news_conf->tab_width;
//ширина таблицы с новостями
$p_time = $news_conf->p_time;
//показывать время новости
$p_date = $news_conf->p_date;
//показывать дату новости
$img_height = $news_conf->img_height;
//высота для миникартинки новости
define('LIMIT_NEWS_ON_PAGE', $am_news);
if ($id > 0) {
    $news = new news();
    $news->news_id = $id;
    $news->Load();
    include SITE_FILE_ROOT . 'template/header.php';
    include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '-id.php';
    include SITE_FILE_ROOT . 'template/footer.php';
} else {
    if ($date) {
        $linedate = parse_date('{Y}-{m}-{d}', $date, true);
    } else {
Exemplo n.º 2
0
<?php

$save = get_request_variable('save', 0);
$news_conf = new news_config();
$news_conf->id = 1;
$news_conf->Load();
if ($save) {
    $am_news = intval(get_request_variable('am_news', 10));
    $PreLengthC = intval(get_request_variable('PreLengthC', 100));
    $tab_width = get_request_variable('tab_width', '100%');
    $p_time = intval(get_request_variable('p_time', 1));
    $p_date = intval(get_request_variable('p_date', 1));
    $img_height = intval(get_request_variable('img_height', 20));
    $news_conf->am_news = $am_news;
    $news_conf->PreLengthC = $PreLengthC;
    $news_conf->tab_width = $tab_width;
    $news_conf->p_time = $p_time;
    $news_conf->p_date = $p_date;
    $news_conf->img_height = $img_height;
    $errors = $news_conf->IsValidData();
    if (count($errors) == 0) {
        $db->begin();
        $news_conf->Save();
        $db->commit();
    }
}
include SITE_FILE_ROOT . 'template/header.php';
include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '.php';
include SITE_FILE_ROOT . 'template/footer.php';