本文整理汇总了PHP中ContentHelperRoute类的典型用法代码示例。如果您正苦于以下问题:PHP ContentHelperRoute类的具体用法?PHP ContentHelperRoute怎么用?PHP ContentHelperRoute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ContentHelperRoute类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getRelatedAsHtml
/**
* @param $id
* @param $tags
* @return string
*/
public function getRelatedAsHtml($id, $catid, $access, $tags)
{
$count = CedTagsHelper::param('RelatedArticlesCountByTags', 10);
$relatedArticlesTitle = CedTagsHelper::param('RelatedArticlesTitleByTags', "Related Articles");
//$max=max(intval($relatedArticlesCount),array_count_values($termIds));
//find the unique article ids
$contentIds = $this->getUniqueArticleId($tags, $id);
$html = "";
if (is_array($contentIds) && sizeof($contentIds) > 0) {
$rows = $this->getModel($contentIds, $count);
if (empty($rows)) {
return '';
}
$user = JFactory::getUser();
$aid = JVERSION < 1.6 ? $user->get('aid', 0) : max($user->getAuthorisedViewLevels());
$html = '<div class="relateditemsbytags">' . $relatedArticlesTitle . '</div>
<div>
<ul class="relateditems">';
foreach ($rows as $row) {
if ($row->access <= $aid) {
$link = JVERSION < 1.6 ? JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid)) : JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug));
} else {
$link = JRoute::_('index.php?option=com_user&view=login');
}
$html .= '<li> <a href="' . $link . '">' . htmlspecialchars($row->title) . '</a></li>';
}
$html .= '</ul></div>';
}
return $html;
}
开发者ID:lautarodragan,项目名称:ideary,代码行数:35,代码来源:joomla.php
示例2: getActionForm
public function getActionForm($formAction, $formData, &$return)
{
switch ($formAction) {
case 1:
$return->actionForm = "url";
$return->actionFormData = $formData;
break;
case 2:
$this->_db->setQuery($this->_db->getQuery(true)->select('link')->from("#__menu")->where("id = " . (int) $formData));
$menuItem = $this->_db->loadObject();
$return->actionForm = "url";
$return->actionFormData = isset($menuItem->link) ? $menuItem->link : '';
break;
case 3:
require_once JPATH_SITE . '/components/com_content/helpers/route.php';
$this->_db->setQuery($this->_db->getQuery(true)->select('a.catid,CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug')->from("#__content AS a")->join("LEFT", "#__categories AS cc ON a.catid = cc.id")->where('a.id = ' . (int) $formData));
$article = $this->_db->loadObject();
$return->actionForm = "url";
$return->actionFormData = JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catid));
break;
case 4:
$return->actionForm = "message";
$return->actionFormData = $formData;
break;
}
}
开发者ID:densem-2013,项目名称:exikom,代码行数:26,代码来源:paymentgateway.php
示例3: getArticle
/**
* Funkce pro načtení dat 1 článku z databáze
*/
function getArticle($articleId, $text = 'all', $skipPlugins = false)
{
$db =& JFactory::getDBO();
$db->setQuery("SELECT * FROM #__content WHERE id='{$articleId}' LIMIT 1;");
$rows = $db->loadObjectList();
if (count($rows) == 1) {
$article = $rows[0]->introtext . $rows[0]->fulltext;
} else {
return false;
}
//připravíme text
if ($text == 'introtext') {
$rows[0]->text = $rows[0]->introtext;
} elseif ($text == 'fulltext') {
$rows[0]->text = $rows[0]->fulltext;
} else {
$rows[0]->text = $rows[0]->introtext . $rows[0]->fulltext;
}
if (!$skipPlugins) {
$dispatcher =& JDispatcher::getInstance();
JPluginHelper::importPlugin("content");
//naimportujeme všechny pluginy pro zpracování obsahu
$rows[0]->parameters = new JParameter($rows[0]->attribs);
//vytvoříme objekt s parametry článku
$results = $dispatcher->trigger('onPrepareContent', array(&$rows[0], &$rows[0]->parameters, 0));
//načtení pluginů
}
//doplnime uri na clanek
$rows[0]->uri = JRoute::_(JURI::root() . ContentHelperRoute::getArticleRoute($rows[0]->id), true, -1);
return $rows[0];
}
开发者ID:KIZI,项目名称:sewebar-cms,代码行数:34,代码来源:documents.php
示例4: getList
function getList(&$params)
{
global $mainframe;
$db =& JFactory::getDBO();
$user =& JFactory::getUser();
$userId = (int) $user->get('id');
$count = (int) $params->get('count', 5);
$catid = trim($params->get('catid'));
$secid = trim($params->get('secid'));
$show_front = $params->get('show_front', 1);
$aid = $user->get('aid', 0);
$contentConfig =& JComponentHelper::getParams('com_content');
$access = !$contentConfig->get('shownoauth');
$nullDate = $db->getNullDate();
jimport('joomla.utilities.date');
$date = new JDate();
$now = $date->toMySQL();
$where = 'a.state = 1' . ' AND ( a.publish_up = ' . $db->Quote($nullDate) . ' OR a.publish_up <= ' . $db->Quote($now) . ' )' . ' AND ( a.publish_down = ' . $db->Quote($nullDate) . ' OR a.publish_down >= ' . $db->Quote($now) . ' )';
// User Filter
switch ($params->get('user_id')) {
case 'by_me':
$where .= ' AND (created_by = ' . (int) $userId . ' OR modified_by = ' . (int) $userId . ')';
break;
case 'not_me':
$where .= ' AND (created_by <> ' . (int) $userId . ' AND modified_by <> ' . (int) $userId . ')';
break;
}
// Ordering
switch ($params->get('ordering')) {
case 'm_dsc':
$ordering = 'a.modified DESC, a.created DESC';
break;
case 'c_dsc':
default:
$ordering = 'a.created DESC';
break;
}
if ($catid) {
$ids = explode(',', $catid);
JArrayHelper::toInteger($ids);
$catCondition = ' AND (cc.id=' . implode(' OR cc.id=', $ids) . ')';
}
if ($secid) {
$ids = explode(',', $secid);
JArrayHelper::toInteger($ids);
$secCondition = ' AND (s.id=' . implode(' OR s.id=', $ids) . ')';
}
// Content Items only
$query = 'SELECT a.*, ' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,' . ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug' . ' FROM #__content AS a' . ($show_front == '0' ? ' LEFT JOIN #__content_frontpage AS f ON f.content_id = a.id' : '') . ' INNER JOIN #__categories AS cc ON cc.id = a.catid' . ' INNER JOIN #__sections AS s ON s.id = a.sectionid' . ' WHERE ' . $where . ' AND s.id > 0' . ($access ? ' AND a.access <= ' . (int) $aid . ' AND cc.access <= ' . (int) $aid . ' AND s.access <= ' . (int) $aid : '') . ($catid ? $catCondition : '') . ($secid ? $secCondition : '') . ($show_front == '0' ? ' AND f.content_id IS NULL ' : '') . ' AND s.published = 1' . ' AND cc.published = 1' . ' ORDER BY ' . $ordering;
$db->setQuery($query, 0, $count);
$rows = $db->loadObjectList();
$i = 0;
$lists = array();
foreach ($rows as $row) {
$lists[$i]->link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid));
$lists[$i]->text = htmlspecialchars($row->title);
$i++;
}
return $lists;
}
开发者ID:Fellah,项目名称:govnobaki,代码行数:60,代码来源:helper.php
示例5: getRelatedItemsJumpList
function getRelatedItemsJumpList()
{
$cids = func_get_args();
$groups = count($cids) > 1 ? true : false;
$list = '<select class="relatedtech" name="data[related][]" onchange="window.location=this.value;return false;">' . "\n";
$list .= '<option value="" selection="selected">Velg...</option>' . "\n";
foreach ($cids as $catID) {
if (!is_numeric($catID)) {
continue;
}
$db =& JFactory::getDBO();
$sql = "SELECT c.id, c.title, c.catid, c.sectionid, cat.title AS cat_title FROM #__content c " . "LEFT JOIN #__categories cat ON c.catid = cat.id " . "WHERE catid='{$catID}' AND c.state > 0 ORDER BY title";
$db->setQuery($sql);
$items = $db->loadObjectList();
if ($groups && count($items) > 1) {
$list .= '<optgroup label="' . $items[0]->cat_title . '">' . "\n";
}
require_once JPATH_SITE . DS . 'components' . DS . 'com_content' . DS . 'helpers' . DS . 'route.php';
foreach ($items as $item) {
$listinglink = ContentHelperRoute::getArticleRoute($item->id, $item->catid, $item->sectionid);
$list .= '<option value="' . $listinglink . '">' . $item->title . '</option>' . "\n";
}
if ($groups && count($items) > 1) {
$list .= '</optgroup>' . "\n";
}
}
$list .= '</select>' . "\n";
return $list;
}
开发者ID:bizanto,项目名称:Hooked,代码行数:29,代码来源:related_items.php
示例6: renderItem
function renderItem(&$item, &$params, &$access)
{
global $mainframe;
$user =& JFactory::getUser();
$item->text = $item->introtext;
$item->groups = '';
$item->readmore = trim($item->fulltext) != '';
$item->metadesc = '';
$item->metakey = '';
$item->access = '';
$item->created = '';
$item->modified = '';
if ($params->get('readmore') || $params->get('link_titles')) {
if ($params->get('intro_only')) {
// Check to see if the user has access to view the full article
if ($item->access <= $user->get('aid', 0)) {
$linkOn = ContentHelperRoute::getArticleRoute($item->slug, $item->catslug);
} else {
$linkOn = JRoute::_('index.php?option=com_user&task=register');
}
}
$item->linkOn = $linkOn;
}
$results = $mainframe->triggerEvent('onAfterDisplayTitle', array(&$item, &$params, 1));
$item->afterDisplayTitle = trim(implode("\n", $results));
$results = $mainframe->triggerEvent('onBeforeDisplayContent', array(&$item, &$params, 1));
$item->beforeDisplayContent = trim(implode("\n", $results));
require JModuleHelper::getLayoutPath('mod_yoo_drawer', '_item');
}
开发者ID:janssit,项目名称:www.kadulleke.be,代码行数:29,代码来源:helper.php
示例7: getContent
/**
* Generate content
* @param object The article object. Note $article->text is also available
* @param object The article params
* @param boolean Modules context
* @return string Returns html code or empty string.
*/
private function getContent(&$article, &$params, $moduleContext = false)
{
$doc = JFactory::getDocument();
/* @var $doc JDocumentHtml */
$doc->addStyleSheet(JURI::root() . "plugins/content/fastsocialshare/style/style.css");
$uriInstance = JURI::getInstance();
if (!$moduleContext) {
if (!class_exists('ContentHelperRoute')) {
include_once JPATH_SITE . '/components/com_content/helpers/route.php';
}
$url = JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catslug), false);
$root = rtrim($uriInstance->getScheme() . '://' . $uriInstance->getHost(), '/');
$url = $root . $url;
$title = htmlentities($article->title, ENT_QUOTES, "UTF-8");
} else {
$url = JURI::current();
$title = htmlentities($doc->title, ENT_QUOTES, "UTF-8");
}
$html = $this->getFacebookLike($this->params, $url, $title);
$html .= $this->getFacebookShareMe($this->params, $url, $title);
$html .= $this->getTwitter($this->params, $url, $title);
$html .= $this->getGooglePlusOne($this->params, $url, $title);
$html .= $this->getLinkedIn($this->params, $url, $title);
$html .= $this->getPinterest($this->params, $url, $title);
return '<div class="fastsocialshare_container">' . $html . '<div class="fastsocialshare_clearer"></div></div>';
}
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:33,代码来源:fastsocialshare.php
示例8: renderItem
function renderItem(&$item, &$params, &$access)
{
global $mainframe;
$user =& JFactory::getUser();
$item->text = $item->introtext;
$item->groups = '';
$item->readmore = trim($item->fulltext) != '';
$item->metadesc = '';
$item->metakey = '';
$item->created = '';
$item->modified = '';
if ($params->get('readmore') || $params->get('link_titles')) {
if ($params->get('intro_only')) {
// Check to see if the user has access to view the full article
if ($item->access <= $user->get('aid', 0)) {
$itemparams = new JParameter($item->attribs);
$readmoretxt = $itemparams->get('readmore', JText::_('Read more text'));
$item->linkOn = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid));
$item->linkText = $readmoretxt;
} else {
$item->linkOn = JRoute::_('index.php?option=com_user&view=login');
$item->linkText = JText::_('Login To Read More');
}
}
}
if (!$params->get('image')) {
$item->text = preg_replace('/<img[^>]*>/', '', $item->text);
}
$results = $mainframe->triggerEvent('onAfterDisplayTitle', array(&$item, &$params, 1));
$item->afterDisplayTitle = trim(implode("\n", $results));
$results = $mainframe->triggerEvent('onBeforeDisplayContent', array(&$item, &$params, 1));
$item->beforeDisplayContent = trim(implode("\n", $results));
require JModuleHelper::getLayoutPath('mod_newsflash', '_item');
}
开发者ID:RangerWalt,项目名称:ecci,代码行数:34,代码来源:helper.php
示例9: _getList
protected function _getList($params, $module){
$this->params = $params;
$list = array();
$source_category = $params->get('source');
$items = $this->getCategoryItems($source_category, $params);
if(!empty($items)) {
include_once JPATH_SITE . DS . 'components' . DS . 'com_content' . DS . 'helpers' . DS . 'route.php';
$custom = $this->_getCustomUrl($params);
foreach($items as $key => $item){
$category = $this->getCategory($item->catid);
$item->catitle = $category->title;
if(!$this->getItemImage($item)){
$item->image = 'modules/'.Ytools::getModule()->module . '/assets/images/nophoto.png';
}
if(array_key_exists($item->id, $custom)){
$item->link= trim($custom[$item->id]->url);
}else{
$item->link = JRoute::_(ContentHelperRoute::getArticleRoute($item->id, $item->catid));
}
$item->description = strip_tags($item->introtext);
}
}
return $items;
}
开发者ID:esyacelga,项目名称:sisadmaca,代码行数:26,代码来源:helper.php
示例10: getData
function getData($ids)
{
// prepare an array
$results = array();
// prepare an query part
$query_ids = implode(',', $ids);
// generate the query
$database = JFactory::getDBO();
// SQL query for slides
$query = '
SELECT
`c`.`id` AS `id`,
`c`.`catid` AS `cid`,
`c`.`title` AS `title`
FROM
#__content AS `c`
WHERE
`c`.`id` IN (' . $query_ids . ')
;';
// running query
$database->setQuery($query);
// if results exists
if ($datas = $database->loadObjectList()) {
// parsing data
foreach ($datas as $item) {
// array with prepared image
$results[$item->id] = array('id' => $item->id, 'cid' => $item->cid, 'title' => stripslashes($item->title), 'link' => JRoute::_(ContentHelperRoute::getArticleRoute($item->id, $item->cid)));
}
}
// return the results
return $results;
}
开发者ID:paisit,项目名称:pyzid,代码行数:32,代码来源:model.php
示例11: getBacklink
function getBacklink($id, $type, $category = true)
{
$db =& JFactory::getDBO();
if (!$category) {
$query = "SELECT articleid from #__fieldsattach_values WHERE (value LIKE '%," . $id . ",%' OR value LIKE '" . $id . ",%' OR value LIKE '%," . $id . "' OR value LIKE '" . $id . "') AND fieldsid = 23";
} else {
$query = "SELECT catid from #__fieldsattach_categories_values WHERE (value LIKE '%," . $id . ",%' OR value LIKE '" . $id . ",%' OR value LIKE '%," . $id . "' OR value LIKE '" . $id . "') AND fieldsid = 22";
}
$db->setQuery($query);
$result = $db->loadObjectList();
$function = '';
foreach ($result as $item) {
if (!$category) {
$parent = getParent(getCategory($item->articleid));
} else {
$parent = getParent($item->catid);
}
if ($parent == $type) {
if (!$category) {
$function .= '<li><a href="' . ContentHelperRoute::getArticleRoute($item->articleid, $parent) . '">' . getTitle($item->articleid, $category) . '</a></li>';
} else {
$function .= '<li><a href="' . ContentHelperRoute::getCategoryRoute($item->catid, $parent) . '">' . getTitle($item->catid, $category) . '</a></li>';
}
}
}
return $function;
}
开发者ID:AxelFG,项目名称:ckbran-inf,代码行数:27,代码来源:helper.php
示例12: display
function display($tpl = null)
{
global $mainframe;
// parameters
$db =& JFactory::getDBO();
$document =& JFactory::getDocument();
$params =& $mainframe->getParams();
$document->link = JRoute::_('index.php?option=com_content&view=frontpage');
// Get some data from the model
JRequest::setVar('limit', $mainframe->getCfg('feed_limit'));
$rows =& $this->get('Data');
foreach ($rows as $row) {
// strip html from feed item title
$title = $this->escape($row->title);
$title = html_entity_decode($title);
// url link to article
$link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid));
// strip html from feed item description text
$description = $params->get('feed_summary', 0) ? $row->introtext . $row->fulltext : $row->introtext;
$author = $row->created_by_alias ? $row->created_by_alias : $row->author;
// load individual item creator class
$item = new JFeedItem();
$item->title = $title;
$item->link = $link;
$item->description = $description;
$item->date = $row->created;
$item->category = 'frontpage';
// loads item info into rss array
$document->addItem($item);
}
}
开发者ID:hrishikesh-kumar,项目名称:NBSNIP,代码行数:31,代码来源:view.feed.php
示例13: email
/**
* Icon for email
*
* @param object $member Member info
* @param JRegistry $params HTML Params
* @param array $attribs Member attribs
*
* @return string
*
* @since 1.5
*/
public static function email($member, $params, $attribs = [])
{
require_once JPATH_SITE . '/components/com_mailto/helpers/mailto.php';
$uri = JUri::getInstance();
$base = $uri->toString(['scheme', 'host', 'port']);
$link = $base . JRoute::_(ContentHelperRoute::getArticleRoute($member->slug, $member->catid), false);
$url = 'index.php?option=com_mailto&tmpl=component&link=' . MailtoHelper::addLink($link);
$status = 'width=400,height=350,menubar=yes,resizable=yes';
if ($params->get('show_icons'))
{
$text = JHtml::_('image', 'system/emailButton.png', JText::_('JGLOBAL_EMAIL'), null, true);
}
else
{
$text = ' ' . JText::_('JGLOBAL_EMAIL');
}
$attribs['title'] = JText::_('JGLOBAL_EMAIL');
$attribs['onclick'] = "window.open(this.href,'win2','" . $status . "'); return false;";
$output = JHtml::_('link', JRoute::_($url), $text, $attribs);
return $output;
}
开发者ID:Joomla-Bible-Study,项目名称:joomla_churchdirectory,代码行数:37,代码来源:icon.php
示例14: onContentPrepare
/**
* onContentPrepare
*
* Replaces IMG H5P placeholder with an iFrame.
*/
public function onContentPrepare($context, &$article, &$params, $page = 0)
{
$matches = array();
if (preg_match_all($this->h5p_re, $article->text, $matches, PREG_SET_ORDER)) {
// We need to add a little script
$doc = JFactory::getDocument();
$doc->addScript(JURI::root(true) . '/libraries/h5pcore/core/js/jquery.js' . $this->fileSuffix);
$doc->addScript(JURI::root(true) . '/libraries/h5pcore/core/js/h5p.js' . $this->fileSuffix);
$doc->addScript(JURI::root(true) . '/libraries/h5pcore/js/h5piframeresize.js' . $this->fileSuffix);
$doc->addStyleSheet(JURI::root(true) . '/libraries/h5pcore/core/styles/h5p.css' . $this->fileSuffix);
$doc->addStyleSheet(JURI::root(true) . '/libraries/h5pcore/media/h5pdisplay.css' . $this->fileSuffix);
$html = '<div class="h5p-iframe-wrapper" id="iframe-wrapper-##h5pId##">';
$html .= '<iframe id="iframe-##h5pId##" class="h5p-iframe" src="##iframeSrc##" style="width: 100%; height: 400px; border: none;"></iframe>';
$html .= '</div>';
$article_url = JRoute::_(ContentHelperRoute::getArticleRoute($article->id, $article->catid, $article->itemid)) . "-{$article->alias}";
foreach ($matches as $key => $match) {
$h5pId = $match[1];
$h5pDomId = str_replace('.', '_', $h5pId);
// Periods make jQuery unhappy.
if ($context === 'com_content.article') {
$iframeSrc = 'index.php?option=com_h5p&view=h5p&layout=view&tmpl=component&cid=' . $h5pId;
$replacement = str_replace(array('##h5pId##', '##iframeSrc##'), array($h5pDomId, $iframeSrc), $html);
$article->text = preg_replace('/\\<img.*?h5p-placeholder-image.*?data-content-id\\=\\"' . $h5pId . '\\".*?\\>/', $replacement, $article->text, 1);
$this->registerStartTime($h5pId);
} elseif (isset($article->id)) {
$article->text = preg_replace('/\\<img.*?h5p-placeholder-image.*?data-content-id\\=\\"' . $h5pId . '\\".*?\\>/', '<a href="' . $article_url . '">$0</a>', $article->text, 1);
} else {
$article->text = preg_replace('/\\<img.*?h5p-placeholder-image.*?data-content-id\\=\\"' . $h5pId . '\\".*?\\>/', '', $article->text, 1);
}
}
}
}
开发者ID:h5p,项目名称:h5p-joomla-extension,代码行数:37,代码来源:h5p.php
示例15: _prepareItem
/**
*
* @param object $item
* @return object
*/
protected function _prepareItem($item)
{
$item->link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug));
$item->introtext = JHtml::_('string.truncate', $item->introtext, $this->_params->get('intro_length', 200));
$item->cat_link = JRoute::_(ContentHelperRoute::getCategoryRoute($item->catid));
return $item;
}
开发者ID:jooservices,项目名称:zt-news,代码行数:12,代码来源:content.php
示例16: go
public function go()
{
$url = JRequest::getVar('url');
$id = JRequest::getVar('id');
if ($url == 'category') {
$link = 'index.php?option=com_content&view=category&id=' . $id;
//find item id
$needles = array('category' => array($id));
if ($item = self::_findItem($needles)) {
$link .= '&Itemid=' . $item;
} elseif ($item = self::_findItem()) {
$link .= '&Itemid=' . $item;
}
$start = JRequest::getVar('start', null);
if ($start) {
$link .= '&start=' . $start;
}
} else {
//find category id via article id
$model = $this->getModel('Url', 'TTOL_HomeModel');
$article = $model->getArticle($id);
require_once JPATH_SITE . '/components/com_content/helpers/route.php';
$article->slug = $article->id . ':' . $article->alias;
$article->catslug = $article->catid ? $article->catid . ':' . $article->category_alias : $article->catid;
$link = ContentHelperRoute::getArticleRoute($article->slug, $article->catslug);
}
$this->setRedirect(JRoute::_($link));
return true;
}
开发者ID:ngxuanmui,项目名称:thongtinonline.net,代码行数:29,代码来源:url.php
示例17: format
private function format(&$articles, $params)
{
if (!$articles) {
return;
}
foreach ($articles as $article) {
$category = JTable::getInstance('Category');
$category->load($article->catid);
$article->category = $category;
$article->permalink = ContentHelperRoute::getArticleRoute($article->id . ':' . $article->alias, $article->catid);
$article->permalink = JRoute::_($article->permalink);
$article->category->permalink = ContentHelperRoute::getCategoryRoute($category->id . ':' . $category->alias);
$article->category->permalink = JRoute::_($article->category->permalink);
$article->content = empty($article->introtext) ? $article->fulltext : $article->introtext;
$titleLength = $params->get('title_length');
$contentLength = $params->get('content_length');
if ($titleLength) {
$article->title = JString::substr($article->title, 0, $titleLength);
}
// Try to get image of the article
$image = $this->processContentImage($article->content);
if ($image) {
$article->image = $image;
}
if ($contentLength) {
$article->content = JString::substr(strip_tags($article->content), 0, $contentLength) . ' ...';
} else {
$base = JURI::base(true) . '/';
$protocols = '[a-zA-Z0-9]+:';
//To check for all unknown protocals (a protocol must contain at least one alpahnumeric fillowed by :
$regex = '#(src|href|poster)="(?!/|' . $protocols . '|\\#|\')([^"]*)"#m';
$article->content = preg_replace($regex, "\$1=\"{$base}\$2\"", $article->content);
}
}
}
开发者ID:knigherrant,项目名称:decopatio,代码行数:35,代码来源:view.html.php
示例18: display
function display()
{
$app = JFactory::getApplication();
$doc =& JFactory::getDocument();
$params =& $app->getParams();
// Get some data from the model
JRequest::setVar('limit', $app->getCfg('feed_limit'));
$category =& $this->get('Category');
$rows =& $this->get('Data');
$doc->link = JRoute::_(ContentHelperRoute::getCategoryRoute($category->id, $cagtegory->sectionid));
foreach ($rows as $row) {
// strip html from feed item title
$title = $this->escape($row->title);
$title = html_entity_decode($title);
// url link to article
// & used instead of & as this is converted by feed creator
$link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid));
// strip html from feed item description text
// TODO: Only pull fulltext if necessary (actually, just get the necessary fields).
$description = $params->get('feed_summary', 0) ? $row->introtext : $row->introtext;
$author = $row->created_by_alias ? $row->created_by_alias : $row->author;
@($date = $row->created ? date('r', strtotime($row->created)) : '');
// load individual item creator class
$item = new JFeedItem();
$item->title = $title;
$item->link = $link;
$item->description = $description;
$item->date = $date;
$item->category = $row->category;
// loads item info into rss array
$doc->addItem($item);
}
}
开发者ID:joebushi,项目名称:joomla,代码行数:33,代码来源:view.feed.php
示例19: getList
function getList()
{
///var_dump ($this->id);
global $mainframe;
JPluginHelper::importPlugin('content');
$dispatcher =& JDispatcher::getInstance();
$params =& JComponentHelper::getParams('com_content');
$limitstart = $this->limit;
$rows = $this->getDataFromCate();
if (count($rows) > 0) {
for ($i = 0; $i < count($rows); $i++) {
$rows[$i]['text'] = $rows[$i]['introtext'];
$results = $dispatcher->trigger('onPrepareContent', array(&$rows[$i], &$params, $limitstart));
$items[$i]['introtext'] = $rows[$i]['text'];
$items[$i]['id'] = $rows[$i]['id'];
$items[$i]['img'] = $this->getImage($rows[$i]['text']);
$items[$i]['title'] = $rows[$i]['title'];
$items[$i]['content'] = $this->removeImage($rows[$i]['text']);
$link = JRoute::_(ContentHelperRoute::getArticleRoute($rows[$i]['slug'], $rows[$i]['catslug'], $rows[$i]['sectionid']));
$items[$i]['link'] = $link;
}
}
$items = $this->update($items);
/* Process Images*/
return $items;
}
开发者ID:naquib555,项目名称:quBitolgy,代码行数:26,代码来源:contentslider.php
示例20: display
function display()
{
global $mainframe;
// parameters
$app = JFactory::getApplication();
$db = JFactory::getDbo();
$document = JFactory::getDocument();
$params = $app->getParams();
$feedEmail = @$app->getCfg('feed_email') ? $app->getCfg('feed_email') : 'author';
$siteEmail = $app->getCfg('mailfrom');
// Get some data from the model
JRequest::setVar('limit', $app->getCfg('feed_limit'));
$article =& $this->get('Article');
$rows =& $this->get('Data');
$document->link = JRoute::_(ContentHelperRoute::getArticleRoute($article->id, $article->catid));
foreach ($rows as $row) {
// strip html from feed item title
$title = $this->escape($row->title);
$title = html_entity_decode($title, ENT_COMPAT, 'UTF-8');
// url link to article
// & used instead of & as this is converted by feed creator
$link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid));
// strip html from feed item description text
$description = $params->get('feed_summary', 0) ? $row->introtext . $row->fulltext : $row->introtext;
$author = $row->created_by_alias ? $row->created_by_alias : $row->author;
// load individual item creator class
$item = new JFeedItem();
$item->title = $title;
$item->link = $link;
$item->description = $description;
$item->date = $row->created;
// loads item info into rss array
$document->addItem($item);
}
}
开发者ID:xenten,项目名称:swift-kanban,代码行数:35,代码来源:view.feed.php
注:本文中的ContentHelperRoute类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论