示例#1
0
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;
}
示例#2
0
 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);
         }
     }
 }
示例#3
0
 function display()
 {
     global $mainframe;
     $doc =& JFactory::getDocument();
     $params =& $mainframe->getParams();
     // Get some data from the model
     JRequest::setVar('limit', $mainframe->getCfg('feed_limit'));
     $category =& $this->get('Category');
     $rows =& $this->get('Data');
     $doc->link = JRoute::_(ContentHelperRoute::getCategoryRoute($category->id, $category->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 &amp; as this is converted by feed creator
         $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 = $row->category;
         // loads item info into rss array
         $doc->addItem($item);
     }
 }
示例#4
0
 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 &amp; 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);
     }
 }
示例#5
0
 /**
  * 
  * @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;
 }
示例#6
0
 function __construct($component, $componentParams, $article, $articleParams)
 {
     parent::__construct($component, $componentParams, $article, $articleParams);
     $this->category = $this->_articleParams->get('show_category') ? $this->_article->category_title : '';
     $this->categoryLink = $this->_articleParams->get('link_category') ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->catid)) : '';
     $this->parentCategory = $this->_articleParams->get('show_parent_category') && $this->_article->parent_id != 1 ? $this->_article->parent_title : '';
     $this->parentCategoryLink = $this->_articleParams->get('link_parent_category') ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->parent_id)) : '';
 }
示例#7
0
 public function __construct($component, $componentParams, $article, $articleParams)
 {
     parent::__construct($component, $componentParams, $article, $articleParams);
     $this->titleLink = $this->_articleParams->get('link_titles') ? JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catslug)) : '';
     $this->category = $this->_articleParams->get('show_category') ? $this->_article->category_title : '';
     $this->categoryLink = $this->_articleParams->get('link_category') && $this->_article->catslug ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->catslug)) : '';
     $this->parentCategoryLink = $this->_articleParams->get('link_parent_category') && $this->_article->parent_slug ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->parent_slug)) : '';
     $this->intro = $this->_articleParams->get('show_intro') ? $this->_article->introtext : '';
 }
示例#8
0
 /**
  * Get category link url by category id.
  *
  * @param   integer $catid    Category id to load Table.
  * @param   bool    $absolute Ture to return whole absolute url.
  *
  * @return  string Category link url.
  */
 public static function getCategoryLink($catid, $absolute = false)
 {
     include_once JPATH_ROOT . '/components/com_content/helpers/route.php';
     $path = \ContentHelperRoute::getCategoryRoute($catid);
     if ($absolute) {
         return \JUri::root() . $path;
     } else {
         return $path;
     }
 }
示例#9
0
文件: category.php 项目: MrJookie/pm
 /**
  * Method to get the item title link
  *
  * @return    string              The title link
  */
 protected function getTitleLink()
 {
     if ($this->client_id) {
         $link = 'index.php?option=com_categories' . '&task=' . $this->item->name . '.edit' . '&id=' . (int) $this->item->item_id;
     } else {
         $item_slug = $this->item->item_id . ':' . $this->item->metadata->get('alias');
         $link = ContentHelperRoute::getCategoryRoute($item_slug);
     }
     return JRoute::_($link);
 }
 /**
  * Method to get the associations for a given category
  *
  * @param   integer  $id         Id of the item
  * @param   string   $extension  Name of the component
  *
  * @return  array   Array of associations for the component categories
  *
  * @since  3.0
  */
 public static function getCategoryAssociations($id = 0, $extension = 'com_content')
 {
     $return = array();
     if ($id) {
         $associations = CategoriesHelper::getAssociations($id, $extension);
         foreach ($associations as $tag => $item) {
             $return[$tag] = ContentHelperRoute::getCategoryRoute($item, $tag);
         }
     }
     return $return;
 }
示例#11
0
 /**
  * Get category link url by category id.
  * 
  * @param   integer $catid      Category id to load Table.
  * @param   boolean $absolute   Ture to return whole absolute url.
  *
  * @return  type    
  */
 public static function getCategoryLink($catid, $absolute = 0)
 {
     include_once JPATH_ROOT . DS . 'components' . DS . 'com_content' . DS . 'helpers' . DS . 'route.php';
     $path = JRoute::_(ContentHelperRoute::getCategoryRoute($catid));
     $host = str_replace('http://' . $_SERVER['HTTP_HOST'], '', JURI::root());
     $path = str_replace($host, '', $path);
     if ($absolute) {
         return AKHelper::_('uri.pathAddHost', $path);
     } else {
         return $path;
     }
 }
