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


PHP nggdb::delete_album方法代码示例

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


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

示例1: processor

 function processor()
 {
     global $wpdb;
     check_admin_referer('ngg_album');
     if (isset($_POST['add']) && isset($_POST['newalbum'])) {
         if (!nggGallery::current_user_can('NextGEN Add/Delete album')) {
             wp_die(__('Cheatin’ uh?'));
         }
         $result = nggdb::add_album($_POST['newalbum']);
         $this->currentID = $result ? $result : 0;
         //hook for other plugins
         do_action('ngg_add_album', $this->currentID);
         if ($result) {
             nggGallery::show_message(__('Update Successfully', 'nggallery'));
         }
     }
     if (isset($_POST['update']) && $this->currentID > 0) {
         $gid = '';
         // get variable galleryContainer
         parse_str($_POST['sortorder']);
         if (is_array($gid)) {
             $serial_sort = serialize($gid);
             $wpdb->query("UPDATE {$wpdb->nggalbum} SET sortorder = '{$serial_sort}' WHERE id = {$this->currentID} ");
         } else {
             $wpdb->query("UPDATE {$wpdb->nggalbum} SET sortorder = '0' WHERE id = {$this->currentID} ");
         }
         //hook for other plugins
         do_action('ngg_update_album_sortorder', $this->currentID);
         nggGallery::show_message(__('Update Successfully', 'nggallery'));
     }
     if (isset($_POST['delete'])) {
         if (!nggGallery::current_user_can('NextGEN Add/Delete album')) {
             wp_die(__('Cheatin’ uh?'));
         }
         $result = nggdb::delete_album($this->currentID);
         //hook for other plugins
         do_action('ngg_delete_album', $this->currentID);
         // jump back to main selection
         $this->currentID = 0;
         if ($result) {
             nggGallery::show_message(__('Album deleted', 'nggallery'));
         }
     }
 }
开发者ID:Ashleyotero,项目名称:oldest-old,代码行数:44,代码来源:album.php

示例2: processor

 function processor()
 {
     global $wpdb;
     check_admin_referer('ngg_album');
     if (isset($_POST['add']) && isset($_POST['newalbum'])) {
         $newalbum = esc_attr($_POST['newalbum']);
         $result = $wpdb->query("INSERT INTO {$wpdb->nggalbum} (name, sortorder) VALUES ('{$newalbum}','0')");
         $this->currentID = (int) $wpdb->insert_id;
         if ($result) {
             nggGallery::show_message(__('Update Successfully', 'nggallery'));
         }
     }
     if (isset($_POST['update']) && $this->currentID > 0) {
         // get variable galleryContainer
         parse_str($_POST['sortorder']);
         if (is_array($gid)) {
             $serial_sort = serialize($gid);
             $wpdb->query("UPDATE {$wpdb->nggalbum} SET sortorder = '{$serial_sort}' WHERE id = {$this->currentID} ");
         } else {
             $wpdb->query("UPDATE {$wpdb->nggalbum} SET sortorder = '0' WHERE id = {$this->currentID} ");
         }
         nggGallery::show_message(__('Update Successfully', 'nggallery'));
     }
     if (isset($_POST['delete'])) {
         $result = nggdb::delete_album($this->currentID);
         if ($result) {
             nggGallery::show_message(__('Album deleted', 'nggallery'));
         }
     }
 }
开发者ID:alx,项目名称:SimplePress,代码行数:30,代码来源:album.php

示例3: nggallery_admin_manage_album

