/** Return an array with all Items in a Section */
 function getContentBlogSection(&$xmap, &$parent, $secid, &$params, &$menuparams)
 {
     $db =& JFactory::getDBO();
     if ($params['articles_order'] == 'menu') {
         $order_sec = $menuparams->get('orderby_sec', 'rdate');
     } else {
         $order_sec = $params['articles_order'];
     }
     $order_pri = $menuparams->get('orderby_pri');
     $order_pri = xmap_com_content::orderby_pri($order_pri);
     $order_sec = xmap_com_content::orderby_sec($order_sec);
     $now = date('Y-m-d H:i:s', $xmap->now);
     $query = "SELECT a.id, a.title,a.access,a.metakey, UNIX_TIMESTAMP(a.modified) AS modified, UNIX_TIMESTAMP(a.created) AS created,a.sectionid" . ',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' . ',cc.title as category' . "\n FROM #__content AS a" . "\n INNER JOIN #__categories AS cc ON cc.id = a.catid" . "\n LEFT JOIN #__users AS u ON u.id = a.created_by" . "\n LEFT JOIN #__content_rating AS v ON a.id = v.content_id" . "\n LEFT JOIN #__sections AS s ON a.sectionid = s.id" . "\n LEFT JOIN #__groups AS g ON a.access = g.id" . "\n WHERE a.sectionid = '" . $secid . "'" . "\n AND s.access <= " . $xmap->gid . "\n AND cc.access <= " . $xmap->gid . "\n AND a.state = '1'" . "\n AND ( a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '{$now}' )" . "\n AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '{$now}' )" . ($params['show_unauth'] ? '' : "\n AND a.access <= " . $xmap->gid) . ($params['max_art_age'] ? "\n AND ( a.created >= '" . date('Y-m-d H:i:s', time() - $params['max_art_age'] * 86400) . "' ) " : '') . "\n AND s.published = 1" . "\n AND cc.published = 1" . ($xmap->view != 'xmal' ? "\n ORDER BY {$order_pri} {$order_sec}" : '');
     return xmap_com_content::showArticles($xmap, $parent, $params, $query);
 }
 /** Return an array with all Items in a Section */
 function getContentBlogSection(&$xmap, &$parent, $secid, &$params, &$menuparams)
 {
     $database =& JFactory::getDBO();
     $order_pri = isset($menuparams['orderby_pri']) ? $menuparams['orderby_pri'] : '';
     $order_sec = isset($menuparams['orderby_sec']) && !empty($menuparams['orderby_sec']) ? $menuparams['orderby_sec'] : 'rdate';
     $order_pri = xmap_com_content::orderby_pri($order_pri);
     $order_sec = xmap_com_content::orderby_sec($order_sec);
     if ($secid == 0) {
         // Multi section
         $secid = xmap_com_content::getParam($menuparams, 'sectionid', $secid);
     }
     $where = xmap_com_content::where(1, $xmap->access, $xmap->noauth, $xmap->gid, $secid, date('Y-m-d H:i:s', $xmap->now));
     $query = "SELECT a.id, a.title, a.modified, a.created,a.sectionid" . ',CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug' . ',CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as catslug' . "\n FROM #__content AS a" . "\n INNER JOIN #__categories AS cc ON cc.id = a.catid" . "\n LEFT JOIN #__users AS u ON u.id = a.created_by" . "\n LEFT JOIN #__content_rating AS v ON a.id = v.content_id" . "\n LEFT JOIN #__sections AS s ON a.sectionid = s.id" . "\n LEFT JOIN #__groups AS g ON a.access = g.id" . "\n WHERE " . implode("\n AND ", $where) . "\n AND s.access <= " . $xmap->gid . "\n AND cc.access <= " . $xmap->gid . "\n AND s.published = 1" . "\n AND cc.published = 1" . ($xmap->view != 'xmal' ? "\n ORDER BY {$order_pri} {$order_sec}" : '');
     $database->setQuery($query);
     $items = $database->loadObjectList();
     $xmap->changeLevel(1);
     foreach ($items as $item) {
         $node = new stdclass();
         $node->id = $parent->id;
         $node->uid = $parent->uid . 'a' . $item->id;
         $node->browserNav = $parent->browserNav;
         $node->priority = $params['art_priority'];
         $node->changefreq = $params['art_changefreq'];
         $node->name = $item->title;
         $node->expandible = false;
         if ($item->modified == '0000-00-00 00:00:00') {
             $item->modified = $item->created;
         }
         $node->modified = xmap_com_content::toTimestamp($item->modified);
         $node->link = ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid);
         # $node->link = 'index.php?option=com_content&amp;task=view&amp;id='.$item->slug;
         $xmap->printNode($node);
     }
     $xmap->changeLevel(-1);
     return true;
 }
 /**   Get   the   content   tree for this kind of content */
 function getTree(&$xmap, &$parent, &$params)
 {
     $include_tag_clouds = xmap_com_myblog::getParam($params, 'include_tag_clouds', 1);
     $include_tag_clouds = $include_tag_clouds == 1 || $include_tag_clouds == 2 && $xmap->view == 'xml' || $include_tag_clouds == 3 && $xmap->view == 'html' || $xmap->view == 'navigator';
     $params['include_tag_clouds'] = $include_tag_clouds;
     $include_archives = xmap_com_myblog::getParam($params, 'include_archives', 1);
     $include_archives = $include_archives == 1 || $include_archives == 2 && $xmap->view == 'xml' || $include_archives == 3 && $xmap->view == 'html' || $xmap->view == 'navigator';
     $params['include_archives'] = $include_archives;
     $include_feed = xmap_com_myblog::getParam($params, 'include_feed', 1);
     $include_feed = $include_feed == 1 || $include_feed == 2 && $xmap->view == 'xml' || $include_feed == 3 && $xmap->view == 'html';
     $params['include_feed'] = $include_feed;
     $number_of_bloggers = intval(xmap_com_myblog::getParam($params, 'number_of_bloggers', 8));
     $params['number_of_bloggers'] = $number_of_bloggers;
     $text_bloggers = xmap_com_myblog::getParam($params, 'text_bloggers', 'Bloggers');
     $params['text_bloggers'] = $text_bloggers;
     $include_blogger_posts = xmap_com_myblog::getParam($params, 'include_blogger_posts', 1);
     $include_blogger_posts = $include_blogger_posts == 1 || $include_blogger_posts == 2 && $xmap->view == 'xml' || $include_blogger_posts == 3 && $xmap->view == 'html' || $xmap->view == 'navigator';
     $params['include_blogger_posts'] = $include_blogger_posts;
     $number_of_post_per_blogger = intval(xmap_com_myblog::getParam($params, 'number_of_post_per_blogger', 32));
     $params['number_of_post_per_blogger'] = $number_of_post_per_blogger;
     //----- Set tag_priority and tag_changefreq params
     $priority = xmap_com_content::getParam($params, 'tag_priority', $parent->priority);
     $changefreq = xmap_com_content::getParam($params, 'tag_changefreq', $parent->changefreq);
     if ($priority == '-1') {
         $priority = $parent->priority;
     }
     if ($changefreq == '-1') {
         $changefreq = $parent->changefreq;
     }
     $params['tag_priority'] = $priority;
     $params['tag_changefreq'] = $changefreq;
     //----- Set feed_priority and feed_changefreq params
     $priority = xmap_com_content::getParam($params, 'feed_priority', $parent->priority);
     $changefreq = xmap_com_content::getParam($params, 'feed_changefreq', $parent->changefreq);
     if ($priority == '-1') {
         $priority = $parent->priority;
     }
     if ($changefreq == '-1') {
         $changefreq = $parent->changefreq;
     }
     $params['feed_priority'] = $priority;
     $params['feed_changefreq'] = $changefreq;
     //----- Set cats_priority and cats_changefreq params
     $priority = xmap_com_content::getParam($params, 'cats_priority', $parent->priority);
     $changefreq = xmap_com_content::getParam($params, 'cats_changefreq', $parent->changefreq);
     if ($priority == '-1') {
         $priority = $parent->priority;
     }
     if ($changefreq == '-1') {
         $changefreq = $parent->changefreq;
     }
     $params['cats_priority'] = $priority;
     $params['cats_changefreq'] = $changefreq;
     //----- Set blogger_priority and blogger_changefreq params
     $priority = xmap_com_content::getParam($params, 'blogger_priority', $parent->priority);
     $changefreq = xmap_com_content::getParam($params, 'blogger_changefreq', $parent->changefreq);
     if ($priority == '-1') {
         $priority = $parent->priority;
     }
     if ($changefreq == '-1') {
         $changefreq = $parent->changefreq;
     }
     $params['blogger_priority'] = $priority;
     $params['blogger_changefreq'] = $changefreq;
     //----- Set entry_priority and entry_changefreq params
     $priority = xmap_com_content::getParam($params, 'entry_priority', $parent->priority);
     $changefreq = xmap_com_content::getParam($params, 'entry_changefreq', $parent->changefreq);
     if ($priority == '-1') {
         $priority = $parent->priority;
     }
     if ($changefreq == '-1') {
         $changefreq = $parent->changefreq;
     }
     $params['entry_priority'] = $priority;
     $params['entry_changefreq'] = $changefreq;
     //----- Set arc_priority and arc_changefreq params
     $priority = xmap_com_content::getParam($params, 'arc_priority', $parent->priority);
     $changefreq = xmap_com_content::getParam($params, 'arc_changefreq', $parent->changefreq);
     if ($priority == '-1') {
         $priority = $parent->priority;
     }
     if ($changefreq == '-1') {
         $changefreq = $parent->changefreq;
     }
     $params['arc_priority'] = $priority;
     $params['arc_changefreq'] = $changefreq;
     xmap_com_myblog::getMyBlog($xmap, $parent, $params);
 }