The/include/inc_sitemap.php file in the dedecms directory is modified.
CopyCode The Code is 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 Constructor
//-------------
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 ();
}
//------------------
// Cleanup class
//------------------
Function close ()
{
$ This-> dsql-> close ();
}
//---------------------------
// Obtain the website 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 = 'HTTP: // www.yuanma51.com/plus/rssmap.html'> ". "</a> </DT> \ r \ n ";
$ Mapstring. = $ this-> logiclistallsuntype ($ row-> ID, $ maptype, 0 );
}
$ Mapstring. = "";
Return $ mapstring;
}
// Obtain recursive calls for sub-classes
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;
}
}
?>