本文整理匯總了PHP中nggdb::update_gallery方法的典型用法代碼示例。如果您正苦於以下問題:PHP nggdb::update_gallery方法的具體用法?PHP nggdb::update_gallery怎麽用?PHP nggdb::update_gallery使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類nggdb
的用法示例。
在下文中一共展示了nggdb::update_gallery方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: editGallery
/**
* Method "ngg.editGallery"
* Edit a existing gallery
*
* @since 1.7.0
*
* @param array $args Method parameters.
* - int blog_id
* - string username
* - string password
* - int gallery ID
* - string gallery name
* - string title
* - string description
* - int ID of the preview picture
* @return true if success
*/
function editGallery($args)
{
global $ngg;
require_once dirname(dirname(__FILE__)) . '/admin/functions.php';
// admin functions
$this->escape($args);
$blog_ID = (int) $args[0];
$username = $args[1];
$password = $args[2];
$id = (int) $args[3];
$name = $args[4];
$title = $args[5];
$description = $args[6];
$previewpic = (int) $args[7];
if (!($user = $this->login($username, $password))) {
return $this->error;
}
if (!($gallery = nggdb::find_gallery($id))) {
return new IXR_Error(404, __("Invalid gallery ID"));
}
if (!current_user_can('NextGEN Manage gallery') && !nggAdmin::can_manage_this_gallery($gallery->author)) {
return new IXR_Error(401, __('Sorry, you must be able to manage this gallery'));
}
if (!empty($name)) {
$result = nggdb::update_gallery($id, $name, false, $title, $description, false, $previewpic);
}
if (!$result) {
return new IXR_Error(500, __('Sorry, could not update the gallery'));
}
return true;
}