Committer: Apostolos Koutsoulelos <apostolos@desktop.(none)>
[arthrology.git] / arthrology.sitemap.php
blob27ba7ac5276a4c140d9563359f775a4c590521b7
1 <?php
3 /*
4 * Event Calendar for Elxis CMS 2008.x and 2009.x
6 * Sitemap extension
8 * @version 1.3
9 * @package Arthrology
10 * @author Apostolos Koutsoulelos <akoutsoulelos@yahoo.gr>
11 * @authorurl http://www.bitcraft-labs.gr
12 * @copyright Copyright (C) 2009-2011 Apostolos Koutsoulelos. All rights reserved.
13 * @license GNU/GPL (http://www.gnu.org/copyleft/gpl.html)
15 * @link http://www.elxis-downloads.com/downloads/miscellaneous/204.html
18 defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
20 if (!defined('EVCALBASE')) {
21 global $_VERSION;
22 if ($_VERSION->RELEASE > 2008) {
23 define('EVCALBASE', 'events');
24 } else {
25 define('EVCALBASE', 'com_eventcalendar');
29 class sitemap_arthrology {
31 /***************/
32 /* CONSTRUCTOR */
33 /***************/
34 public function __construct() {
38 /****************************/
39 /* MENU ITEM TYPE VALIDATOR */
40 /****************************/
41 public function isOfType( $parent ) {
42 if (strpos($parent->link, 'option=com_arthrology')) { return true; }
43 return false;
47 /********************/
48 /* RETURN NODE TREE */
49 /********************/
50 public function getTree($parent) {
51 global $database, $xartis, $mainframe, $my;
53 $query = "SELECT id FROM #__menu"
54 ."\n WHERE link = 'index.php?option=com_arthrology' AND published = '1'"
55 ."\n AND ((language IS NULL) OR (language LIKE '%".$xartis->maplang."%'))";
56 $database->setQuery($query, '#__', 1, 0);
57 $_Itemid = intval($database->loadResult());
59 $database->setQuery("SELECT * FROM #__categories WHERE section='com_arthrology' ORDER BY title ASC");
60 $rows = $database->loadObjectList();
62 $list = array();
63 if ($rows) {
64 foreach ($rows as $row) {
65 $node = new stdClass;
66 $node->name = $row->title;
67 $node->link = 'index.php?option=com_arthrology&amp;task=magview&amp;catid='.$row->id;
68 $node->seolink = EVCALBASE.'/'.$row->seotitle.'/';
69 $node->id = $_Itemid;
70 $node->modified = time() + ($mainframe->getCfg('offset') * 3600);
71 $node->changefreq = 'daily';
72 $node->priority = '0.8';
73 $node->pid = 0;
74 $node->icon = 'category';
75 $list[$row->id] = $node;
76 unset($node);
80 return $list;
86 global $xartis;
87 $tmp = new sitemap_arthrology;
88 $xartis->addExtension($tmp);
89 unset($tmp);