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


PHP nggdb::search_for_images方法代碼示例

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


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

示例1: start_process

 function start_process()
 {
     global $ngg;
     if (!$this->valid_access()) {
         return;
     }
     switch ($this->method) {
         case 'search':
             //search for some images
             $this->result['images'] = array_merge((array) nggdb::search_for_images($this->term), (array) nggTags::find_images_for_tags($this->term, 'ASC'));
             break;
         case 'album':
             //search for some album  //TODO : Get images for each gallery, could end in a big db query
             $this->result['album'] = nggdb::find_album($this->id);
             break;
         case 'gallery':
             //search for some gallery
             $this->result['images'] = $this->id == 0 ? nggdb::find_last_images(0, 100) : nggdb::get_gallery($this->id, $ngg->options['galSort'], $ngg->options['galSortDir'], true, 0, 0, true);
             break;
         case 'image':
             //search for some image
             $this->result['images'] = nggdb::find_image($this->id);
             break;
         case 'tag':
             //search for images based on tags
             $this->result['images'] = nggTags::find_images_for_tags($this->term, 'ASC');
             break;
         case 'recent':
             //search for images based on tags
             $this->result['images'] = nggdb::find_last_images(0, $this->limit);
             break;
         case 'autocomplete':
             //return images, galleries or albums for autocomplete drop down list
             return $this->autocomplete();
             break;
         case 'version':
             $this->result = array('stat' => 'ok', 'version' => $ngg->version);
             return;
             break;
         default:
             $this->result = array('stat' => 'fail', 'code' => '98', 'message' => 'Method not known.');
             return false;
             break;
     }
     // result should be fine
     $this->result['stat'] = 'ok';
 }
開發者ID:BGCX261,項目名稱:zhibeifw-in-tibetan-svn-to-git,代碼行數:47,代碼來源:json.php


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