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


PHP EB::gallery方法代码示例

本文整理汇总了PHP中EB::gallery方法的典型用法代码示例。如果您正苦于以下问题:PHP EB::gallery方法的具体用法?PHP EB::gallery怎么用?PHP EB::gallery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EB的用法示例。


在下文中一共展示了EB::gallery方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display

 /**
  * Default search view for EasyBlog
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public function display($tmpl = null)
 {
     // Set the meta tags for search
     EB::setMeta(META_ID_SEARCH, META_TYPE_SEARCH);
     // Set the page title
     $title = EasyBlogHelper::getPageTitle(JText::_('COM_EASYBLOG_SEARCH_PAGE_TITLE'));
     $this->setPageTitle($title);
     // Set the view's breadcrumbs
     $this->setViewBreadcrumb('search');
     // Get any existing query
     $query = $this->input->get('query', '', 'default');
     $Itemid = $this->input->get('Itemid', '', 'int');
     $posts = array();
     $pagination = '';
     if (!empty($query)) {
         // Get the model
         $model = EB::model('Search');
         $result = $model->getData();
         $total = count($result);
         if ($total > 0) {
             $searchworda = preg_replace('#\\xE3\\x80\\x80#s', ' ', $query);
             $searchwords = preg_split("/\\s+/u", $searchworda);
             $needle = $searchwords[0];
             $searchwords = array_unique($searchwords);
             // var_dump($result[0]);
             // Format the post
             $posts = EB::formatter('list', $result);
             // var_dump($posts[0]);
             // exit;
             // Remove all unecessary codes from the output
             foreach ($posts as &$row) {
                 // var_dump($row->content);
                 // Strip videos
                 $row->intro = EB::videos()->strip($row->intro);
                 $row->content = EB::videos()->strip($row->content);
                 // strip gallery
                 $row->intro = EB::gallery()->strip($row->intro);
                 $row->content = EB::gallery()->strip($row->content);
                 // strip jomsocial album
                 $row->intro = EB::album()->strip($row->intro);
                 $row->content = EB::album()->strip($row->content);
                 // strip audio
                 $row->intro = EB::audio()->strip($row->intro);
                 $row->content = EB::audio()->strip($row->content);
                 // Format the content so that we can apply our search highlighting
                 $content = preg_replace('/\\s+/', ' ', strip_tags($row->content));
                 if (empty($content)) {
                     $content = preg_replace('/\\s+/', ' ', strip_tags($row->intro));
                 }
                 // We only want a snippet of the content
                 $content = JString::substr(strip_tags($content), 0, 350);
                 $pattern = '#(';
                 $x = 0;
                 foreach ($searchwords as $key => $value) {
                     $pattern .= $x == 0 ? '' : '|';
                     $pattern .= preg_quote($value, '#');
                     $x++;
                 }
                 $pattern .= ')#iu';
                 $row->title = preg_replace($pattern, '<span class="search-highlight">\\0</span>', $row->title);
                 $row->content = preg_replace($pattern, '<span class="search-highlight">\\0</span>', $content);
             }
         }
         $pagination = $model->getPagination();
     }
     $this->set('query', $query);
     $this->set('posts', $posts);
     $this->set('pagination', $pagination);
     $this->set('Itemid', $Itemid);
     parent::display('search/default');
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:79,代码来源:view.html.php

示例2: getContentWithoutIntro

 /**
  * Prepares the content without intro text.
  *
  * @since	4.0
  * @access	public
  * @return
  */
 public function getContentWithoutIntro($type = 'entry', $triggerPlugin = true)
 {
     $index = 'non-intro-' . $type;
     // echo $this->content;exit;
     // The reason we need to cache the content is to avoid javascripts from the blocks being collected multiple times.
     // Until we solve the issue with the javascript in the block handlers being collected more than once, we need to cache this contents.
     if (isset($this->formattedContents[$index]) && $this->formattedContents[$index]) {
         return $this->formattedContents[$index];
     }
     // If this is a listing type, the contents might need to be truncated
     if ($this->doctype == 'ebd') {
         $document = EB::document($this->document);
         $contents = $document->getContentWithoutIntro();
         // we need this so that content plugins can do their jobs.
         $this->intro = '';
         $this->content = $contents;
     } else {
         // Process videos in the intro
         $this->intro = EB::videos()->processVideos($this->intro);
         $this->content = EB::videos()->processVideos($this->content);
         // Process audio files.
         $this->intro = EB::audio()->process($this->intro);
         $this->content = EB::audio()->process($this->content);
         // Process any adsense codes
         $this->intro = EB::adsense()->process($this->intro, $this->created_by);
         $this->content = EB::adsense()->process($this->content, $this->created_by);
         // Process gallery codes in the content
         $this->intro = EB::gallery()->process($this->intro, $this->created_by);
         $this->content = EB::gallery()->process($this->content, $this->created_by);
         // Process album codes in the content
         $this->intro = EB::album()->process($this->intro, $this->created_by);
         $this->content = EB::album()->process($this->content, $this->created_by);
         $textLen = strip_tags($this->content);
         $textLen = str_replace(array(' ', '&nbsp;', "\n", "\t", "\r", "\r\n"), '', $textLen);
         if (empty($textLen)) {
             $this->content = $this->intro;
         } else {
             $this->intro = '';
         }
     }
     // Trigger plugins to prepare the content.
     if ($triggerPlugin) {
         $this->prepareContent();
     }
     // lets get the contents after content plugins processed the content.
     $contents = $this->content;
     // Cache the item so the document will not be rendered more than once.
     $this->formattedContents[$index] = $contents;
     return $this->formattedContents[$index];
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:57,代码来源:post.php

示例3: stripCodes

 /**
  * Remove known dirty codes from the content
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public function stripCodes(EasyBlogTableBlog &$blog)
 {
     // Remove video codes
     EB::videos()->stripCodes($blog);
     // Remove audio codes
     EB::audio()->stripCodes($blog);
     // Remove gallery codes
     EB::gallery()->stripCodes($blog);
     // Remove album codes
     EB::album()->stripCodes($blog);
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:19,代码来源:standard.php

示例4: stripCodes

 /**
  * Remove known dirty codes from the content
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public function stripCodes(EasyBlogPost &$post)
 {
     // Remove video codes
     EB::videos()->stripCodes($post);
     // Remove audio codes
     EB::audio()->stripCodes($post);
     // Remove gallery codes
     EB::gallery()->stripCodes($post);
     // Remove album codes
     EB::album()->stripCodes($post);
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:19,代码来源:truncater.php


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