示例#12
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $doc = JFactory::getDocument();
     $params = $app->getParams();
     $feedEmail = $app->getCfg('feed_email', 'author');
     $siteEmail = $app->getCfg('mailfrom');
     // Get some data from the model
     $app->input->set('limit', $app->getCfg('feed_limit'));
     $category = $this->get('Category');
     $rows = $this->get('Items');
     $doc->link = JRoute::_(ContentHelperRoute::getCategoryRoute($category->id));
     foreach ($rows as $row) {
         // Strip html from feed item title
         $title = $this->escape($row->title);
         $title = html_entity_decode($title, ENT_COMPAT, 'UTF-8');
         // Compute the article slug
         $row->slug = $row->alias ? $row->id . ':' . $row->alias : $row->id;
         // Url link to article
         $link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid));
         // Get row fulltext
         $db = JFactory::getDBO();
         $query = 'SELECT' . $db->quoteName('fulltext') . 'FROM #__content WHERE id =' . $row->id;
         $db->setQuery($query);
         $row->fulltext = $db->loadResult();
         // Get description, author and date
         $description = $params->get('feed_summary', 0) ? $row->introtext . $row->fulltext : $row->introtext;
         $author = $row->created_by_alias ? $row->created_by_alias : $row->author;
         @($date = $row->publish_up ? date('r', strtotime($row->publish_up)) : '');
         // Load individual item creator class
         $item = new JFeedItem();
         $item->title = $title;
         $item->link = $link;
         $item->date = $date;
         $item->category = $row->category_title;
         $item->author = $author;
         if ($feedEmail == 'site') {
             $item->authorEmail = $siteEmail;
         } elseif ($feedEmail === 'author') {
             $item->authorEmail = $row->author_email;
         }
         // Add readmore link to description if introtext is shown, show_readmore is true and fulltext exists
         if (!$params->get('feed_summary', 0) && $params->get('feed_show_readmore', 0) && $row->fulltext) {
             $description .= '<p class="feed-readmore"><a target="_blank" href ="' . $item->link . '">' . JText::_('COM_CONTENT_FEED_READMORE') . '</a></p>';
         }
         // Load item description and add div
         $item->description = '<div class="feed-description">' . $description . '</div>';
         // Loads item info into rss array
         $doc->addItem($item);
     }
 }
