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