當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。