示例#13
0
 public function __construct($component, $componentParams, $article, $articleParams, $properties)
 {
     parent::__construct($component, $componentParams, $article, $articleParams);
     $this->print = isset($properties['print']) ? $properties['print'] : '';
     $this->pageHeading = $this->_componentParams->get('show_page_heading', 1) ? $this->_componentParams->get('page_heading') : '';
     $this->titleLink = $this->_articleParams->get('link_titles') && !empty($this->_article->readmore_link) ? $this->_article->readmore_link : '';
     $this->emailIconVisible = $this->emailIconVisible && !$this->print;
     $this->editIconVisible = $this->editIconVisible && !$this->print;
     $this->categoryLink = $this->_articleParams->get('link_category') && $this->_article->catslug ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->catslug)) : '';
     $this->category = $this->_articleParams->get('show_category') ? $this->_article->category_title : '';
     $this->categoryLink = $this->_articleParams->get('link_category') && $this->_article->catslug ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->catslug)) : '';
     $this->parentCategory = $this->_articleParams->get('show_parent_category') && $this->_article->parent_slug != '1:root' ? $this->_article->parent_title : '';
     $this->parentCategoryLink = $this->_articleParams->get('link_parent_category') && $this->_article->parent_slug ? JRoute::_(ContentHelperRoute::getCategoryRoute($this->_article->parent_slug)) : '';
     $this->author = $this->_articleParams->get('show_author') && !empty($this->_article->author) ? $this->_article->created_by_alias ? $this->_article->created_by_alias : $this->_article->author : '';
     if (strlen($this->author) && $this->_articleParams->get('link_author')) {
         $needle = 'index.php?option=com_contact&view=contact&id=' . $this->_article->contactid;
         $menu = JFactory::getApplication()->getMenu();
         $item = $menu->getItems('link', $needle, true);
         $this->authorLink = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
     } else {
         $this->authorLink = '';
     }
     $this->toc = isset($this->_article->toc) ? $this->_article->toc : '';
     $this->text = $this->_articleParams->get('access-view') ? $this->_article->text : '';
     $user = JFactory::getUser();
     $this->introVisible = !$this->_articleParams->get('access-view') && $this->_articleParams->get('show_noauth') && $user->get('guest');
     $this->intro = $this->_article->introtext;
     if (!$this->_articleParams->get('access-view') && $this->_articleParams->get('show_noauth') && $user->get('guest') && $this->_articleParams->get('show_readmore') && $this->_article->fulltext != null) {
         $attribs = json_decode($this->_article->attribs);
         if ($attribs->alternative_readmore == null) {
             $this->readmore = JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
         } elseif ($this->readmore = $this->_article->alternative_readmore) {
             if ($this->_articleParams->get('show_readmore_title', 0) != 0) {
                 $this->readmore .= JHtml::_('string.truncate', $this->_article->title, $this->_articleParams->get('readmore_limit'));
             }
         } elseif ($this->_articleParams->get('show_readmore_title', 0) == 0) {
             $this->readmore = JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
         } else {
             $this->readmore = JText::_('COM_CONTENT_READ_MORE') . JHtml::_('string.truncate', $this->_article->title, $this->_articleParams->get('readmore_limit'));
         }
         $link = new JURI(JRoute::_('index.php?option=com_users&view=login'));
         $this->readmoreLink = $link->__toString();
     } else {
         $this->readmore = '';
         $this->readmoreLink = '';
     }
     $this->paginationPosition = isset($this->_article->pagination) && $this->_article->pagination && isset($this->_article->paginationposition) ? ($this->_article->paginationposition ? 'below' : 'above') . ' ' . ($this->_article->paginationrelative ? 'full article' : 'text') : '';
     $this->showLinks = isset($this->_article->urls) && is_string($this->_article->urls) && !empty($this->_article->urls);
 }
示例#14
0
 protected function getLinks()
 {
     $db =& JFactory::getDBO();
     $query = $db->getQuery(true);
     $query->select('id, alias');
     $query->from('#__categories');
     $query->where('level > 0 AND extension = "com_content"');
     $query->order('alias', 'asc');
     $db->setQuery($query);
     $this->items = $db->loadObjectList();
     foreach ($this->items as $key => $item) {
         $this->items[$key]->link = JRoute::_(ContentHelperRoute::getCategoryRoute($item->id));
     }
     return $this->items;
 }
示例#15
0
 /**
  * Categories Search method
  *
  * The sql must return the following fields that are
  * used in a common display routine: href, title, section, created, text,
  * browsernav
  * @param string Target search string
  * @param string mathcing option, exact|any|all
  * @param string ordering option, newest|oldest|popular|alpha|category
  * @param mixed An array if restricted to areas, null if search all
  */
 function onSearch($text, $phrase = '', $ordering = '', $areas = null)
 {
     $db =& JFactory::getDbo();
     $user =& JFactory::getUser();
     $groups = implode(',', $user->authorisedLevels());
     $searchText = $text;
     require_once JPATH_SITE . DS . 'components' . DS . 'com_content' . DS . 'helpers' . DS . 'route.php';
     if (is_array($areas)) {
         if (!array_intersect($areas, array_keys(plgSearchCategoryAreas()))) {
             return array();
         }
     }
     // load plugin params info
     $plugin =& JPluginHelper::getPlugin('search', 'categories');
     $pluginParams = new JParameter($plugin->params);
     $limit = $pluginParams->def('search_limit', 50);
     $text = trim($text);
     if ($text == '') {
         return array();
     }
     switch ($ordering) {
         case 'alpha':
             $order = 'a.title ASC';
             break;
         case 'category':
         case 'popular':
         case 'newest':
         case 'oldest':
         default:
             $order = 'a.title DESC';
     }
     $text = $db->Quote('%' . $db->getEscaped($text, true) . '%', false);
     $query = 'SELECT a.title, a.description AS text, "" AS created, "2" AS browsernav, a.id AS catid,' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug' . ' FROM #__categories AS a' . ' WHERE (a.title LIKE ' . $text . ' OR a.description LIKE ' . $text . ')' . ' AND a.published = 1' . ' AND a.access IN (' . $groups . ')' . ' GROUP BY a.id' . ' ORDER BY ' . $order;
     $db->setQuery($query, 0, $limit);
     $rows = $db->loadObjectList();
     $count = count($rows);
     for ($i = 0; $i < $count; $i++) {
         $rows[$i]->href = ContentHelperRoute::getCategoryRoute($rows[$i]->slug);
         $rows[$i]->section = JText::_('Category');
     }
     $return = array();
     foreach ($rows as $key => $category) {
         if (searchHelper::checkNoHTML($category, $searchText, array('name', 'title', 'text'))) {
             $return[] = $category;
         }
     }
     return $return;
 }
