本文整理汇总了PHP中nggGallery::get_thumbnail_url方法的典型用法代码示例。如果您正苦于以下问题:PHP nggGallery::get_thumbnail_url方法的具体用法?PHP nggGallery::get_thumbnail_url怎么用?PHP nggGallery::get_thumbnail_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nggGallery
的用法示例。
在下文中一共展示了nggGallery::get_thumbnail_url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getData
function getData($number)
{
global $wpdb;
$data = array();
$pictures = $wpdb->get_results("SELECT a.*, b.path FROM " . $wpdb->base_prefix . "ngg_pictures AS a LEFT JOIN " . $wpdb->base_prefix . "ngg_gallery AS b ON a.galleryid = b.gid WHERE a.galleryid = '" . intval($this->_data->get('nggsourcegallery', 0)) . "'");
$i = 0;
if (class_exists('nggGallery') && !class_exists('C_Component_Registry')) {
// legacy
foreach ($pictures as $p) {
$data[$i]['alt_text'] = $p->alttext;
$data[$i]['image'] = nggGallery::get_image_url($p->pid, $p->path, $p->filename);
$data[$i]['thumbnail'] = nggGallery::get_thumbnail_url($p->pid, $p->path, $p->filename);
$i++;
}
} else {
$storage = C_Component_Registry::get_instance()->get_utility('I_Gallery_Storage');
foreach ($pictures as $p) {
$data[$i]['alt_text'] = $p->alttext;
$data[$i]['image'] = $storage->get_image_url($p);
$data[$i]['thumbnail'] = $storage->get_thumbnail_url($p);
$i++;
}
}
return $data;
}
示例2: nextgengallery_showfirstpic
function nextgengallery_showfirstpic($galleryid, $class = '')
{
global $wpdb;
global $ngg_options;
if (!$galleryid) {
return;
}
if (!$wpdb->nggallery) {
return;
}
if (!$ngg_options) {
$ngg_options = get_option('ngg_options');
}
$picturelist = $wpdb->get_results("SELECT t.*, tt.* FROM {$wpdb->nggallery} AS t INNER JOIN {$wpdb->nggpictures} AS tt ON t.gid = tt.galleryid WHERE t.gid = '{$galleryid}' AND tt.exclude != 1 ORDER BY tt.{$ngg_options['galSort']} {$ngg_options['galSortDir']} LIMIT 1");
if ($class) {
$myclass = ' class="' . $class . '" ';
}
if ($picturelist) {
$pid = $picturelist[0]->pid;
if (is_callable(array('nggGallery', 'get_thumbnail_url'))) {
// new NextGen 1.0+
$out = '<img alt="' . __('property photo') . '" src="' . nggGallery::get_thumbnail_url($pid) . '" ' . $myclass . ' />';
} else {
// backwards compatibility - NextGen below 1.0
$out = '<img alt="' . __('property photo') . '" src="' . nggallery::get_thumbnail_url($pid) . '" ' . $myclass . ' />';
}
return $out;
}
}