当前位置: 首页>>代码示例>>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;未经允许,请勿转载。