示例#16
0
 static function displayCategoryLinks($parent_categories, $item)
 {
     for ($i = 0; $i < count($parent_categories); $i++) {
         if ($parent_categories[$i]->catslug != ':') {
             $url = '<span><a class="link-categoria" rel="tag" href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($parent_categories[$i]->catslug)) . '">' . $parent_categories[$i]->title . '</a></span><span class="separator">,</span>';
             echo $url;
         } else {
             echo '<span>' . $parent_categories[$i]->title . '</span><span class="separator">,</span>';
         }
     }
     $url = '<span><a class="link-categoria" rel="tag" href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($item->catslug)) . '">' . $item->category_title . '</a></span>';
     if ($item->catslug) {
         echo $url;
     } else {
         echo '<span>' . $item->category_title . '</span>';
     }
 }
示例#17
0
 function display()
 {
     $app = JFactory::getApplication();
     $doc = 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'));
     $category = $this->get('Category');
     $rows = $this->get('Items');
     $doc->link = JRoute::_(ContentHelperRoute::getCategoryRoute($category->id));
     foreach ($rows as $row) {
         // strip html from feed item title
         $title = $this->escape($row->title);
         $title = html_entity_decode($title, ENT_COMPAT, 'UTF-8');
         // Compute the article slug
         $row->slug = $row->alias ? $row->id . ':' . $row->alias : $row->id;
         // url link to article
         $link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid));
         // 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_title;
         $item->author = $author;
         if ($feedEmail == 'site') {
             $item->authorEmail = $siteEmail;
         } else {
             $item->authorEmail = $row->author_email;
         }
         // loads item info into rss array
         $doc->addItem($item);
     }
 }
示例#18
0
/**
 * Categories Search method
 *
 * The sql must return the following fields that are
 * used in a common display routine: href, title, section, created, text,
 * browsernav
 * @param string Target search string
 * @param string mathcing option, exact|any|all
 * @param string ordering option, newest|oldest|popular|alpha|category
 * @param mixed An array if restricted to areas, null if search all
 */
