本文整理汇总了PHP中xoops_comment_delete函数的典型用法代码示例。如果您正苦于以下问题:PHP xoops_comment_delete函数的具体用法?PHP xoops_comment_delete怎么用?PHP xoops_comment_delete使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xoops_comment_delete函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: deleteProduct
/**
* Supprime un produit (et tout ce qui lui est relatif)
* @param oledrion_products $product
*/
function deleteProduct(oledrion_products $product)
{
global $xoopsModule;
$id = $product->getVar('product_id');
// On commence par supprimer les commentaires
$mid = $xoopsModule->getVar('mid');
xoops_comment_delete($mid, $id);
// Puis les votes
$this->handlers->h_oledrion_votedata->deleteProductRatings($id);
// Puis les produits relatifs
$this->handlers->h_oledrion_related->deleteProductRelatedProducts($id);
// Les images (la grande et la miniature)
$product->deletePictures();
// Le fichier attaché
$product->deleteAttachment();
// Les fichiers attachés
$this->handlers->h_oledrion_files->deleteProductFiles($id);
// Suppression dans les paniers persistants enregistrés
$this->handlers->h_oledrion_persistent_cart->deleteProductForAllCarts($id);
// Les attributs qui lui sont rattachés
$this->handlers->h_oledrion_attributes->deleteProductAttributes($id);
// Le produit dans les listes
$this->handlers->h_oledrion_products_list->deleteProductFromLists($id);
// La relation entre le produit et le fabricant
$this->handlers->h_oledrion_productsmanu->removeManufacturerProduct($id);
// Le produit dans les remises
$this->handlers->h_oledrion_discounts->removeProductFromDiscounts($id);
// Et le produit en lui même, à la fin
return $this->handlers->h_oledrion_products->delete($product, true);
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:34,代码来源:oledrion_shelf.php
示例2: deleteProduct
/**
* Supprime un produit (et tout ce qui lui est relatif)
* @param myshop_products $product
*/
function deleteProduct(myshop_products $product)
{
global $xoopsModule;
$id = $product->getVar('product_id');
// On commence par supprimer les commentaires
$mid = $xoopsModule->getVar('mid');
xoops_comment_delete($mid, $id);
// Puis les votes
$this->handlers->h_myshop_votedata->deleteProductRatings($id);
// Puis les produits relatifs
$this->handlers->h_myshop_related->deleteProductRelatedProducts($id);
// Les images (la grande et la miniature)
$product->deletePictures();
// Le fichier attaché
$product->deleteAttachment();
// Les fichiers attachés
$this->handlers->h_myshop_files->deleteProductFiles($id);
// Suppression dans les paniers enregistrés
$this->handlers->h_myshop_persistent_cart->deleteProductForAllCarts($id);
// Et le produit en lui même, à la fin
return $this->handlers->h_myshop_products->delete($product, true);
}
开发者ID:naao,项目名称:myshop,代码行数:26,代码来源:myshop_shelf.php
示例3: isset
<?php
include "header.php";
$op = isset($_POST["op"]) ? $_POST["op"] : "list";
$topic_id = isset($_POST["topic_id"]) ? intval($_POST["topic_id"]) : 0;
$topic_handler = xoops_getmodulehandler("topics", "press");
switch ($op) {
case "deletetopic":
if (!$GLOBALS['xoopsSecurity']->check()) {
redirect_header("index.php", 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
exit;
}
$topic = $topic_handler->get($topic_id);
xoops_comment_delete($xoopsModule->getVar('mid'), $topic_id);
if ($topic_handler->delete($topic)) {
$stop = _PRESS_SUCCESSFULLY;
} else {
$stop = _PRESS_DATABASE_FAIL;
}
redirect_header("index.php", 5, $stop);
break;
case "savecategory":
if (!$GLOBALS['xoopsSecurity']->check()) {
redirect_header("category.php", 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
exit;
}
$cat_id = isset($_POST["cat_id"]) ? intval($_POST["cat_id"]) : 0;
$category_handler = xoops_getmodulehandler("category", "press");
if (empty($cat_id)) {
$cat_obj = $category_handler->get();
} else {
开发者ID:yunsite,项目名称:xoopsdc,代码行数:31,代码来源:action.php
示例4: delete
function delete()
{
global $xoopsDB, $HTTP_POST_VARS, $HTTP_GET_VARS, $xoopsConfig, $xoopsModule;
$sql = "DELETE FROM " . $this->table . " WHERE articleid=" . $this->articleid . "";
if (!($result = $this->db->query($sql))) {
return false;
}
if (isset($this->commentstable) && $this->commentstable != "") {
xoops_comment_delete($xoopsModule->getVar('mid'), $this->articleid);
}
if (isset($this->filestable) && $this->filestable != "") {
$this->files = WfsFiles::getAllbyArticle($this->articleid);
foreach ($this->files as $file) {
$file->delete();
}
}
return true;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:18,代码来源:wfsarticle.php
示例5: delTopic
function delTopic()
{
if (!isset($_REQUEST['topic_id']) || $_REQUEST['topic_id'] == 0) {
redirect_header('index.php?op=topicsmanager', 3, _AMS_AM_NOTOPICSELECTED);
}
global $xoopsDB, $xoopsModule;
if (!isset($_POST['ok'])) {
echo "<h4>" . _AMS_AM_CONFIG . "</h4>";
$xt = new XoopsTopic($xoopsDB->prefix("ams_topics"), intval($_GET['topic_id']));
xoops_confirm(array('op' => 'delTopic', 'topic_id' => intval($_GET['topic_id']), 'ok' => 1), 'index.php', _AMS_AM_WAYSYWTDTTAL . '<br />' . $xt->topic_title('S'));
} else {
$xt = new XoopsTopic($xoopsDB->prefix("ams_topics"), intval($_POST['topic_id']));
// get all subtopics under the specified topic
$topic_arr = $xt->getAllChildTopics();
array_push($topic_arr, $xt);
foreach ($topic_arr as $eachtopic) {
// get all stories in each topic
$story_arr = AmsStory::getByTopic($eachtopic->topic_id());
foreach ($story_arr as $eachstory) {
if (false != $eachstory->delete()) {
xoops_comment_delete($xoopsModule->getVar('mid'), $eachstory->storyid());
xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'story', $eachstory->storyid());
}
}
// all stories for each topic is deleted, now delete the topic data
$eachtopic->delete();
// Delete also the notifications and permissions
xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'category', $eachtopic->topic_id);
xoops_groupperm_deletebymoditem($xoopsModule->getVar('mid'), 'ams_approve', $eachtopic->topic_id);
xoops_groupperm_deletebymoditem($xoopsModule->getVar('mid'), 'ams_submit', $eachtopic->topic_id);
xoops_groupperm_deletebymoditem($xoopsModule->getVar('mid'), 'ams_view', $eachtopic->topic_id);
}
redirect_header('index.php?op=topicsmanager', 1, _AMS_AM_DBUPDATED);
exit;
}
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:36,代码来源:index.php
示例6: myalbum_delete_photos
function myalbum_delete_photos($whr)
{
global $xoopsDB;
global $photos_dir, $thumbs_dir, $myalbum_mid;
global $table_photos, $table_text, $table_votedata;
$prs = $xoopsDB->query("SELECT lid, ext FROM {$table_photos} WHERE {$whr}");
while (list($lid, $ext) = $xoopsDB->fetchRow($prs)) {
xoops_comment_delete($myalbum_mid, $lid);
xoops_notification_deletebyitem($myalbum_mid, 'photo', $lid);
$xoopsDB->query("DELETE FROM {$table_votedata} WHERE lid={$lid}") or die("DB error: DELETE votedata table.");
$xoopsDB->query("DELETE FROM {$table_text} WHERE lid={$lid}") or die("DB error: DELETE text table.");
$xoopsDB->query("DELETE FROM {$table_photos} WHERE lid={$lid}") or die("DB error: DELETE photo table.");
@unlink("{$photos_dir}/{$lid}.{$ext}");
@unlink("{$photos_dir}/{$lid}.gif");
@unlink("{$thumbs_dir}/{$lid}.{$ext}");
@unlink("{$thumbs_dir}/{$lid}.gif");
}
}
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:18,代码来源:functions.php
示例7: xoopsFaq_CleanVars
$obj->displayForm();
} else {
$category_handler->displayError(_AM_XOOPSFAQ_ERRORCOULDNOTEDITCAT);
}
break;
case 'delete':
$ok = xoopsFaq_CleanVars($_REQUEST, 'ok', 0, 'int');
$category_id = xoopsFaq_CleanVars($_REQUEST, 'category_id', 0, 'int');
if (1 == $ok) {
$obj = $category_handler->get($category_id);
if (is_object($obj)) {
if ($category_handler->delete($obj)) {
$sql = sprintf('DELETE FROM %s WHERE contents_cid = %u', $xoopsDB->prefix('xoopsfaq_contents'), $category_id);
$xoopsDB->query($sql);
// delete comments
xoops_comment_delete($xoopsModule->getVar('mid'), $category_id);
redirect_header('category.php', 1, _AM_XOOPSFAQ_DBSUCCESS);
}
}
$category_handler->displayError(_AM_XOOPSFAQ_ERRORCOULDNOTDELCAT);
} else {
xoops_cp_header();
//xoopsFaq_AdminMenu(1);
$index_admin = new ModuleAdmin();
echo $index_admin->addNavigation('category.php');
//xoopsFaq_DisplayHeading(_AM_XOOPSFAQ_CATEGORY_HEADER, _AM_XOOPSFAQ_CATEGORY_DELETE_DSC, false);
xoopsFaq_DisplayHeading('', _AM_XOOPSFAQ_CATEGORY_DELETE_DSC, false);
xoops_confirm(array('op' => 'delete', 'category_id' => $category_id, 'ok' => 1), 'category.php', _AM_XOOPSFAQ_RUSURECAT);
}
break;
case 'save':
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:31,代码来源:category.php
示例8: isset
$storyid = isset( $_POST['storyid'] ) ? intval( $_POST['storyid'] ) : 0 ;
if ( empty($storyid) ){
die( _MD_EMPTYNODELETE );
exit();
}
$story = new Bulletin( $mydirname , $storyid );
if (!$story){
die( _MD_EMPTYNODELETE );
exit();
}
// Remove the related articles
$story->relation->queryUnlinkById($storyid);
$story->relation->queryDelete(1);
$story -> delete();
xoops_comment_delete( $xoopsModule->getVar('mid'), $storyid );
xoops_notification_deletebyitem( $xoopsModule->getVar('mid'), 'story', $storyid );
if( $return == 1){
redirect_header( $mydirurl.'/index.php?mode=admin&op=list', 1, _MD_DBPUDATED );
}else{
redirect_header( $mydirurl.'/index.php', 1, _MD_DBPUDATED );
}
exit();
}else{
require_once XOOPS_ROOT_PATH.'/header.php';
xoops_confirm( array( 'op' => 'delete', 'storyid' => $storyid, 'ok' => 1, 'return' => $return, 'XOOPS_G_TICKET'=>$xoopsGTicket->issue( __LINE__ ) ), 'index.php?page=submit', $story->getVar('title').'<br/><br/>'._MD_RUSUREDEL );
require_once XOOPS_ROOT_PATH.'/footer.php';
}
}
?>
开发者ID:nunoluciano,项目名称:uxcl,代码行数:30,代码来源:submit.php
示例9: unset
$sform->display();
unset($hidden);
}
switch ($op) {
case "mod":
xoops_cp_header();
adminmenu(_AM_CHANADMIN, $extra = '');
$CID = isset($HTTP_POST_VARS['CID']) ? $HTTP_POST_VARS['CID'] : $CID;
edittopic($CID);
break;
case "del":
global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB;
if ($confirm) {
$xoopsDB->query("DELETE FROM " . $xoopsDB->prefix("wfschannel") . " WHERE CID = {$CID}");
xoops_groupperm_deletebymoditem($xoopsModule->getVar('mid'), '', $CID);
xoops_comment_delete($xoopsModule->getVar('mid'), $CID);
redirect_header("index.php", 1, sprintf(_AM_CHANISDELETED, $pagetitle));
exit;
} else {
$CID = isset($HTTP_POST_VARS['CID']) ? $HTTP_POST_VARS['CID'] : $CID;
$result = $xoopsDB->query("SELECT CID, pagetitle FROM " . $xoopsDB->prefix("wfschannel") . " ");
if ($xoopsDB->getRowsNum($result) == 1) {
redirect_header("index.php", 3, _AM_CANNOTDELETELASTONE);
exit;
}
$result = $xoopsDB->query("SELECT CID, pagetitle FROM " . $xoopsDB->prefix("wfschannel") . " WHERE CID = {$CID}");
list($CID, $pagetitle) = $xoopsDB->fetchrow($result);
xoops_cp_header();
echo "<table width='100%' border='0' cellpadding = '2' cellspacing='1' class = 'confirmMsg'><tr><td class='confirmMsg'>";
echo "<div class='confirmMsg'>";
echo "<h4>" . _AM_DELTHISCHAN . "</h4>";
开发者ID:amjadtbssm,项目名称:website,代码行数:31,代码来源:index.php
示例10: redirect_header
} else {
if (!empty($_POST['delete']) || !empty($_POST['op']) && $_POST['op'] == 'delete') {
if (!$xoopsGTicket->check()) {
redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
}
$entry =& getEntry($_POST);
if (!empty($_POST['ok'])) {
// After delete, return the user to the user's blog they were reading.
$link = sprintf('%s/modules/%s/index.php?user_id=%d', XOOPS_URL, $xoopsModule->dirname(), $entry->getVar('user_id'));
$isEditable = $entry->getVar('user_id') == $currentuid || $isAdmin;
if ($isEditable) {
$ret = $weblog->removeEntry($entry->getVar('blog_id'));
if ($ret) {
// delete trackbacks
$tb_operator->removeTrackback($entry->getVar('blog_id'));
xoops_comment_delete($xoopsModule->getVar('mid'), $entry->getVar('blog_id'));
xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'blog_entry', $entry->getVar('blog_id'));
redirect_header($link, 2, _BL_BLOG_DELETED);
} else {
redirect_header($link, 5, _BL_BLOG_NOT_DELETED);
}
} else {
redirect_header($link, 5, _BL_BLOG_NOT_DELETED);
// TODO
}
} else {
require XOOPS_ROOT_PATH . '/header.php';
weblog_confirm(array('blog_id' => $entry->getVar('blog_id'), 'private' => $entry->isPrivate(), 'dohtml' => !$entry->doHtml(), 'dobr' => $entry->doBr(), 'updateping' => $entry->isUpdateping(), 'specify_created' => $entry->isSpecifycreated(), 'user_id' => $entry->getVar('user_id'), 'cat_id' => $entry->getVar('cat_id'), 'created' => $entry->getVar('created'), 'title' => $entry->getVar('title', 'n'), 'contents' => $entry->getVar('contents', 'n'), 'ent_trackbackurl' => $entry->getVar('ent_trackbackurl'), 'permission_group' => $entry->getVar('permission_group'), 'XOOPS_G_TICKET' => $xoopsGTicket->issue(__LINE__), 'op' => 'delete', 'ok' => 1), 'post.php', sprintf(_BL_CONFIRM_DELETE, stripslashes($entry->getVar('title'))), false, true);
require XOOPS_ROOT_PATH . '/footer.php';
}
} else {
开发者ID:koki-h,项目名称:xoops_utf8,代码行数:31,代码来源:post.php
示例11: urlencode
$mes = urlencode(sprintf("{$records} " . _AM_FMT_IMPORTED, $calname));
$cal->redirect("done=imported&mes={$mes}");
exit;
}
} else {
if (isset($_POST['delete'])) {
// Ticket Check
if (!$xoopsGTicket->check()) {
redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
}
// レコードの削除
if (isset($_POST['ids']) && is_array($_POST['ids'])) {
$whr = "";
foreach ($_POST['ids'] as $id) {
$whr .= "id={$id} OR rrule_pid={$id} OR ";
xoops_comment_delete($xoopsModule->mid(), $id);
}
$sql = "DELETE FROM {$cal->table} WHERE ({$whr} 0) AND (rrule_pid=0 OR rrule_pid=id)";
mysql_query($sql, $conn);
$records = mysql_affected_rows($conn);
$sql = "DELETE FROM {$cal->table} WHERE {$whr} 0 ";
if (!mysql_query($sql, $conn)) {
echo mysql_error();
} else {
$mes = urlencode("{$records} " . _AM_MES_DELETED);
}
} else {
$mes = "";
}
$cal->redirect("done=deleted&mes={$mes}");
exit;
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:31,代码来源:icalendar_import.php
示例12: delCategory
function delCategory($post, $get)
{
global $xoopsConfig, $xoopsModule;
$cat_handler =& xoops_getmodulehandler('category');
$gperm_handler =& xoops_gethandler('groupperm');
if (!isset($post['ok']) || $post['ok'] != 1) {
$category =& $cat_handler->get($get['cat_id']);
xoops_cp_header();
xoops_confirm(array('action' => 'delCat', 'cat_id' => intval($get['cat_id']), 'ok' => 1), 'catmanager.php', sprintf(_AM_WEBLOG_DELCONFIRM, $category->getVar('cat_title')));
xoops_cp_footer();
} else {
$entry_handler =& xoops_getmodulehandler('entry');
$id_arr = $cat_handler->getAllChildrenIds($post['cat_id']);
array_push($id_arr, $post['cat_id']);
foreach ($id_arr as $id) {
$criteria = new criteria('cat_id', $id);
$entries = $entry_handler->getObjects($criteria);
foreach ($entries as $entry) {
if ($entry_handler->delete($entry)) {
xoops_comment_delete($xoopsModule->getVar('mid'), $entry->getVar('blog_id'));
xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'blog_entry', $entry->getVar('blog_id'));
}
}
$category =& $cat_handler->create();
$category->setVar('cat_id', $id);
$cat_handler->delete($category);
// delete category
$gperm_handler->deleteByModule($xoopsModule->getVar('mid'), 'weblog_cat_post', $id);
// delete gperm
/******
xoops_notification_deleteitem($xoopsModule->getVar('mid'), 'category', $id);
******/
}
redirect_header('catmanager.php', 2, _AM_WEBLOG_CATDELETED);
exit;
}
}
开发者ID:koki-h,项目名称:xoops_utf8,代码行数:37,代码来源:catmanager.php
示例13: deletesong
function deletesong($del = 0)
{
global $xoopsDB, $xoopsModule;
if (isset($_POST['del']) && $_POST['del'] == 1) {
$sql = "\r\n\t\tDELETE FROM " . $xoopsDB->prefix('debaser_files') . "\r\n\t\tWHERE xfid=" . intval($_POST['mpegid']) . "";
if ($xoopsDB->query($sql)) {
@unlink(XOOPS_ROOT_PATH . '/modules/debaser/upload/' . $_POST['delfile']);
xoops_comment_delete($xoopsModule->getVar('mid'), $_POST['mpegid']);
xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'song', $_POST['mpegid']);
redirect_header('index.php', 2, $_POST['delfile'] . _AM_DEBASER_DELETED);
} else {
redirect_header('index.php', 2, $_POST['delfile'] . _AM_DEBASER_NOTDELETED);
}
exit;
} else {
echo "<h4>" . _AM_DEBASER_FILEADMIN . "</h4>";
if (isset($_POST['delfile']) && $_POST['mpegid']) {
$delfile = $_POST['delfile'];
$mpegid = $_POST['mpegid'];
} else {
$delfile = $_GET['delfile'];
$mpegid = $_GET['mpegid'];
}
xoops_confirm(array('delfile' => $delfile, 'mpegid' => $mpegid, 'del' => 1), 'index.php?op=deletesong', _AM_DEBASER_SUREDELETEFILE);
}
}
开发者ID:artistafrustrado,项目名称:debaser-diaadiaeducacao,代码行数:26,代码来源:index.php
示例14: delete_picture
function delete_picture($pid)
{
global $xoopsModuleConfig, $header_printed, $xoopsDB;
global $del_pic, $xoopsModule;
if (!$header_printed) {
output_table_header();
}
$myts =& MyTextSanitizer::getInstance();
// MyTextSanitizer object
$green = "<img src=\"images/green.gif\" border=\"0\" width=\"12\" height=\"12\" alt=\"\" /><br />";
$red = "<img src=\"images/red.gif\" border=\"0\" width=\"12\" height=\"12\" alt=\"\" /><br />";
if (USER_IS_ADMIN) {
$query = "SELECT aid, filepath, filename FROM " . $xoopsDB->prefix("xcgal_pictures") . " WHERE pid='{$pid}'";
$result = $xoopsDB->query($query);
if (!$xoopsDB->getRowsNum($result)) {
redirect_header('index.php', 2, _MD_NON_EXIST_AP);
}
$pic = $xoopsDB->fetchArray($result);
} else {
$query = "SELECT " . $xoopsDB->prefix("xcgal_pictures") . ".aid as aid, category, filepath, filename FROM " . $xoopsDB->prefix("xcgal_pictures") . ", " . $xoopsDB->prefix("xcgal_albums") . " WHERE " . $xoopsDB->prefix("xcgal_pictures") . ".aid = " . $xoopsDB->prefix("xcgal_albums") . ".aid AND pid='{$pid}'";
$result = $xoopsDB->query($query);
if (!$xoopsDB->getRowsNum($result)) {
redirect_header('index.php', 2, _MD_NON_EXIST_AP);
}
$pic = $xoopsDB->fetchArray($result);
if ($pic['category'] != FIRST_USER_CAT + USER_ID) {
redirect_header('index.php', 2, _MD_PERM_DENIED);
}
}
$aid = $pic['aid'];
$dir = $xoopsModuleConfig['fullpath'] . $pic['filepath'];
$file = $pic['filename'];
if (!is_writable($dir)) {
redirect_header('index.php', 2, sprintf(_MD_DIRECTORY_RO, htmlspecialchars($dir)));
}
$del_pic = "<tr><td class=\"even\">" . $myts->makeTboxData4Show($file) . "</td>";
$files = array($dir . $file, $dir . $xoopsModuleConfig['normal_pfx'] . $file, $dir . $xoopsModuleConfig['thumb_pfx'] . $file);
foreach ($files as $currFile) {
$del_pic .= "<td class=\"even\" align=\"center\">";
if (is_file($currFile)) {
if (@unlink($currFile)) {
$del_pic .= $green;
} else {
$del_pic .= $red;
}
} else {
$del_pic .= " ";
}
$del_pic .= "</td>";
}
$deleted = xoops_comment_delete($xoopsModule->getVar('mid'), $pid);
$del_pic .= "<td class=\"even\" align=\"center\">";
if ($deleted) {
$del_pic .= $green;
} else {
$del_pic .= " ";
}
$del_pic .= "</td>";
$query = "DELETE FROM " . $xoopsDB->prefix("xcgal_pictures") . " WHERE pid='{$pid}' LIMIT 1";
$result = $xoopsDB->queryf($query);
$del_pic .= "<td class=\"even\" align=\"center\">";
if ($xoopsDB->getAffectedRows() > 0) {
$del_pic .= $green;
} else {
$del_pic .= $red;
}
$del_pic .= "</td>";
$del_pic .= "</tr>\n";
return $aid;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:70,代码来源:delete.php
示例15: xoopsFaq_CleanVars
$obj->displayForm();
} else {
$contents_handler->displayError(_AM_XOOPSFAQ_ERRORCOULDNOTEDITCAT);
}
break;
case 'delete':
$ok = xoopsFaq_CleanVars($_REQUEST, 'ok', 0, 'int');
$contents_id = xoopsFaq_CleanVars($_REQUEST, 'contents_id', 0, 'int');
if (1 == $ok) {
$obj = $contents_handler->get($contents_id);
if (is_object($obj)) {
if ($contents_handler->delete($obj)) {
$sql = sprintf('DELETE FROM %s WHERE contents_id = %u', $xoopsDB->prefix('xoopsfaq_contents'), $contents_id);
$xoopsDB->query($sql);
// delete comments
xoops_comment_delete($xoopsModule->getVar('mid'), $contents_id);
redirect_header('main.php', 1, _AM_XOOPSFAQ_DBSUCCESS);
}
}
$contents_handler->displayError(_AM_XOOPSFAQ_ERRORCOULDNOTDELCAT);
} else {
xoops_cp_header();
//xoopsFaq_AdminMenu(0);
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation('main.php');
//xoopsFaq_DisplayHeading(_AM_XOOPSFAQ_CONTENTS_HEADER, _AM_XOOPSFAQ_CATEGORY_DELETE_DSC, false);
xoopsFaq_DisplayHeading('', _AM_XOOPSFAQ_CATEGORY_DELETE_DSC, false);
xoops_confirm(array('op' => 'delete', 'contents_id' => $contents_id, 'ok' => 1), 'main.php', _AM_XOOPSFAQ_RUSURECAT);
}
break;
case 'save':
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:31,代码来源:main.php
示例16: delNewDownload
function delNewDownload()
{
global $xoopsDB, $eh, $xoopsModule;
$sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mydownloads_downloads"), $_GET['lid']);
$xoopsDB->query($sql) or $eh->show("0013");
$sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mydownloads_text"), $_GET['lid']);
$xoopsDB->query($sql) or $eh->show("0013");
// delete comments
xoops_comment_delete($xoopsModule->getVar('mid'), $_GET['lid']);
redirect_header("index.php", 1, _MD_FILEDELETED);
}
开发者ID:koki-h,项目名称:xoops_utf8,代码行数:11,代码来源:index.php
示例17: process_post_data
function process_post_data()
{
global $_POST, $xoopsModuleConfig, $xoopsDB;
global $user_albums_list, $xoopsModule, $myts;
$user_album_set = array();
foreach ($user_albums_list as $album) {
$user_album_set[$album['aid']] = 1;
}
if (!is_array($_POST['pid'])) {
redirect_header('index.php', 2, _MD_PARAM_MISSING);
}
$pid_array =& $_POST['pid'];
foreach ($pid_array as $pid) {
$pid = (int) $pid;
$aid = (int) get_post_var('aid', $pid);
$title = get_post_var('title', $pid);
$caption = get_post_var('caption', $pid);
$keywords = get_post_var('keywords', $pid);
$user1 = get_post_var('user1', $pid);
$user2 = get_post_var('user2', $pid);
$user3 = get_post_var('user3', $pid);
$user4 = get_post_var('user4', $pid);
$delete = isset($_POST['delete' . $pid]);
$reset_vcount = isset($_POST['reset_vcount' . $pid]);
$reset_votes = isset($_POST['reset_votes' . $pid]);
$del_comments = isset($_POST['del_comments' . $pid]) || $delete;
$query = "SELECT category, filepath, filename, owner_id FROM " . $xoopsDB->prefix("xcgal_pictures") . ", " . $xoopsDB->prefix("xcgal_albums") . " WHERE " . $xoopsDB->prefix("xcgal_pictures") . ".aid = " . $xoopsDB->prefix("xcgal_albums") . ".aid AND pid='{$pid}'";
$result = $xoopsDB->query($query);
if (!$xoopsDB->getRowsNum($result)) {
redirect_header('index.php', 2, _MD_NON_EXIST_AP);
}
$pic = $xoopsDB->fetchArray($result);
$xoopsDB->freeRecordSet($result);
if (!USER_IS_ADMIN) {
if ($pic['category'] != FIRST_USER_CAT + USER_ID) {
redirect_header('index.php', 2, _MD_PERM_DENIED . "<br />(picture category = {$pic['category']}/ {$pid})");
}
if (!isset($user_album_set[$aid])) {
redirect_header('index.php', 2, _MD_PERM_DENIED . "<br />(target album = {$aid})");
}
}
$update = "aid = '" . $aid . "'";
$update .= ", title = '" . $myts->makeTboxData4Save($title) . "'";
$update .= ", caption = '" . $myts->makeTareaData4Save($caption, 0) . "'";
$update .= ", keywords = '" . $myts->makeTboxData4Save($keywords) . "'";
$update .= ", user1 = '" . $myts->makeTboxData4Save($user1) . "'";
$update .= ", user2 = '" . $myts->makeTboxData4Save($user2) . "'";
$update .= ", user3 = '" . $myts->makeTboxData4Save($user3) . "'";
$update .= ", user4 = '" . $myts->makeTboxData4Save($user4) . "'";
if ($reset_vcount) {
$update .= ", hits = '0'";
}
if ($reset_votes) {
$update .= ", pic_rating = '0', votes = '0'";
}
if (UPLOAD_APPROVAL_MODE) {
$approved = get_post_var('approved', $pid);
if ($approved == 'YES') {
$update .= ", approved = 'YES'";
} elseif ($approved == 'DELETE') {
$del_comments = 1;
$delete = 1;
}
}
if ($del_comments) {
//$query = "DELETE FROM ".$xoopsDB->prefix("xcgal_comments")." WHERE pid='$pid'";
//$result =$xoopsDB->query($query);
xoops_comment_delete($xoopsModule->getVar('mid'), $pid);
}
if ($delete) {
$dir = $xoopsModuleConfig['fullpath'] . $pic['filepath'];
$file = $pic['filename'];
if (!is_writable($dir)) {
redirect_header('index.php', 2, sprintf(_MD_DIRECTORY_RO, $dir));
}
$files = array($dir . $file, $dir . $xoopsModuleConfig['normal_pfx'] . $file, $dir . $xoopsModuleConfig['thumb_pfx'] . $file);
foreach ($files as $currFile) {
if (is_file($currFile)) {
@unlink($currFile);
}
}
$query = "DELETE FROM " . $xoopsDB->prefix("xcgal_pictures") . " WHERE pid='{$pid}' LIMIT 1";
$result = $xoopsDB->query($query);
} else {
$query = "UPDATE " . $xoopsDB->prefix("xcgal_pictures") . " SET {$update} WHERE pid='{$pid}' LIMIT 1";
$result = $xoopsDB->query($query);
if ($pic['owner_id'] != 0) {
$submitter = new XoopsUser($pic['owner_id']);
$submitter->incrementPost();
}
}
}
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:93,代码来源:editpics.php
示例18: redirect_header
//ver3.0
if (!is_array($_POST['topics'])) {
redirect_header('index.php?op=topicsmanager', 1, _TAKINGBACK);
} else {
$move_topics = array_map('intval', $_POST['topics']);
}
$gperm =& BulletinGP::getInstance($mydirname);
array_push($topic_arr, $BTopic);
foreach ($topic_arr as $eachtopic) {
if ($move_topics[$eachtopic->topic_id()] == 0) {
// Gets all articles
$story_arr = Bulletin::getAllByTopic($mydirname, $eachtopic->topic_id());
foreach ($story_arr as $eachstory) {
if (false != $eachstory->delete()) {
//Delete Comment
xoops_comment_delete($xoopsModule->getVar('mid'), $eachstory->getVar('storyid'));
//Delete an event notification
xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'story', $eachstory->getVar('storyid'));
}
}
} else {
// Gets all articles
$story_arr = Bulletin::getAllByTopic($mydirname, $eachtopic->topic_id());
foreach ($story_arr as $eachstory) {
$eachstory->setVar('topicid', $move_topics[$eachtopic->topic_id()]);
$eachstory->store();
}
}
// Delete the topic
$eachtopic->delete();
//ver3.0
开发者ID:nouphet,项目名称:rata,代码行数:31,代码来源:index.php
示例19: delTopic
function delTopic()
{
global $xoopsDB, $xoopsConfig, $xoopsModule;
if (empty($_POST['ok'])) {
xoops_cp_header();
echo "<h4>" . _AM_CONFIG . "</h4>";
xoops_confirm(array('op' => 'delTopic', 'topic_id' => intval($_GET['topic_id']), 'ok' => 1), 'index.php', _AM_WAYSYWTDTTAL);
} else {
$xt = new XoopsTopic($xoopsDB->prefix("topics"), $_POST['topic_id']);
// get all subtopics under the specified topic
$topic_arr = $xt->getAllChildTopics();
array_push($topic_arr, $xt);
foreach ($topic_arr as $eachtopic) {
// get all stories in each topic
$story_arr = NewsStory::getByTopic($eachtopic->topic_id());
foreach ($story_arr as $eachstory) {
if (false != $eachstory->delete()) {
xoops_comment_delete($xoopsModule->getVar('mid'), $eachstory->storyid());
xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'story', $eachstory->storyid());
}
}
// all stories for each topic is deleted, now delete the topic data
$eachtopic->delete();
xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'category', $eachtopic->topic_id);
}
redirect_header('index.php?op=topicsmanager', 1, _AM_DBUPDATED);
exit;
}
}
开发者ID:koki-h,项目名称:xoops_utf8,代码行数:29,代码来源:index.php
示例20: delNewLink
function delNewLink()
{
global $xoopsDB, $eh, $xoopsModule;
$lid = mylinksUtility::mylinks_cleanVars($_GET, 'lid', 0, 'int', array('min' => 0));
$sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_links"), $lid);
$xoopsDB->query($sql) or $eh->show('0013');
$sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_text"), $lid);
$xoopsDB->query($sql) or $eh->show('0013');
// delete comments
xoops_comment_delete($xoopsModule->getVar('mid'), $lid);
// delete notifications
xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'link', $lid);
redirect_header('index.php', 2, _MD_MYLINKS_LINKDELETED);
}
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:14,代码来源:main.php
注:本文中的xoops_comment_delete函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论