本文整理汇总了PHP中News::NewsList方法的典型用法代码示例。如果您正苦于以下问题:PHP News::NewsList方法的具体用法?PHP News::NewsList怎么用?PHP News::NewsList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类News
的用法示例。
在下文中一共展示了News::NewsList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
switch ($_GET['action']) {
case "new":
echo $nw->AddNewForm();
break;
case "AddNew":
echo $nw->AddNew($db, $_POST);
break;
case "EditNew":
echo $nw->EditNewForm($_GET['id'], $db);
break;
case "SaveNew":
echo $nw->SaveNew($db, $_POST);
break;
default:
case "manage":
echo $nw->NewsList($db);
break;
case "ArchiveNew":
$nw->ArchiveNew($db, $_POST['id']);
break;
case "MoveNew":
$nw->MoveNew($db, $_POST);
break;
case "archive":
echo $nw->Archive($db);
break;
case "Publish":
$nw->Publish($db, $_POST['id']);
break;
case "Delete":
$nw->Delete($db, $_POST['id']);
示例2: die
<?php
if (!_acl::isAllow('news')) {
die("Access denied");
}
$News = new News();
unset($parsed_res);
$tpl->Assign('h1', 'Новости');
$ii = count($GLOBALS['IERA_LINKS']);
$GLOBALS['IERA_LINKS'][$ii]['title'] = "Новости";
if (isset($_POST['smb']) && isset($_POST['ord'])) {
$News->Reorder($_POST);
$tpl->Assign('msg', 'Сортировка выполнена успешно.');
}
if ($News->NewsList(1)) {
// die('Ошибка при формировании списка новостей.');
$tpl->Assign('list', $News->list);
}
$tpl_center .= $tpl->Parse($GLOBALS['PATH_tpl'] . 'cp_news.tpl');
示例3: Page
$Page = new Page();
$Page->PagesList();
$tpl->Assign('list_menu', $Page->list);
if (isset($GLOBALS['Rewrite'])) {
if (!$News->SetFieldsByRewrite($GLOBALS['Rewrite'], true, 1)) {
header('Location: ' . _base_url . '/404/');
exit;
}
$news = $News->fields;
G::metaTags($news);
$header = $news['title'];
$tpl->Assign('header', $header);
$tpl->Assign('data', $news);
$tpl->Assign('indexation', $news['indexation']);
$GLOBALS['IERA_LINKS'][] = array('title' => 'Новости', 'descr' => strip_tags($news['descr_short']), 'url' => Link::Custom('news'));
$GLOBALS['IERA_LINKS'][] = array('title' => $header, 'url' => Link::Custom('news', $news['translit']));
$template = 'cp_news.tpl';
} else {
$header = 'Новости';
$tpl->Assign('header', $header);
G::metaTags(array('page_title' => $header));
$GLOBALS['IERA_LINKS'][] = array('title' => $header, 'url' => Link::Custom('news'));
if ($News->NewsList(0, '', 1)) {
$tpl->Assign('list', $News->list);
}
$template = 'cp_newslist.tpl';
}
$parsed_res = array('issuccess' => true, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . $template));
if (TRUE == $parsed_res['issuccess']) {
$tpl_center .= $parsed_res['html'];
}