function plgSearchCategories($text, $phrase = '', $ordering = '', $areas = null)
{
    $db =& JFactory::getDBO();
    $user =& JFactory::getUser();
    require_once JPATH_SITE . DS . 'components' . DS . 'com_content' . DS . 'helpers' . DS . 'route.php';
    if (is_array($areas)) {
        if (!array_intersect($areas, array_keys(plgSearchCategoryAreas()))) {
            return array();
        }
    }
    // load plugin params info
    $plugin =& JPluginHelper::getPlugin('search', 'categories');
    $pluginParams = new JParameter($plugin->params);
    $limit = $pluginParams->def('search_limit', 50);
    $text = trim($text);
    if ($text == '') {
        return array();
    }
    switch ($ordering) {
        case 'alpha':
            $order = 'a.name ASC';
            break;
        case 'category':
        case 'popular':
        case 'newest':
        case 'oldest':
        default:
            $order = 'a.name DESC';
    }
    $text = $db->Quote('%' . $db->getEscaped($text, true) . '%', false);
    $query = 'SELECT a.title, a.description AS text, "" AS created,' . ' "2" AS browsernav,' . ' s.id AS secid, a.id AS catid,' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug' . ' FROM #__categories AS a' . ' INNER JOIN #__sections AS s ON s.id = a.section' . ' WHERE ( a.name LIKE ' . $text . ' OR a.title LIKE ' . $text . ' OR a.description LIKE ' . $text . ' )' . ' AND a.published = 1' . ' AND s.published = 1' . ' AND a.access <= ' . (int) $user->get('aid') . ' AND s.access <= ' . (int) $user->get('aid') . ' GROUP BY a.id' . ' ORDER BY ' . $order;
    $db->setQuery($query, 0, $limit);
    $rows = $db->loadObjectList();
    $count = count($rows);
    for ($i = 0; $i < $count; $i++) {
        $rows[$i]->href = ContentHelperRoute::getCategoryRoute($rows[$i]->slug, $rows[$i]->secid);
        $rows[$i]->section = JText::_('Category');
    }
    return $rows;
}
示例#19
0
 function getItems($args)
 {
     global $mainframe;
     $advlink =& AdvLink::getInstance();
     require_once JPATH_SITE . DS . 'components' . DS . 'com_content' . DS . 'helpers' . DS . 'route.php';
     $sections = AdvlinkContent::_section();
     $items = array();
     $view = isset($args->view) ? $args->view : '';
     switch ($view) {
         default:
             foreach ($sections as $section) {
                 $items[] = array('id' => ContentHelperRoute::getSectionRoute($section->id), 'name' => $section->title, 'class' => 'folder content');
             }
             // Check Static/Uncategorized permissions
             if ($advlink->checkAccess('advlink_static', '1')) {
                 $items[] = array('id' => 'option=com_content&amp;view=uncategorized', 'name' => JText::_('UNCATEGORIZED'), 'class' => 'folder content nolink');
             }
             break;
         case 'section':
             $categories = AdvLink::getCategory($args->id);
             foreach ($categories as $category) {
                 $items[] = array('id' => ContentHelperRoute::getCategoryRoute($category->slug, $args->id), 'name' => $category->title . ' / ' . $category->alias, 'class' => 'folder content');
             }
             break;
         case 'category':
             $articles = AdvlinkContent::_articles($args->id);
             foreach ($articles as $article) {
                 $items[] = array('id' => ContentHelperRoute::getArticleRoute($article->slug, $article->catslug, $article->sectionid), 'name' => $article->title . ' / ' . $article->alias, 'class' => 'file');
             }
             break;
         case 'uncategorized':
             $statics = AdvlinkContent::_statics();
             foreach ($statics as $static) {
                 $items[] = array('id' => ContentHelperRoute::getArticleRoute($static->id), 'name' => $static->title . ' / ' . $static->alias, 'class' => 'file');
             }
             break;
     }
     return $items;
 }
示例#20
0
					<dt class="parent-category-name"><?php 
                echo JText::sprintf('COM_CONTENT_PARENT', '</dt><dd itemprop="genre">' . $title . '</dd>');
                ?>
				<?php 
            }
            ?>
			<?php 
        }
        ?>
			
			<?php 
        if ($params->get('show_category')) {
            ?>
				<?php 
            $title = $this->escape($this->item->category_title);
            $url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug)) . '" itemprop="genre">' . $title . '</a>';
            ?>
				<?php 
            if ($params->get('link_category') and $this->item->catslug) {
                ?>
				<dt class="category-name"><?php 
                echo JText::sprintf('COM_CONTENT_CATEGORY', '</dt><dd>' . $url . '</dd>');
                ?>
				<?php 
            } else {
                ?>
				<dt class="category-name"><?php 
                echo JText::sprintf('COM_CONTENT_CATEGORY', '</dt><dd itemprop="genre">' . $title . '</dd>');
                ?>
				<?php 
            }
示例#21
0
<?php

