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