本文整理汇总了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';
}