本文整理匯總了PHP中Foundry::themes方法的典型用法代碼示例。如果您正苦於以下問題:PHP Foundry::themes方法的具體用法?PHP Foundry::themes怎麽用?PHP Foundry::themes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Foundry
的用法示例。
在下文中一共展示了Foundry::themes方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: prepareNewBlogStream
/**
* Displays the stream item for new blog post
*
* @since 1.0
* @access public
* @param string
* @return
*/
public function prepareNewBlogStream(SocialStreamItem &$item, $appParams)
{
// Load the post
$post = EB::post($item->contextId);
// Format the likes for the stream
$likes = Foundry::likes();
$likes->get($item->contextId, 'blog', 'create');
$item->likes = $likes;
// Apply comments on the stream
$url = $post->getExternalPermalink();
$item->comments = Foundry::comments($item->contextId, 'blog', 'create', SOCIAL_APPS_GROUP_USER, array('url' => $url));
// We might want to use some javascript codes.
EB::init('site');
// Get the creation date
$date = $post->getCreationDate();
$config = EB::config();
$source = $config->get('integrations_easysocial_stream_newpost_source', 'intro');
$content = isset($post->{$source}) && !empty($post->{$source}) ? $post->{$source} : $post->intro;
$content = $this->truncateContent($content, $appParams);
// See if there's any audio files to process.
$audios = EB::audio()->getItems($content);
// Get videos attached in the content
$video = $this->getVideo($content);
// Remove videos from the source
$content = EB::videos()->strip($content);
// Remove audios from the content
$content = EB::audio()->strip($content);
// Get the permalink of the primary category
$catUrl = EBR::_('index.php?option=com_easyblog&view=categories&layout=listings&id=' . $post->category_id, true, null, false, true);
// Get the alignment of the image
$alignment = 'pull-' . $appParams->get('imagealignment', 'right');
$theme = Foundry::themes();
$theme->set('alignment', $alignment);
$theme->set('video', $video);
$theme->set('audios', $audios);
$theme->set('date', $date);
$theme->set('permalink', $url);
$theme->set('blog', $post);
$theme->set('actor', $item->actor);
$theme->set('content', $content);
$theme->set('categorypermalink', $catUrl);
$item->title = $theme->output('easysocial/streams/' . $item->verb . '.title');
$item->content = $theme->output('easysocial/streams/' . $item->verb . '.content');
// Add opengraph tags for the stream item
$item->opengraph->addImage($post->getImage('thumbnail'));
$item->opengraph->addDescription($content);
}