8
ok... i made the mods but... seems not work
here is a complete code
index.php
<?php
/**
* ****************************************************************************
* Module généré par TDMCreate de la TDM "http://www.tdmxoops.net"
* ****************************************************************************
* xsitemap - MODULE FOR XOOPS AND IMPRESS CMS
* Copyright (c) Urbanspaceman (http://www.takeaweb.it)
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright Urbanspaceman (http://www.takeaweb.it)
* @license GPL
* @package xsitemap
* @author Urbanspaceman (http://www.takeaweb.it)
*
* Version : 1.00:
* ****************************************************************************
*/
include "../../mainfile.php";
//template assign
$xoopsOption['template_main'] = 'xsitemap_index.html' ;
include_once XOOPS_ROOT_PATH."/header.php";
include_once(XOOPS_ROOT_PATH . "/class/tree.php");
include_once XOOPS_ROOT_PATH."/modules/xsitemap/class/plugin.php";
include_once XOOPS_ROOT_PATH."/modules/xsitemap/include/functions.php";
include_once(XOOPS_ROOT_PATH . "/modules/xsitemap/class/xsitemap_class.php");
$xsitemap_configs = $xoopsModuleConfig ;
$pluginHandler =& xoops_getModuleHandler("xsitemap_plugin", "xsitemap");
$criteria = new CriteriaCompo();
$criteria->setSort("plugin_id");
$criteria->setOrder("ASC");
$numrows = $pluginHandler->getCount();
$plugin_arr = $pluginHandler->getall($criteria);
foreach (array_keys($plugin_arr) as $i) {
if ( $plugin_arr[$i]->getVar("topic_pid") == 0)
{
$module_name = $plugin_arr[$i]->getVar("plugin_name");
$table = $plugin_arr[$i]->getVar("plugin_mod_table");
$id_name = $plugin_arr[$i]->getVar("plugin_cat_id");
$pid = $plugin_arr[$i]->getVar("plugin_cat_pid");
$title = $plugin_arr[$i]->getVar("plugin_cat_name");
$url = $plugin_arr[$i]->getVar("plugin_call");
$order= $plugin_arr[$i]->getVar("plugin_weight");
$online = $plugin_arr[$i]->getVar("plugin_online");
if( $online == 1 ) {
$xsitemap = xsitemap_get_map ($table, $id_name, $pid, $title, $url, $order);
}
}
}
include_once XOOPS_ROOT_PATH."/footer.php";
?>
functions.php
<?php
/**
* ****************************************************************************
* Module généré par TDMCreate de la TDM "http://www.tdmxoops.net"
* ****************************************************************************
* xsitemap - MODULE FOR XOOPS AND IMPRESS CMS
* Copyright (c) Urbanspaceman (http://www.takeaweb.it)
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright Urbanspaceman (http://www.takeaweb.it)
* @license GPL
* @package xsitemap
* @author Urbanspaceman (http://www.takeaweb.it)
*
* Version : 1.00:
* ****************************************************************************
*/
//Show xsitemap
function xsitemap_get_map($table, $id_name, $pid, $title_name, $url, $order = ""){
global $sitemap_configs;
$xoopsDB =& Database::getInstance();
$xsitemap = array();
$myts =& MyTextSanitizer::getInstance();
$i = 0;
$sql = "SELECT `$id_name`,`$title_name` FROM ".$xoopsDB->prefix."_"."$table WHERE `$pid`= 0" ;
if ($order != '')
{
$sql .= " ORDER BY `$order`" ;
}
$result = $xoopsDB->query($sql);
while ($row = $xoopsDB->fetchArray($result)) {
$objsArray[] = new XoopsDummyObject($row, $id_name, $pid_name, $title_name);
}
$mytree = new XoopsObjectTree($objsArray, $id_name, $pid);
while (list($catid, $name) = $xoopsDB->fetchRow($result))
{
$xsitemap['parent'][$i]['id'] = $catid;
$xsitemap['parent'][$i]['title'] = $myts->htmlSpecialChars( $name ) ;
$xsitemap['parent'][$i]['url'] = $url.$catid;
//if($xsitemap_configs["show_subcategories"]){
$j = 0;
$child_array = $mytree->getAllChild($catid);
foreach ($child_array as $child)
{
//$count = strlen($child['prefix']) + 1;
$xsitemap['parent'][$i]['child'][$j]['id'] = $child[$id_name];
$xsitemap['parent'][$i]['child'][$j]['title'] = $myts->htmlSpecialChars( $child[$title_name] ) ;
//$xsitemap['parent'][$i]['child'][$j]['image'] = (($count > 3) ? 4 : $count);
$xsitemap['parent'][$i]['child'][$j]['url'] = $url.$child[$id_name];
$j++;
}
//}
$i++;
}
return $xsitemap;
}
?>
xsitemap_class.php
<?php
/**
* ****************************************************************************
* Module généré par TDMCreate de la TDM "http://www.tdmxoops.net"
* ****************************************************************************
* xsitemap - MODULE FOR XOOPS AND IMPRESS CMS
* Copyright (c) Urbanspaceman (http://www.takeaweb.it)
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright Urbanspaceman (http://www.takeaweb.it)
* @license GPL
* @package xsitemap
* @author Urbanspaceman (http://www.takeaweb.it)
*
* Version : 1.00:
* ****************************************************************************
*/
class XoopsDummyObject extends XoopsObject
{
/**
* constructor
*/
function XoopsDummyObject($row, $id_name = 'cid', $pid_name = 'pid', $title_name = 'title')
{
$this->XoopsObject();
$this->initVar($id_name, XOBJ_DTYPE_INT, $row[$id_name]);
$this->initVar($pid_name, XOBJ_DTYPE_INT, $row[$pid_name]);
$this->initVar($title_name, XOBJ_DTYPE_TXTBOX, $row[$title_name]);
}
}
?>