4 * Event Calendar for Elxis CMS 2008.x and 2009.x
9 * @package eventCalendar
10 * @author Apostolos Koutsoulelos <akoutsoulelos@yahoo.gr>
11 * @copyright Copyright (C) 2009-2010 Apostolos Koutsoulelos. All rights reserved.
12 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
16 defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
18 if (!defined('EVCALBASE')) {
20 if ($_VERSION->RELEASE
> 2008) {
21 define('EVCALBASE', 'events');
23 define('EVCALBASE', 'com_eventcalendar');
27 class sitemap_eventcalendar
{
32 public function __construct() {
36 /****************************/
37 /* MENU ITEM TYPE VALIDATOR */
38 /****************************/
39 public function isOfType( $parent ) {
40 if (strpos($parent->link
, 'option=com_eventcalendar')) { return true; }
45 /********************/
46 /* RETURN NODE TREE */
47 /********************/
48 public function getTree($parent) {
49 global $database, $xartis, $mainframe, $my;
51 $query = "SELECT id FROM #__menu"
52 ."\n WHERE link = 'index.php?option=com_eventcalendar' AND published = '1'"
53 ."\n AND ((language IS NULL) OR (language LIKE '%".$xartis->maplang
."%'))";
54 $database->setQuery($query, '#__', 1, 0);
55 $_Itemid = intval($database->loadResult());
57 $database->setQuery("SELECT * FROM #__categories WHERE section = 'com_eventcalendar' ORDER BY title ASC");
58 $rows = $database->loadObjectList();
62 foreach ($rows as $row) {
64 $node->name
= $row->title
;
65 $node->link
= 'index.php?option=com_eventcalendar&task=catview&catid='.$row->id
;
66 $node->seolink
= EVCALBASE
.'/'.$row->seotitle
.'/';
68 $node->modified
= time() +
($mainframe->getCfg('offset') * 3600);
69 $node->changefreq
= 'daily';
70 $node->priority
= '0.8';
72 $node->icon
= 'category';
73 $list[$row->id
] = $node;
85 $tmp = new sitemap_eventcalendar
;
86 $xartis->addExtension($tmp);