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


PHP BxDolCategories::explodeTags方法代码示例

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


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

示例1: getPostOverviewBlock

 function getPostOverviewBlock()
 {
     $iMemberID = (int) $this->aViewingPostInfo['OwnerID'];
     $aBlogInfo = $this->_oDb->getBlogInfo($iMemberID);
     $sBlogDescription = '<div class="blog_desc bx-def-margin-sec-top">' . process_html_output($aBlogInfo['Description']) . '</div>';
     $aAuthor = getProfileInfo($iMemberID);
     $aVars = array('author_unit' => get_member_thumbnail($aAuthor['ID'], 'none', true), 'fields' => $sBlogDescription);
     if ($this->iPostViewType == 3 && $this->iViewingPostID > 0) {
         require_once $this->_oConfig->getClassPath() . 'BxBlogsSearchUnit.php';
         $oBlogSearch = new BxBlogsSearchUnit();
         bx_import('BxDolCategories');
         bx_import('BxDolTags');
         $oCategories = new BxDolCategories();
         $oTags = new BxDolTags();
         $sCats = '';
         $aCategories = $oCategories->explodeTags($this->aViewingPostInfo['Categories']);
         $aCatLinks = array();
         if (count($aCategories) > 0) {
             foreach ($aCategories as $iKey => $sCatValue) {
                 $sCatLink = $oBlogSearch->getCurrentUrl('category', title2uri(trim($sCatValue)), title2uri(trim($sCatValue)), array('ownerId' => $iMemberID, 'blogOwnerName' => $aAuthor['NickName']));
                 $aCatLinks[] = '<a href="' . $sCatLink . '" rel="nofollow">' . $sCatValue . '</a>';
             }
             $sCats = implode(", ", $aCatLinks);
         }
         $sTags = '';
         $aTags = $oTags->explodeTags($this->aViewingPostInfo['Tags']);
         $aTagLinks = array();
         if (count($aTags) > 0) {
             foreach ($aTags as $sTagKey) {
                 if ($sTagKey != '') {
                     $sTagLink = $oBlogSearch->getCurrentUrl('tag', $iPostID, title2uri(trim($sTagKey)));
                     $aTagLinks[] = '<a href="' . $sTagLink . '" title="' . $sTagKey . '" rel="nofollow">' . $sTagKey . '</a>';
                 }
             }
             $sTags = implode(", ", $aTagLinks);
         }
         $aVars['date'] = getLocaleDate($this->aViewingPostInfo['PostDate'], BX_DOL_LOCALE_DATE_SHORT);
         $aVars['date_ago'] = defineTimeInterval($this->aViewingPostInfo['PostDate'], false);
         $aVars['cats'] = $sCats;
         $aVars['tags'] = $sTags;
         $aVars['fields'] = '';
         return $this->_oTemplate->parseHtmlByName('entry_view_block_info.html', $aVars);
     }
     return $this->_oTemplate->parseHtmlByName('entry_view_empty_block_info.html', $aVars);
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:45,代码来源:BxBlogsModule.php

示例2: displayList

 function displayList($aParams)
 {
     $sSampleType = $aParams['sample_type'];
     $iViewerType = $aParams['viewer_type'];
     $iStart = isset($aParams['start']) ? (int) $aParams['start'] : -1;
     $iPerPage = isset($aParams['count']) ? (int) $aParams['count'] : -1;
     $bShowEmpty = isset($aParams['show_empty']) ? $aParams['show_empty'] : true;
     $bAdminPanel = $iViewerType == BX_TD_VIEWER_TYPE_ADMIN && (isset($aParams['admin_panel']) && $aParams['admin_panel'] || $sSampleType == 'admin');
     $sModuleUri = $this->_oConfig->getUri();
     $aEntries = $this->_oDb->getEntries($aParams);
     if (empty($aEntries)) {
         return $bShowEmpty ? MsgBox(_t('_' . $sModuleUri . '_msg_no_results')) : "";
     }
     $oTags = new BxDolTags();
     $oCategories = new BxDolCategories();
     //--- Language translations ---//
     $sLKLinkPublish = _t('_' . $sModuleUri . '_lcaption_publish');
     $sLKLinkEdit = _t('_' . $sModuleUri . '_lcaption_edit');
     $sLKLinkDelete = _t('_' . $sModuleUri . '_lcaption_delete');
     $sBaseUri = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri();
     $sJsMainObject = $this->_oConfig->getJsObject();
     $aResult['sample'] = $sSampleType;
     $aResult['bx_repeat:entries'] = array();
     foreach ($aEntries as $aEntry) {
         $sVotes = "";
         if ($this->_oConfig->isVotesEnabled()) {
             $oVotes = $this->_oModule->_createObjectVoting($aEntry['id']);
             $sVotes = $oVotes->getJustVotingElement(0, $aEntry['id']);
         }
         $aTags = $oTags->explodeTags($aEntry['tags']);
         $aCategories = $oCategories->explodeTags($aEntry['categories']);
         $aTagItems = array();
         foreach ($aTags as $sTag) {
             $sTag = trim($sTag);
             $aTagItems[] = array('href' => $sBaseUri . 'tag/' . title2uri($sTag), 'title' => $sTag);
         }
         $aCategoryItems = array();
         foreach ($aCategories as $sCategory) {
             $sCategory = trim($sCategory);
             $aCategoryItems[] = array('href' => $sBaseUri . 'category/' . title2uri($sCategory), 'title' => $sCategory);
         }
         $aResult['bx_repeat:entries'][] = array('id' => $this->_oConfig->getSystemPrefix() . $aEntry['id'], 'caption' => str_replace("\$", "&#36;", $aEntry['caption']), 'class' => !in_array($sSampleType, array('view')) ? ' ' . $this->sCssPrefix . '-text-snippet' : '', 'date' => getLocaleDate($aEntry['when_uts'], BX_DOL_LOCALE_DATE), 'comments' => (int) $aEntry['cmts_count'], 'bx_repeat:categories' => $aCategoryItems, 'bx_repeat:tags' => $aTagItems, 'content' => str_replace("\$", "&#36;", $aEntry['content']), 'link' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aEntry['uri'], 'voting' => $sVotes, 'bx_if:checkbox' => array('condition' => $bAdminPanel, 'content' => array('id' => $aEntry['id'])), 'bx_if:status' => array('condition' => $iViewerType == BX_TD_VIEWER_TYPE_ADMIN, 'content' => array('status' => _t('_' . $sModuleUri . '_status_' . $aEntry['status']))), 'bx_if:featured' => array('condition' => $iViewerType == BX_TD_VIEWER_TYPE_ADMIN && (int) $aEntry['featured'] == 1, 'content' => array()), 'bx_if:edit_link' => array('condition' => $iViewerType == BX_TD_VIEWER_TYPE_ADMIN, 'content' => array('edit_link_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'admin/' . $aEntry['uri'], 'edit_link_caption' => $sLKLinkEdit)));
     }
     $aResult['paginate'] = '';
     if (!in_array($sSampleType, array('id', 'uri', 'view', 'search_unit'))) {
         if (!empty($sSampleType)) {
             $this->_updatePaginate($aParams);
         }
         $aResult['paginate'] = $this->oPaginate->getPaginate($iStart, $iPerPage);
     }
     $aResult['loading'] = LoadingBox($sModuleUri . '-' . $sSampleType . '-loading');
     $sRes = $this->parseHtmlByName('list.html', $aResult);
     return $sRes;
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:54,代码来源:BxDolTextTemplate.php


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