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


PHP delete_category函数代码示例

本文整理汇总了PHP中delete_category函数的典型用法代码示例。如果您正苦于以下问题:PHP delete_category函数的具体用法?PHP delete_category怎么用?PHP delete_category使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: delete_category

function delete_category($cid)
{
    global $db;
    $q = $db->prepare("SELECT category_id FROM phph_categories WHERE category_parent = ?");
    $r = $db->execute($q, $cid);
    if (PEAR::isError($r)) {
        die($r->getMessage());
    }
    while ($row = $r->fetchRow()) {
        delete_category($row['category_id']);
    }
    $q = $db->prepare("DELETE FROM phph_categories WHERE category_id = ?");
    $r = $db->execute($q, $cid);
    if (PEAR::isError($r)) {
        die($r->getMessage());
    }
}
开发者ID:BackupTheBerlios,项目名称:phphoto-svn,代码行数:17,代码来源:remove_category.php

示例2: delete_category

function delete_category($filecat)
{
    $rubrics = safe_query("SELECT filecatID FROM " . PREFIX . "files_categorys WHERE subcatID = '" . $filecat . "' ORDER BY name");
    if (mysql_num_rows($rubrics)) {
        while ($ds = mysql_fetch_assoc($rubrics)) {
            delete_category($ds['filecatID']);
        }
    }
    safe_query("DELETE FROM " . PREFIX . "files_categorys WHERE filecatID='" . $filecat . "'");
    $files = safe_query("SELECT * FROM " . PREFIX . "files WHERE filecatID='" . $filecat . "'");
    while ($ds = mysql_fetch_array($files)) {
        if (stristr($ds['file'], "http://") or stristr($ds['file'], "ftp://")) {
            @unlink('../downloads/' . $ds['file']);
        }
    }
    safe_query("DELETE FROM " . PREFIX . "files WHERE filecatID='" . $filecat . "'");
}
开发者ID:hellagent75,项目名称:ign_live,代码行数:17,代码来源:filecategorys.php

