Modified is the/include/inc_sitemap.php file in the Dedecms directory
Copy Code code as follows:
<?php
Class SiteMap
//--------------------------------
Require_once (DirName (__file__). " /config_base.php ");
Require_once (DirName (__file__). " /inc_channel_unit_functions.php ");
Class SiteMap
{
var $dsql;
var $artDir;
var $baseDir;
//-------------
PHP5 constructors
//-------------
function __construct ()
{
$this->idcounter = 0;
$this->artdir = $GLOBALS [' Cfg_arcdir '];
$this->basedir = $GLOBALS [' Cfg_cmspath ']. $GLOBALS [' Cfg_basedir '];
$this->idarrary = "";
$this->dsql = new Dedesql (false);
}
function SiteMap ()
{
$this->__construct ();
}
//------------------
Cleaning class
//------------------
function Close ()
{
$this->dsql->close ();
}
//---------------------------
Get site Map
$maptype = "Site" or "RSS"
//---------------------------
function Getsitemap ($maptype = "Site")
{
$mapString = "<DL>";
if ($maptype = = "RSS") $this->dsql->setquery ("Select Id,typedir,isdefault,defaultname,typename,ispart, Namerule2 from #@__arctype where ishidden<>1 and Reid=0 and ispart<>2 order by Sortrank ");
else $this->dsql->setquery ("Select Id,typedir,isdefault,defaultname,typename,ispart,namerule2 from #@__ Arctype where reid=0 and ishidden<>1 order by Sortrank ");
$this->dsql->execute (0);
while ($row = $this->dsql->getobject (0))
{
if ($maptype = = "Site") $typelink = Gettypeurl ($row->id,mftypedir ($row->typedir), $row->isdefault, $row-> DefaultName, $row->ispart, $row->namerule2);
else $typelink = $GLOBALS [' Cfg_plus_dir ']. /rss/". $row->id.". XML ";
$mapString. = "<dl><dt><span><a href= ' $typelink ' >". $row->typename. " </a></span><a href= ' yun_qi_img/rss.gif ' > '. </a></dt>\r\n ";
$mapString. = $this->logiclistallsuntype ($row->id, $maptype, 0);
}
$mapString. = "";
return $mapString;
}
Recursive call to get subclass purpose
function Logiclistallsuntype ($ID, $maptype, $PD)
{
$fid = $ID;
$mapString = "";
$PD = $pd + 15;
if ($maptype = = "RSS") $this->dsql->setquery ("Select Id,typedir,isdefault,defaultname,typename,ispart, Namerule2 from #@__arctype where reid= ' ". $ID." ' and ishidden<>1 and ispart<>2 order by Sortrank ");
else $this->dsql->setquery ("Select Id,typedir,isdefault,defaultname,typename,ispart,namerule2 from #@__ Arctype where reid= ' ". $ID." ' and ishidden<>1 ORDER by Sortrank ");
$this->dsql->execute ($FID);
$mapString. = "";
while ($row = $this->dsql->getobject ($fid))
{
if ($maptype = = "Site") $typelink = Gettypeurl ($row->id,mftypedir ($row->typedir), $row->isdefault, $row-> DefaultName, $row->ispart, $row->namerule2);
else $typelink = $GLOBALS [' Cfg_plus_dir ']. /rss/". $row->id.". XML ";
$lastLink = "<dd><a href= ' $typelink ' >". $row->typename. " </a></DD> ";
$mapString. = $lastLink;
$mok = $this->logiclistallsuntype ($row->id, $maptype, $pd);
if (Ereg ("<a", $mok)) {
$mapString = Str_replace ($lastLink, "<div style= ' margin-left:{$pd}px ' > $lastLink", $mapString);
$mapString. = $mok;
}
}
$mapString. = "</dl>\r\n";
return $mapString;
}
}
?>