當前位置: 首頁>>代碼示例>>PHP>>正文


PHP nggdb::update_album方法代碼示例

本文整理匯總了PHP中nggdb::update_album方法的典型用法代碼示例。如果您正苦於以下問題:PHP nggdb::update_album方法的具體用法?PHP nggdb::update_album怎麽用?PHP nggdb::update_album使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在nggdb的用法示例。


在下文中一共展示了nggdb::update_album方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: delete_gallery

 /**
  * Delete a gallery AND all the pictures associated to this gallery!
  *
  * @id The gallery ID
  */
 static function delete_gallery($id)
 {
     global $wpdb, $nggdb;
     $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->nggpictures} WHERE galleryid = %d", $id));
     $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->nggallery} WHERE gid = %d", $id));
     wp_cache_delete($id, 'ngg_gallery');
     //TODO:Remove all tag relationship
     //Update the galleries to remove the deleted ID's
     $albums = $nggdb->find_all_album();
     foreach ($albums as $album) {
         $albumid = $album->id;
         $galleries = $album->galleries;
         $deleted = array_search($id, $galleries);
         unset($galleries[$deleted]);
         $new_galleries = serialize($galleries);
         nggdb::update_album($albumid, false, false, false, $new_galleries);
     }
     return true;
 }
開發者ID:valerol,項目名稱:korpus,代碼行數:24,代碼來源:ngg-db.php

示例2: editAlbum

 /**
  * Method "ngg.editAlbum"
  * Edit a existing Album
  * 
  * @since 1.7.0
  * 
  * @param array $args Method parameters.
  * 			- int blog_id
  *	    	- string username
  *	    	- string password
  *	    	- int album ID
  *	    	- string album name
  *          - int id of preview image
  *          - string description
  *          - string serialized array of galleries 
  * @return true if success
  */
 function editAlbum($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];
     $preview = (int) $args[5];
     $description = $args[6];
     $galleries = $args[7];
     if (!($user = $this->login($username, $password))) {
         return $this->error;
     }
     if (!($album = nggdb::find_album($id))) {
         return new IXR_Error(404, __("Invalid album ID"));
     }
     if (!current_user_can('NextGEN Edit album')) {
         return new IXR_Error(401, __('Sorry, you must be able to manage albums'));
     }
     if (!empty($name)) {
         $result = nggdb::update_album($id, $name, $preview, $description, $description, $galleries);
     }
     if (!$result) {
         return new IXR_Error(500, __('Sorry, could not update the album'));
     }
     return true;
 }
開發者ID:rtgibbons,項目名稱:bya.org,代碼行數:48,代碼來源:xmlrpc.php


注:本文中的nggdb::update_album方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。