function nggallery_admin_manage_album()
{
    global $wpdb;
    $albumID = (int) $_POST['act_album'];
    if ($_POST['update']) {
        check_admin_referer('ngg_album');
        if ($_POST['newalbum']) {
            $newalbum = attribute_escape($_POST['newalbum']);
            $result = $wpdb->query("INSERT INTO {$wpdb->nggalbum} (name, sortorder) VALUES ('{$newalbum}','0')");
            if ($result) {
                nggGallery::show_message(__('Update Successfully', 'nggallery'));
            }
        }
        if ($albumID > 0) {
            // get variable galleryContainer
            parse_str($_POST['sortorder']);
            if (is_array($gid)) {
                $serial_sort = serialize($gid);
                $wpdb->query("UPDATE {$wpdb->nggalbum} SET sortorder = '{$serial_sort}' WHERE id = {$albumID} ");
            } else {
                $wpdb->query("UPDATE {$wpdb->nggalbum} SET sortorder = '0' WHERE id = {$albumID} ");
            }
            nggGallery::show_message(__('Update Successfully', 'nggallery'));
        }
    }
    if ($_POST['delete']) {
        check_admin_referer('ngg_album');
        $result = nggdb::delete_album($albumID);
        if ($result) {
            nggGallery::show_message(__('Album deleted', 'nggallery'));
        }
    }
    ?>

<script type="text/javascript">

jQuery(document).ready(
	function()
	{

		jQuery('#selectContainer').sortable( {
			items: '.groupItem',
			placeholder: 'sort_placeholder',
			opacity: 0.7,
			tolerance: 'intersect',
			distance: 2,
			connectWith: ["#galleryContainer"] 
		} );

		jQuery('#galleryContainer').sortable( {
			items: '.groupItem',
			placeholder: 'sort_placeholder',
			opacity: 0.7,
			tolerance: 'intersect',
			distance: 2,
			connectWith: ["#selectContainer"] 
		} );
		
		jQuery('a.min').bind('click', toggleContent);

		// Hide used galleries
		jQuery('a#toggle_used').click(function()
			{
				jQuery('#selectContainer div.inUse').toggle();
				return false;
			}
		);	
			
		// Maximize All Portlets (whole site, no differentiation)
		jQuery('a#all_max').click(function()
			{
				jQuery('div.itemContent:hidden').show();
				return false;
			}
		);

		// Minimize All Portlets (whole site, no differentiation)
		jQuery('a#all_min').click(function()
			{
				jQuery('div.itemContent:visible').hide();
				return false;
			}
		);
	   // Auto Minimize if more than 4 (whole site, no differentiation)
	   if(jQuery('a.min').length > 4)
	   {
	   		jQuery('a.min').html('[+]');
	   		jQuery('div.itemContent:visible').hide();
	   		jQuery('#selectContainer div.inUse').toggle();
	   };
	}
);

var toggleContent = function(e)
{
	var targetContent = jQuery('div.itemContent', this.parentNode.parentNode);
	if (targetContent.css('display') == 'none') {
		targetContent.slideDown(300);
		jQuery(this).html('[-]');
	} else {
//.........这里部分代码省略.........
开发者ID:pravinhirmukhe,项目名称:flow1,代码行数:101,代码来源:album.php

示例4: processor

 function processor()
 {
     global $wpdb;
     check_admin_referer('ngg_album');
     // Create album
     if (isset($_POST['add']) && isset($_POST['newalbum'])) {
         if (!nggGallery::current_user_can('NextGEN Add/Delete album')) {
             wp_die(__('Cheatin&#8217; uh?'));
         }
         $album = new stdClass();
         $album->name = $_POST['newalbum'];
         $result = $this->get_album_mapper()->save($album);
         $this->currentID = $album->{$album->id_field};
         if (!$this->currentID) {
             $this->currentID = 0;
         }
         //hook for other plugins
         do_action('ngg_add_album', $this->currentID);
         if ($result) {
             nggGallery::show_message(__('Update Successfully', 'nggallery'));
         }
     }
     if (isset($_POST['update']) && $this->currentID > 0) {
         $gid = array();
         // Get the current album being updated
         $album = $this->get_album_mapper()->find($this->currentID);
         // Get the list of galleries/sub-albums to be added to this album
         parse_str($_REQUEST['sortorder']);
         // Set the new sortorder
         $album->sortorder = $gid;
         // Ensure that a preview pic has been sent
         $this->_set_album_preview_pic($album);
         // Save the changes
         $this->get_album_mapper()->save($album);
         //hook for other plugins
         do_action('ngg_update_album_sortorder', $this->currentID);
         nggGallery::show_message(__('Update Successfully', 'nggallery'));
     }
     if (isset($_POST['delete'])) {
         if (!nggGallery::current_user_can('NextGEN Add/Delete album')) {
             wp_die(__('Cheatin&#8217; uh?'));
         }
         $result = nggdb::delete_album($this->currentID);
         //hook for other plugins
         do_action('ngg_delete_album', $this->currentID);
         // jump back to main selection
         $this->currentID = 0;
         if ($result) {
             nggGallery::show_message(__('Album deleted', 'nggallery'));
         }
     }
 }
开发者ID:hiaedenis,项目名称:nextgen-gallery,代码行数:52,代码来源:album.php


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