本文整理汇总了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'));
}
}
}
示例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'));
}
}
}
示例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 {
//.........这里部分代码省略.........
示例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’ 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’ 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'));
}
}
}