/**
* @package   Warp Theme Framework
* @author    YOOtheme http://www.yootheme.com
* @copyright Copyright (C) YOOtheme GmbH
* @license   http://www.gnu.org/licenses/gpl.html GNU/GPL
*/
// no direct access
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
$params =& $this->params;
foreach ($this->items as $item) {
    // template args
    $args = array('permalink' => '', 'image' => '', 'image_alignment' => '', 'image_alt' => '', 'image_caption' => '', 'title' => $this->escape($item->title), 'author' => $item->created_by_alias ? $item->created_by_alias : $item->author, 'author_url' => !empty($item->contactid) && $params->get('link_author') == true ? JRoute::_('index.php?option=com_contact&view=contact&id=' . $item->contactid) : '', 'date' => $params->get('show_create_date') ? JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC3')) : '', 'datetime' => substr($item->created, 0, 10), 'category' => $params->get('show_category') ? $this->escape($item->category_title) : '', 'category_url' => $params->get('link_category') ? JRoute::_(ContentHelperRoute::getCategoryRoute($item->catslug)) : '', 'hook_aftertitle' => '', 'hook_beforearticle' => '', 'hook_afterarticle' => '', 'article' => $params->get('show_intro') ? JHtml::_('string.truncate', $item->introtext, $params->get('introtext_limit')) : '', 'tags' => '', 'edit' => '', 'url' => JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug)), 'more' => '', 'previous' => '', 'next' => '');
    if ($params->get('show_readmore') && $item->readmore) {
        $args['more'] = $item->alternative_readmore ?: JText::_('TPL_WARP_CONTINUE_READING');
    }
    // render template
    echo $warp['template']->render('article', $args);
}
echo $this->pagination->getPagesLinks();
示例#22
0
" title="<?php 
        echo $row->title;
        ?>
" alt=""/>
            <?php 
    }
    ?>
			<?php 
    if ($params->get('itemCategory', 1)) {
        ?>
                   <div class="lof-category">
                  <a title="<?php 
        echo $row->category_title;
        ?>
" href="<?php 
        echo isset($row->categoryLink) ? $row->categoryLink : JRoute::_(ContentHelperRoute::getCategoryRoute($row->catid));
        ?>
"><?php 
        echo $row->category_title;
        ?>
</a>
                   </div>
            <?php 
    }
    ?>
               
                
        </div>
	<?php 
}
?>
        ?>
				<?php 
        echo JText::sprintf('COM_CONTENT_PARENT', $title);
        ?>
			<?php 
    }
    ?>
		</dd>
