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


PHP NewsStory::delete方法代码示例

本文整理汇总了PHP中NewsStory::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP NewsStory::delete方法的具体用法?PHP NewsStory::delete怎么用?PHP NewsStory::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NewsStory的用法示例。


在下文中一共展示了NewsStory::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deletePost

 function deletePost()
 {
     if (!$this->_checkUser($this->params[1], $this->params[2])) {
         $this->response->add(new XoopsXmlRpcFault(104));
     } else {
         if (!$this->_checkAdmin()) {
             $this->response->add(new XoopsXmlRpcFault(111));
         } else {
             // will be removed... don't worry if this looks bad
             if (!XoopsLoad::loadFile(\XoopsBaseConfig::get('root-path') . '/modules/news/class/class.newsstory.php', true)) {
                 $this->response->add(new XoopsXmlRpcFault(103));
                 return;
             }
             $story = new NewsStory($this->params[0]);
             if (!$story->delete()) {
                 $this->response->add(new XoopsXmlRpcFault(106));
             } else {
                 $this->response->add(new XoopsXmlRpcBoolean(true));
             }
         }
     }
 }
开发者ID:RanLee,项目名称:XoopsCore,代码行数:22,代码来源:xoopsapi.php

示例2: deletePost

 function deletePost()
 {
     if (!$this->_checkUser($this->params[1], $this->params[2])) {
         $this->response->add(new XoopsXmlRpcFault(104));
     } else {
         if (!$this->_checkAdmin()) {
             $this->response->add(new XoopsXmlRpcFault(111));
         } else {
             // will be removed... don't worry if this looks bad
             include_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php';
             $story = new NewsStory($this->params[0]);
             if (!$story->delete()) {
                 $this->response->add(new XoopsXmlRpcFault(106));
             } else {
                 $this->response->add(new XoopsXmlRpcBoolean(true));
             }
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:19,代码来源:xoopsapi.php

示例3: intval

 case "delete":
     $storyid = 0;
     if (isset($_GET['storyid'])) {
         $storyid = intval($_GET['storyid']);
     } else {
         if (isset($_POST['storyid'])) {
             $storyid = intval($_POST['storyid']);
         }
     }
     if (!empty($_POST['ok'])) {
         if (empty($storyid)) {
             redirect_header('index.php?op=newarticle', 2, _AM_EMPTYNODELETE);
             exit;
         }
         $story = new NewsStory($storyid);
         $story->delete();
         $sfiles = new sFiles();
         $filesarr = array();
         $filesarr = $sfiles->getAllbyStory($storyid);
         if (count($filesarr) > 0) {
             foreach ($filesarr as $onefile) {
                 $onefile->delete();
             }
         }
         xoops_comment_delete($xoopsModule->getVar('mid'), $storyid);
         xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'story', $storyid);
         updateCache();
         redirect_header('index.php?op=newarticle', 1, _AM_DBUPDATED);
         exit;
     } else {
         $story = new NewsStory($storyid);
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:31,代码来源:index.php


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