天天看点

discuz sitemap.php,discuz制作门户的百度sitemap

思路:因为百度sitemap可以提交xml文件,可以利用discus内置的rss来实现。

实现方式如下:

首先找到根目录的:portal.php文件

打开后,找到这样一段话:

[代码]php代码:

if(empty($_GET[\'mod\']) || !in_array($_GET[\'mod\'], array(\'list\', \'view\', \'comment\', \'portalcp\', \'topic\', \'attachment\', \'rss\', \'block\'))) $_GET[\'mod\'] = \'index\';

将其修改为:

[代码]php代码:

if(empty($_GET[\'mod\']) || !in_array($_GET[\'mod\'], array(\'list\', \'view\', \'comment\', \'portalcp\', \'topic\', \'attachment\', \'rss\', \'block\', \'sitemap\'))) $_GET[\'mod\'] = \'index\';

然后进入目录:source/module/portal

找到文件:portal_rss.php

重新复制一份出来,命名为:portal_sitemap.php

打开portal_sitemap.php文件

找到内容:

[代码]php代码:

echo \"n\".

\"n\".

\" n\".

(count($catarray) > 1 ?

\" {$_G[setting][bbname]}n\".

\" {$_G[siteurl]}forum.phpn\".

\" Latest $num articles of all categoriesn\"

:

\" {$_G[setting][bbname]} - $catnamen\".

\" {$_G[siteurl]}portal.php?mod=list&catid=$rsscatidn\".

\" Latest $num articles of $catnamen\"

).

\" Copyright(C) {$_G[setting][bbname]}n\".

\" Discuz! Board by Comsenz Inc.n\".

\" \".gmdate(\'r\', TIMESTAMP).\"n\".

\" $ttln\".

\" n\".

\" {$_G[siteurl]}static/image/common/logo_88_31.gifn\".

\" {$_G[setting][bbname]}n\".

\" {$_G[siteurl]}n\".

\" n\";

将其修改为:

[代码]php代码:

echo \"n\".

\" n\";

找到内容:

[代码]php代码:

echo \" n\".

\" \".$article[\'subject\'].\"n\".

\" ...