<?php 
}
if ($params->get('show_category')) {
    ?>
		<dd class="category-name">
			<?php 
    $title = $this->escape($this->item->category_title);
    $url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catid)) . '">' . $title . '</a>';
    ?>
			<?php 
    if ($params->get('link_category')) {
        ?>
				<?php 
        echo JText::sprintf('COM_CONTENT_CATEGORY', $url);
        ?>
				<?php 
    } else {
        ?>
				<?php 
        echo JText::sprintf('COM_CONTENT_CATEGORY', $title);
        ?>
			<?php 
    }
        ?>
		<?php 
        if ($this->params->get('show_empty_categories') || $child->getNumItems(true) || count($child->getChildren())) {
            if (!isset($this->children[$this->category->id][$id + 1])) {
                $class = ' class="last"';
            }
            ?>
		<li<?php 
            echo $class;
            ?>
>
			<?php 
            $class = '';
            ?>
				<h3 class="item-title"><a href="<?php 
            echo JRoute::_(ContentHelperRoute::getCategoryRoute($child->id));
            ?>
">
					<?php 
            echo $this->escape($child->title);
            ?>
</a>
				</h3>
				<?php 
            if ($this->params->get('show_subcat_desc') == 1) {
                ?>
				<?php 
                if ($child->description and $this->params->get('show_description') != 0) {
                    ?>
					<div class="category-desc">
						<?php 
示例#25
0
 /**
  * Prepares the document
  */
 protected function _prepareDocument()
 {
     $app = JFactory::getApplication();
     $menus = $app->getMenu();
     $pathway = $app->getPathway();
     $title = null;
     // Because the application sets a default page title,
     // we need to get it from the menu item itself
     $menu = $menus->getActive();
     if ($menu) {
         $this->params->def('page_heading', $this->params->get('page_title', $menu->title));
     } else {
         $this->params->def('page_heading', JText::_('JGLOBAL_ARTICLES'));
     }
     $id = (int) @$menu->query['id'];
     if ($menu && ($menu->query['option'] != 'com_content' || $menu->query['view'] == 'article' || $id != $this->category->id)) {
         $path = array(array('title' => $this->category->title, 'link' => ''));
         $category = $this->category->getParent();
         while (($menu->query['option'] != 'com_content' || $menu->query['view'] == 'article' || $id != $category->id) && $category->id > 1) {
             $path[] = array('title' => $category->title, 'link' => ContentHelperRoute::getCategoryRoute($category->id));
             $category = $category->getParent();
         }
         $path = array_reverse($path);
         foreach ($path as $item) {
             $pathway->addItem($item['title'], $item['link']);
         }
     }
     $title = $this->params->get('page_title', '');
     if (empty($title)) {
         $title = $app->getCfg('sitename');
     } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) {
         $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
     } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) {
         $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
     }
     $this->document->setTitle($title);
     if ($this->category->metadesc) {
         $this->document->setDescription($this->category->metadesc);
     } elseif (!$this->category->metadesc && $this->params->get('menu-meta_description')) {
         $this->document->setDescription($this->params->get('menu-meta_description'));
     }
     if ($this->category->metakey) {
         $this->document->setMetadata('keywords', $this->category->metakey);
     } elseif (!$this->category->metakey && $this->params->get('menu-meta_keywords')) {
         $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
     }
     if ($this->params->get('robots')) {
         $this->document->setMetadata('robots', $this->params->get('robots'));
     }
     if ($app->getCfg('MetaAuthor') == '1') {
         $this->document->setMetaData('author', $this->category->getMetadata()->get('author'));
     }
     $mdata = $this->category->getMetadata()->toArray();
     foreach ($mdata as $k => $v) {
         if ($v) {
             $this->document->setMetadata($k, $v);
         }
     }
     // Add feed links
     if ($this->params->get('show_feed_link', 1)) {
         $link = '&format=feed&limitstart=';
         $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
         $this->document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs);
         $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
         $this->document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs);
     }
 }
示例#26
0
        echo JText::_('Posted in ');
        if ($this->item->params->get('show_section') && $this->item->sectionid && isset($this->section->title)) {
            if ($this->item->params->get('link_section')) {
                echo '<a href="' . JRoute::_(ContentHelperRoute::getSectionRoute($this->item->sectionid)) . '">';
            }
            echo $this->section->title;
            if ($this->item->params->get('link_section')) {
                echo '</a>';
            }
            if ($this->item->params->get('show_category')) {
                echo ' - ';
            }
        }
        if ($this->item->params->get('show_category') && $this->item->catid) {
            if ($this->item->params->get('link_category')) {
                echo '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug, $this->item->sectionid)) . '">';
            }
            echo $this->item->category;
            if ($this->item->params->get('link_category')) {
                echo '</a>';
            }
        }
    }
    ?>
	
	
	</p>
	<?php 
}
?>
示例#27
0
							</td>
							<td>
								<?php 
        echo JLayoutHelper::render('joomla.html.treeprefix', array('level' => $item->level));
        ?>
								<a href="javascript:void(0)" onclick="if (window.parent) window.parent.<?php 
        echo $this->escape($function);
        ?>
('<?php 
        echo $item->id;
        ?>
', '<?php 
        echo $this->escape(addslashes($item->title));
        ?>
', null, '<?php 
        echo $this->escape(ContentHelperRoute::getCategoryRoute($item->id, $item->language));
        ?>
', '<?php 
        echo $this->escape($lang);
        ?>
', null);">
									<?php 
        echo $this->escape($item->title);
        ?>
								</a>
							</td>
							<td class="small hidden-phone">
								<?php 
        echo $this->escape($item->access_level);
        ?>
							</td>
示例#28
0
    echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language));
    ?>
" title="<?php 
    echo 'Read ' . $this->item->title;
    ?>
">
														Read Article
						</a>
					</div>	
				<?php 
}
?>

				<div class="catBlock">
					<?php 
$caturl = JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug));
?>
						<span><i class="fa fa-folder"></i> Published in <a href="<?php 
