本文整理汇总了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 . '/');
示例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;
示例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;