为了方便搜索引擎收录dokuwiki的文章,我写了个dokuwiki所有文章的索引页
例子见http://wiki.dbaman.cn/docs/php/dokuwiki_index
<?php
/**
* dokuwiki 所有主题列表
* all Subject List of dokuwiki
*
* @author 流水孟春 <cmpan(at)qq.com>
* @version 20090322
* @link http://wiki.dbaman.cn/docs/php/dokuwiki_index
*/
function myDir($dir = 'data/pages/') {
$dir = rtrim(str_replace('\\', '/', $dir), '/ ') . '/';
static $links;
$d = dir($dir);
print "\r\n<ul>\r\n";
while (false !== ($entry = $d->read())) {
if($entry[0] != '.') {
if(is_dir($dir . $entry)) {
print "<li class='dir'><a href='" . str_replace('data/pages/', '', $dir . $entry)
. "/' target='_blank'><b>" . urldecode($entry) . "</a></b></li>\r\n";
myDir($dir . $entry);
} else {
$entry = str_replace('.txt', '', $entry);
print "<li class='link'><a href='". str_replace('data/pages/', '', $dir . $entry)
."' target='_blank'>" . urldecode($entry) . "</a></li>\r\n";
}
}
}
$d->close();
print "</ul>\r\n\r\n";
}
// config
$tmp = 'data/tmp/map.tmp.html';
$debug = 0;
$cacheT = 3600; // s
$id = 'meng123.';
// logic
if((!$debug && is_file($tmp) && (time() - filemtime($tmp) < $cacheT))
&& (empty($_GET['id']) || $_GET['id'] != $id)) {
print "<!-- from cache-->\r\n";
print file_get_contents($tmp);
exit;
}
ob_start();
// html ------------------------------------------------------------------------
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh" lang="zh" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> 主题列表(Subject List) </title>
<style type="text/css">
.dir a{color:black;}
.link a {color: blue;}
</style>
</head>
<body>
<div> <a href=./>返回首页(Home Page)</a> <HR> </div>
<dir><b><h3>主题列表(Subject List)</h3></b></div>
<?php myDir(); ?>
<div> <HR> <a href=./>返回首页(Home Page)</a> </div>
</body>
</html>
<?php
// end html ------------------------------------------------------------------------
file_put_contents($tmp, ob_get_contents());
ob_flush();
?>
分享到:
相关推荐
4. **文件结构**:在提供的压缩包文件中,我们可以看到一些核心的DokuWiki组件,如`install.php`用于安装,`doku.php`是DokuWiki的主要入口点,`index.php`可能是网站的主页,`conf`目录包含了配置文件。这些文件...
这些文件包括COPYING(许可证文件)、.htaccess.dist(用于设置Apache服务器的访问控制)、install.php(安装脚本)、feed.php(RSS/Atom feed生成器)、doku.php(DokuWiki的主要入口点)、index.php(首页定义)、...
通过以上步骤,您已经成功地在Windows环境下安装并配置了Apache、PHP以及DokuWiki。这不仅为个人项目提供了稳定的开发环境,也为团队协作提供了有力的支持。希望本指南能帮助您顺利完成安装过程。如果您在安装过程中...
从http://ckasj.vicp.net/dokuwiki/doku.php/spservice:00_index下载的,反编译的源码,已经把反编译的错误给修改了。 与http://download.csdn.net/source/1429824搭配使用。
从http://ckasj.vicp.net/dokuwiki/doku.php/spservice:00_index下载的,反编译的源码,已经把反编译的错误给修改了。 与http://download.csdn.net/source/1433450搭配使用。 spservice是一个基于短信应用的SP服务...
{name: 'name', index: 'name', width: 100}, {name: 'age', index: 'age', width: 60} ], pager: '#pager', rowNum: 10, // 每页显示的记录数 rowList: [10, 20, 30], sortname: 'id', sortorder: 'asc' }...
2. 非官方维基:http://kerkness.ca/wiki/doku.php 尽管这个维基基于较旧的 3.0 版本,但它提供了丰富的示例和实践指导,对于理解原理非常有帮助。 通过深入研究这些文档,结合实际项目中的应用,你将能够灵活地...
对于初学者来说,查阅JqGrid的官方文档(http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jqgriddocs)和演示(http://trirand.com/blog/jqgrid/jqgrid.html#t107)是非常有帮助的。文档详细解释了各种选项和...