当前位置: 首页>>代码示例>>PHP>>正文


PHP news::Load方法代码示例

本文整理汇总了PHP中news::Load方法的典型用法代码示例。如果您正苦于以下问题:PHP news::Load方法的具体用法?PHP news::Load怎么用?PHP news::Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在news的用法示例。


在下文中一共展示了news::Load方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: news

<?php

$id = get_request_variable('id', '');
$news = new news();
$news->news_id = $id;
if ($id) {
    if ($news->Load()) {
        $dir = SITE_NEWS_FILE_ROOT . $news->news_stamp . $news->news_exp;
        @unlink($dir);
        $dir = SITE_NEWS_FILE_ROOT . $news->news_stamp . "_1" . $news->news_exp;
        @unlink($dir);
        $date = $news->news_date;
        $news->Delete();
    } else {
        $news->news_id = 0;
        $date = date('Y-m-d');
    }
}
header('Location:' . SITE_HTTP_ROOT . $STORAGE['module'] . '/edit/date/' . $date . '/');
开发者ID:YuriyRusinov,项目名称:reper,代码行数:19,代码来源:delete.php

示例2: 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 {
        $linedate = date('Y-m-d', time());
    }
    $newses = array();
    $query = 'SELECT COUNT(*) as num FROM ' . TABLE_NEWS . ' WHERE news_date = \'' . $linedate . '\'  limit ' . LIMIT_NEWS_ON_PAGE;
    $db->query($query);
    $all_num = $db->value[0]['num'];
    if ($all_num < LIMIT_NEWS_ON_PAGE) {
        $query = 'SELECT * FROM ' . TABLE_NEWS . ' WHERE news_date <= \'' . $linedate . '\' ORDER BY news_id ASC  limit ' . LIMIT_NEWS_ON_PAGE;
开发者ID:YuriyRusinov,项目名称:reper,代码行数:31,代码来源:view.php

示例3: news

<?php

$id = get_request_variable('id', '');
$date = get_request_variable('date', '');
$save = get_request_variable('save', '');
$news = new news();
$news->news_id = $id;
if ($id) {
    if (!$news->Load()) {
        $news->news_id = 0;
    }
} else {
    $news->news_id = 0;
}
$news_conf = new news_config();
$news_conf->Load();
if ($save) {
    $news->news_title = get_request_variable('title', '');
    $news->news_content = get_request_variable('content', '');
    $news->news_img = get_request_variable('img', 'n');
    $day = get_request_variable('day', date('Y-m-d'));
    $news->news_date = parse_date('{Y}-{m}-{d}', $day, false);
    if ($news->news_id == 0) {
        $news->news_time = date('H:i');
    }
    if ($news->news_img !== "n") {
        if ($_FILES['file']['name'] != "") {
            if ($news->news_id > 0) {
                $dir = SITE_NEWS_FILE_ROOT . $news->news_stamp . $news->news_exp;
                @unlink($dir);
                $dir = SITE_NEWS_FILE_ROOT . $news->news_stamp . '_1' . $news->news_exp;
开发者ID:YuriyRusinov,项目名称:reper,代码行数:31,代码来源:edit.php


注:本文中的news::Load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。