echo $caturl;
?>
" title="View more articles in <?php 
echo $this->item->category_title;
?>
"><?php 
echo $this->item->category_title;
?>
</a></span>														
				</div>

				<?php 
if ($params->get('show_tags') && !empty($this->item->tags->itemTags)) {
示例#29
0
            ?>
		<div<?php 
            echo $class;
            ?>
>
			<?php 
            $class = ' class="category-item col-md-4 col-xs-12"';
            ?>
			<div class="category-inner">
			<div class="category-header">
				<?php 
            echo $item->catimg;
            ?>
				<h3 class="page-header item-title"><a
						href="<?php 
            echo JRoute::_(ContentHelperRoute::getCategoryRoute($item->id));
            ?>
">
						<?php 
            echo $this->escape($item->title);
            ?>
</a>
					<?php 
            if ($this->params->get('show_cat_num_articles', 1)) {
                ?>
						<span class="badge badge-info tip hasTooltip" rel="tooltip"
							  title="<?php 
                echo JText::_('COM_CONTENT_NUM_ITEMS');
                ?>
">
						<?php 
示例#30
0
 /**
  * Prepares the document
  */
 protected function _prepareDocument()
 {
     $app = JFactory::getApplication();
     $menus = $app->getMenu();
     $pathway = $app->getPathway();
     $title = null;
     // Because the application sets a default page title,
     // we need to get it from the menu item itself
     $menu = $menus->getActive();
     if ($menu) {
         $this->params->def('page_heading', $this->params->get('page_title', $menu->title));
     } else {
         $this->params->def('page_heading', JText::_('JGLOBAL_ARTICLES'));
     }
     $title = $this->params->get('page_title', '');
     $id = (int) @$menu->query['id'];
     // if the menu item does not concern this article
     if ($menu && ($menu->query['option'] != 'com_content' || $menu->query['view'] != 'article' || $id != $this->item->id)) {
         // If this is not a single article menu item, set the page title to the article title
         if ($this->item->title) {
             $title = $this->item->title;
         }
         $path = array(array('title' => $this->item->title, 'link' => ''));
         $category = JCategories::getInstance('Content')->get($this->item->catid);
         while ($category && ($menu->query['option'] != 'com_content' || $menu->query['view'] == 'article' || $id != $category->id) && $category->id > 1) {
             $path[] = array('title' => $category->title, 'link' => ContentHelperRoute::getCategoryRoute($category->id));
             $category = $category->getParent();
         }
         $path = array_reverse($path);
         foreach ($path as $item) {
             $pathway->addItem($item['title'], $item['link']);
         }
     }
     // Check for empty title and add site name if param is set
     if (empty($title)) {
         $title = $app->getCfg('sitename');
     } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) {
         $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
     } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) {
         $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
     }
     if (empty($title)) {
         $title = $this->item->title;
     }
     $this->document->setTitle($title);
     if ($this->item->metadesc) {
         $this->document->setDescription($this->item->metadesc);
     } elseif (!$this->item->metadesc && $this->params->get('menu-meta_description')) {
         $this->document->setDescription($this->params->get('menu-meta_description'));
     }
     if ($this->item->metakey) {
         $this->document->setMetadata('keywords', $this->item->metakey);
     } elseif (!$this->item->metakey && $this->params->get('menu-meta_keywords')) {
         $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
     }
     if ($this->params->get('robots')) {
         $this->document->setMetadata('robots', $this->params->get('robots'));
     }
     if ($app->getCfg('MetaAuthor') == '1') {
         $this->document->setMetaData('author', $this->item->author);
     }
     $mdata = $this->item->metadata->toArray();
     foreach ($mdata as $k => $v) {
         if ($v) {
             $this->document->setMetadata($k, $v);
         }
     }
     // If there is a pagebreak heading or title, add it to the page title
     if (!empty($this->item->page_title)) {
         $this->item->title = $this->item->title . ' - ' . $this->item->page_title;
         $this->document->setTitle($this->item->page_title . ' - ' . JText::sprintf('PLG_CONTENT_PAGEBREAK_PAGE_NUM', $this->state->get('list.offset') + 1));
     }
     if ($this->print) {
         $this->document->setMetaData('robots', 'noindex, nofollow');
     }
 }