本文整理匯總了PHP中FrontendModel::getThumbnailFolders方法的典型用法代碼示例。如果您正苦於以下問題:PHP FrontendModel::getThumbnailFolders方法的具體用法?PHP FrontendModel::getThumbnailFolders怎麽用?PHP FrontendModel::getThumbnailFolders使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FrontendModel
的用法示例。
在下文中一共展示了FrontendModel::getThumbnailFolders方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getForTags
/**
* Fetch the list of tags for a list of items
*
* @param array $ids The ids of the items to grab.
* @return array
*/
public static function getForTags(array $ids)
{
// fetch items
$items = (array) FrontendModel::getDB()->getRecords('SELECT i.title, m.url
FROM blog_posts AS i
INNER JOIN meta AS m ON m.id = i.meta_id
WHERE i.status = ? AND i.hidden = ? AND i.id IN (' . implode(',', $ids) . ')
ORDER BY i.publish_on DESC', array('active', 'N'));
// has items
if (!empty($items)) {
// init var
$link = FrontendNavigation::getURLForBlock('blog', 'detail');
$folders = FrontendModel::getThumbnailFolders(FRONTEND_FILES_PATH . '/blog/images', true);
// reset url
foreach ($items as &$row) {
$row['full_url'] = $link . '/' . $row['url'] . '?gn=' . str_pad($row['id'], 3, '0', STR_PAD_LEFT);
// image?
if (isset($row['image'])) {
foreach ($folders as $folder) {
$row['image_' . $folder['dirname']] = $folder['url'] . '/' . $folder['dirname'] . '/' . $row['image'];
}
}
}
}
// return
return $items;
}