本文整理汇总了PHP中News::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP News::delete方法的具体用法?PHP News::delete怎么用?PHP News::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类News
的用法示例。
在下文中一共展示了News::delete方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionKill
public function actionKill()
{
$NewsRecord = new News();
$NewsRecord->NewsId = isset($_GET['id']) ? (int) $_GET['id'] : null;
$NewsRecord->delete();
header('Location: ./index.php');
}
示例2: actionKill
public function actionKill()
{
$id = isset($_GET['id']) ? (int) $_GET['id'] : null;
if (is_null($id)) {
header("HTTP/1.0 404 Not Found");
throw new E404Exception('Requested param cannot be null');
}
$NewsRecord = new News();
$NewsRecord->NewsId = $id;
$NewsRecord->delete();
header('Location: ./index.php');
}
示例3: deleteAction
/** Delete a news story
* @access public
* @return void
*/
public function deleteAction()
{
if ($this->_request->isPost()) {
$id = (int) $this->_request->getPost('id');
$del = $this->_request->getPost('del');
if ($del == 'Yes' && $id > 0) {
$where = 'id = ' . $id;
$this->_news->delete($where);
$this->getFlash()->addMessage('Record deleted!');
}
$this->redirect(self::REDIRECT);
} else {
$id = (int) $this->_request->getParam('id');
if ($id > 0) {
$this->view->new = $this->_news->fetchRow('id=' . $id);
}
}
}
示例4: News
$news = new News($db, $user);
$arr = $news->query((int) $_GET["limit"] ?: 2, $_GET["markAsRead"] ?: "false");
httpResponse($arr);
break;
case validateRoute('POST', 'news'):
$forum = new Forum($db, $user);
$news = new News($db, $user, $forum);
httpResponse($news->create($postdata));
break;
case validateRoute('PATCH', 'news/\\d+'):
$news = new News($db, $user);
httpResponse($news->update($params[1], $postdata));
break;
case validateRoute('DELETE', 'news/\\d+'):
$news = new News($db, $user);
httpResponse($news->delete($params[1]));
break;
case validateRoute('GET', 'suggestions'):
$suggestions = new Suggestions($db, $user);
$arr = $suggestions->get($_GET["view"] ?: 'top', (int) $_GET["limit"] ?: 10);
httpResponse($arr);
break;
case validateRoute('POST', 'suggestions/\\d+/votes'):
$suggestions = new Suggestions($db, $user);
$arr = $suggestions->vote($params[1], $postdata["direction"]);
httpResponse($arr);
break;
case validateRoute('POST', 'suggestions'):
$forum = new Forum($db, $user);
$suggestions = new Suggestions($db, $user, $forum);
httpResponse($suggestions->create($postdata));
示例5: destroy
/**
* Delete specified news item.
*
* @param int $id
* @return Redirect
*/
public function destroy($id)
{
$this->news->delete($id);
return Redirect::back()->withSuccess(trans('main.news delete success'));
}
示例6: ConsoleOption
*
* License: http://www.bluethrust.com/license.php
*
*/
include_once "../../../../_setup.php";
include_once "../../../../classes/member.php";
include_once "../../../../classes/rank.php";
include_once "../../../../classes/news.php";
include_once "../../../../classes/shoutbox.php";
// Start Page
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage News");
$consoleObj->select($cID);
$consoleInfo = $consoleObj->get_info_filtered();
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$newsObj = new News($mysqli);
// Check Login
$LOGIN_FAIL = true;
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj) && $newsObj->select($_POST['postID'])) {
$newsObj->delete();
$shoutboxObj = new Shoutbox($mysqli, "news", "news_id");
$shoutboxObj->strDivID = filterText($_POST['updateDiv']);
$shoutboxObj->intDispWidth = 140;
$shoutboxObj->intDispHeight = 300;
$shoutboxObj->blnUpdateShoutbox = true;
$shoutboxObj->blnMainShoutbox = true;
$shoutboxObj->strEditLink = $MAIN_ROOT . "members/console.php?cID=" . $cID . "&newsID=";
$shoutboxObj->strDeleteLink = $MAIN_ROOT . "members/include/news/include/deleteshoutpost.php";
echo $shoutboxObj->dispShoutbox();
}
示例7: sqlInjection
<?php
require "../includes/checkPermission.php";
require "../../deny/connector.php";
require "class/class.News.php";
require "../includes/injection.php";
$newsid = sqlInjection($_GET['newsID']);
$newsid = intval($newsid);
$cate = new News();
$cate->delete($newsid);
echo "<meta http-equiv='refresh' content='0;url=../admincp.php?opt=listnews'>";
//header("location: ../admincp.php?opt=listnews");
//exit();