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


PHP News::delete方法代码示例

本文整理汇总了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');
 }
开发者ID:Alexandr1987,项目名称:barricade,代码行数:7,代码来源:NewsAdminController.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');
 }
开发者ID:Alexandr1987,项目名称:barricade,代码行数:12,代码来源:NewsAdminController.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);
         }
     }
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:22,代码来源:NewsController.php

示例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));
开发者ID:lordgabber,项目名称:rartracker,代码行数:31,代码来源:api-v1.php

示例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'));
 }
开发者ID:samirios1,项目名称:niter,代码行数:11,代码来源:NewsController.php

示例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();
}
开发者ID:nsystem1,项目名称:clanscripts,代码行数:31,代码来源:deleteshoutpost.php

示例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();
开发者ID:meghv999,项目名称:cdshop-php,代码行数:13,代码来源:deleteNews.php


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