当前位置: 首页>>代码示例>>PHP>>正文


PHP Foundry::themes方法代码示例

本文整理汇总了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);
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:55,代码来源:easysocial.php


注:本文中的Foundry::themes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。