示例3: get_category_by_id

        exit;
    }
    $id = $_GET['id'];
    $category = get_category_by_id($id);
    $tab_category = $dom->get_elements_by_tagname('category');
    foreach ($tab_category as $cat) {
        if ($cat->get_attribute('xml_file') == $category->xml_file) {
            $node = $cat;
        }
    }
    $parent = $node->parent_node();
    $parent->remove_child($node);
    $dom->dump_file($file);
    unlink("/etc/ossim/server/" . $category->xml_file);
    // modify directives.xml now
    delete_category(str_replace(" ", "-", $category->name));
    echo "<html><body onload=\"top.frames['main'].document.location.href='../numbering.php'\"></body></html>";
} elseif ($query == "save_group") {
    $file = '/etc/ossim/server/groups.xml';
    if (!($dom = domxml_open_file($file, DOMXML_LOAD_SUBSTITUTE_ENTITIES))) {
        echo _("Error while parsing the document") . "\n";
        exit;
    }
    $group = unserialize($_SESSION['group']);
    $oldname = $group->name;
    $oldlist = $group->list;
    $new_node = $dom->create_element('group');
    $new_node->set_attribute("name", $_POST["name"]);
    $list = split(',', $_POST["list"]);
    foreach ($list as $dir) {
        $new_child = $dom->create_element('append-directive');
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:utils.php

示例4: define

  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

************************************************************************/
define('OPENLD_ROOT', './');
require OPENLD_ROOT . 'admin_header.php';
$req_page = isset($_REQUEST['page']) ? is_numeric($_REQUEST['page']) ? $_REQUEST['page'] : '1' : '1';
$req_id = isset($_REQUEST['id']) ? $_REQUEST['id'] : '0';
$req_cat = isset($_REQUEST['category']) ? $_REQUEST['category'] : '';
($hook = get_hook('admin_browse_before_sql_input_check')) ? eval($hook) : null;
//SQL Operations
if (isset($_REQUEST['delete'])) {
    delete_category($_REQUEST['delete']);
} elseif (isset($_REQUEST['delete_link'])) {
    delete_link($_REQUEST['delete_link']);
} elseif (isset($_REQUEST['move_cat_sql'])) {
    move_category($req_id, $req_page, $_REQUEST['move_cat_sql'], $_REQUEST['to_new_parent']);
} elseif (isset($_REQUEST['move_link_sql'])) {
    move_link($req_id, $req_page, $_REQUEST['move_link_sql'], $_REQUEST['to_new_parent']);
} elseif (isset($_REQUEST['edit_cat_sql'])) {
    edit_a_category($req_id, $req_page, $_REQUEST['cat_id']);
} elseif (isset($_REQUEST['edit_link_sql'])) {
    edit_a_link($req_id, $req_page, $_REQUEST['edit_link_sql']);
} elseif (isset($_REQUEST['add_a_link'])) {
    add_a_link($req_id);
} elseif (isset($_REQUEST['add_a_category'])) {
    add_a_category($req_id);
} elseif (isset($_REQUEST['unaccept'])) {
开发者ID:Dawzz,项目名称:Open-Link-Directory,代码行数:31,代码来源:admin_browse.php

示例5: get_lang

    if ($action == 'deletereceivedfile') {
        $dropboxfile->deleteReceivedWork($_GET['id']);
        $message = get_lang('ReceivedFileDeleted');
    }
    if ($action == 'deletesentfile') {
        $dropboxfile->deleteSentWork($_GET['id']);
        $message = get_lang('SentFileDeleted');
    }
    Display::display_confirmation_message($message);
}
// Delete a category
if (($action == 'deletereceivedcategory' or $action == 'deletesentcategory') and isset($_GET['id']) and is_numeric($_GET['id'])) {
    if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
        api_not_allowed();
    }
    $message = delete_category($action, $_GET['id']);
    Display::display_confirmation_message($message);
}
// Do an action on multiple files
// only the download has is handled separately in dropbox_init_inc.php because this has to be done before the headers are sent
// (which also happens in dropbox_init.inc.php
if (!isset($_POST['feedback']) && (strstr($postAction, 'move_received') or $postAction == 'delete_received' or $postAction == 'download_received' or $postAction == 'delete_sent' or $postAction == 'download_sent')) {
    $display_message = handle_multiple_actions();
    Display::display_normal_message($display_message);
}
// Store Feedback
if (isset($_POST['feedback'])) {
    if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
        api_not_allowed();
    }
    $check = Security::check_token();
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:index.php

示例6: delete_category

<?php

require_once '../../../util/main.php';
require_once '../../../model/database.php';
require_once '../../../model/menu_category_db.php';
$success_notification = '';
$error_notification = '';
if (isset($_POST['id'])) {
    $ids = $_POST['id'];
    try {
        for ($count = 0; $count < count($ids); $count++) {
            $categoryID = $ids[$count];
            delete_category($categoryID);
        }
    } catch (Exception $e) {
        $error_notification = $e->getMessage();
    }
    $success_notification = 'Successfully deleted';
    require_once '../../../util/notification.php';
}
开发者ID:sonialin,项目名称:kconlineorder,代码行数:20,代码来源:category_delete.php

示例7: catch

             $form->assign('is_postAllowed', $forumSettingList['forum_access'] != 0 ? true : false);
             $dialogBox->form($form->render());
         } catch (Exception $ex) {
             if (claro_debug_mode()) {
                 $dialogBox->error('<pre>' . $ex->__toString() . '</pre>');
             } else {
                 $dialogBox->error($ex->getMessage());
             }
         }
     } else {
         $dialogBox->warning(get_lang('There are currently no forum categories!') . '<br/>' . get_lang('Please create a category first'));
         $cmd = 'show';
     }
 }
 if ('exDelCat' == $cmd) {
     if (delete_category($catId)) {
         $dialogBox->success(get_lang('Category deleted'));
     } else {
         $dialogBox->error(get_lang('Unable to delete category'));
         if (claro_failure::get_last_failure() == 'GROUP_FORUMS_CATEGORY_REMOVALE_FORBIDDEN') {
             $dialogBox->error(get_lang('Group forums category can\'t be deleted'));
         } elseif (claro_failure::get_last_failure() == 'GROUP_FORUM_REMOVALE_FORBIDDEN') {
             $dialogBox->error(get_lang('You can not remove a group forum. You have to remove the group first'));
         }
     }
 }
 if ('exDelForum' == $cmd) {
     $forumSettingList = get_forum_settings($forumId);
     if (is_null($forumSettingList['idGroup'])) {
         if (delete_forum($forumId)) {
             $dialogBox->success(get_lang('Forum deleted'));
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:index.php

示例8: delete_categories

function delete_categories()
{
    $category_id = filter_input(INPUT_POST, 'category_id', FILTER_VALIDATE_INT);
    delete_category($category_id);
    header('Location: .?action=list_categories');
}
开发者ID:jonPlancey,项目名称:cs6252_hw05,代码行数:6,代码来源:index.php

示例9: get_category_name

      <input type="reset" value="Clear form" />
      <input type="button" value="Cancel"
         onclick="javascript:window.location='categories.php';" />
      </td></tr>

      </table></form>
<?php 
    }
    /*___________________________________________________________________DELETE__*/
} else {
    if ($action == 'delete') {
        if (isset($_GET['id']) && $_GET['id'] != '') {
            // make sure first that there are no children -- delete them first
            if (count(get_enth_category_children($_GET['id'])) == 0) {
                $cat = get_category_name($_GET['id']);
                $success = delete_category($_GET['id']);
                if ($success) {
                    echo '<p class="success">Category <i>' . $cat . '</i> deleted.</p>';
                } else {
                    echo '<p class="error">Error deleting category. ' . 'Please try again.</p>';
                }
            } else {
                echo '<p class="error">There are categories that are assigned as ' . 'children to this category. Please delete them before ' . 'attempting to delete this category.</p>';
            }
        }
        /*_____________________________________________________________________EDIT__*/
    } else {
        if ($action == 'edit') {
            $show_edit_form = true;
            $show_default = false;
            if (isset($_POST['catname']) && $_POST['catname'] != '') {
开发者ID:adriculous,项目名称:enthusiast,代码行数:31,代码来源:categories.php

示例10: do_html_header

<?php

// include function files for this application
//session_start();
do_html_header('Deleting category');
if (check_admin_user()) {
    if (isset($_POST['catid'])) {
        if (delete_category($_POST['catid'])) {
            echo 'Category was deleted.<br />';
        } else {
            echo 'Category could not be deleted.<br />' . 'This is usually because it is not empty.<br />';
        }
    } else {
        echo 'No category specified.  Please try again.<br />';
    }
    do_html_url(baseurl() . 'cart/admin', 'Back to administration menu');
} else {
    echo 'You are not authorised to view this page.';
}
开发者ID:jamaBHacker,项目名称:cart,代码行数:19,代码来源:delete_category.php

示例11: change_categories

function change_categories() {
	global $user, $current_user, $globals;
	$errors = 0;
	$ncat = 0;
	
	if( !(isset($_POST['new']) || isset($_POST['delete'])) || !isset($_POST['process']) || $_POST['user_id'] != $current_user->user_id ) return;

	if (isset($_POST['delete'])) {
		delete_category(array_keys($_POST['delete']));
	} elseif (isset($_POST['new_cat'])) {
		insert_category(trim($_POST['new_cat']), trim($_POST['new_parent']), trim($_POST['new_feed']), trim($_POST['new_tags']));
	} else {
		foreach (array_keys($_POST['new_cat-edit']) as $key) {
			$category->id[$ncat]=trim($key);
			$ncat++;
		}
		$ncat=0;
		foreach ($_POST['new_cat-edit'] as $catitem) {
			$category->name[$ncat]=trim($catitem);
			$ncat++;
		}
		$ncat=0;
		foreach ($_POST['new_parent-edit'] as $catparent) {
			$category->parent[$ncat]=intval($catparent);
			$ncat++;
		}
		$ncat=0;
		foreach ($_POST['new_feed-edit'] as $catfeed) {
			$category->feed[$ncat]=htmlspecialchars(trim($catfeed));
			$ncat++;
		}
		$ncat=0;
		foreach ($_POST['new_tags-edit'] as $cattags) {
			$category->tags[$ncat]=trim($cattags);
			$ncat++;
		}
		if ( !(empty($_POST['new_cat-edit']) || empty($_POST['new-cat'])) ) {
			$errors = 1;
			echo '<p class="form-error">'._('No ha introducido ninguna categoría nueva').'</p>';
		}
		if ( empty($_POST['new_tags-edit']) ) {
			$errors = 1;
			echo '<p class="form-error">'._('No ha introducido ninguna etiqueta').'</p>';
		}
		if (!$errors) {
			save_categories($category);
			echo '<p class="form-act">'._('Datos actualizados').'</p>';
		}
	}
}
开发者ID:BackupTheBerlios,项目名称:meneamenet-svn,代码行数:50,代码来源:categories.php

示例12: delete_category

<?php

include_once '../functions/database.php';
$id = $_POST['id'];
$result = delete_category($id);
echo $result;
开发者ID:Rednough,项目名称:Phnompenhapple,代码行数:6,代码来源:delete_category.php

示例13: edit_delivery_times

      if(isset($_POST['text'])){
        edit_delivery_times($_POST['text']);
      }

      require "templates/admin/edit-delivery-times.php";
    }
    else if($_GET['action'] == 'edit_delivery_method'){
      if(isset($_POST['text'])){
        edit_delivery_method($_POST['text']);
      }

      require "templates/admin/edit-delivery-method.php";
    }
    else if($_GET['action'] == 'delete_category'){
      if(isset($_POST['id'])){
        delete_category($_POST['id']);
      }

      require "templates/admin/delete-category.php";
    }
    else if($_GET['action'] == 'delete_account'){
      if(isset($_POST['id'])){
        delete_account($_POST['id']);
      }

      require "templates/admin/delete-account.php";
    }
    else if($_GET['action'] == 'ban_account'){
      if(isset($_POST['id'])){
        ban_account($_POST['id']);
      }
开发者ID:jomla97,项目名称:mathandel,代码行数:31,代码来源:index.php

示例14: connect_db

<?php

include_once 'config.php';
include_once 'func.php';
$connection = connect_db();
if (isset($_POST['id'])) {
    delete_category($connection, $_POST['id']);
}
$result = get_category($connection);
?>

<!DOCTYPE HTML>
<html>
<head>
    <title>Remove Category</title>
</head>
<body>
    <div>
        <form action="" method="post">
            <div>
                <div>
                    <select name="id">
                    <?php 
while ($row = mysqli_fetch_assoc($result)) {
    ?>
                    <option value="<?php 
    echo $row['id'];
    ?>
"><?php 
    echo $row['name'];
    ?>
开发者ID:ahmetkasif,项目名称:Mysql-Php-4-lem,代码行数:31,代码来源:remove_category.php

示例15: update_category

    }
}
// edit category
if (isset($_POST['edit_category']) && $_POST['edit_category'] == 'edit') {
    $category_id = (int) $_GET['category_id'];
    $update_status = update_category($category_id);
    if ($update_status === true) {
        header('Location: ' . $url);
    } else {
        $error = $update_status;
    }
}
// delete category
if (isset($_POST['confirm_delete_category']) && $_POST['confirm_delete_category'] == 'Yes') {
    $category_id = (int) $_GET['category_id'];
    $delete_status = delete_category($category_id);
    if ($delete_status === true) {
        $reload = $_SERVER["PHP_SELF"] . '?page_name=categories';
        header('Location: ' . $reload);
    } else {
        $error = $delete_status;
    }
}
// cancel delete tag
if (isset($_POST['cancel_delete_category']) && $_POST['cancel_delete_category'] == 'No') {
    $category_id = (int) $_GET['category_id'];
    header('Location: ' . $_SERVER["PHP_SELF"] . '?page_name=categories&category_id=' . $category_id);
}
// category list
$categories_list = get_categories_admin();
// get main content
开发者ID:justincawthorne,项目名称:Wicked-Words,代码行数:31,代码来源:_categories.php


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