dicuzs 生成html的代码

浏览帖子生成html
---------------------------------------------------------------------------------------------------
打开viewthread.php,找:
CODE:[Copy to clipboard]define('CUR', 'viewthread');
在下面添加:
CODE:[Copy to clipboard]ob_start();
找:
CODE:[Copy to clipboard]include template('viewthread');
在下面添加:
CODE:[Copy to clipboard]        $cache = './thread-' . $thread['tid'] . '-' . $page . '.htm';
       @unlink($cache);
       $file = ob_get_contents();
       ob_end_clean();
       $fp = @fopen($cache, 'w');
       if($fp) {
            fwrite($fp, $file);
            fclose($fp);
            header('location: ' . $cache);
       }
---------------------------------------------------------------------------------------------------
浏览主题列表生成html
---------------------------------------------------------------------------------------------------
打开forumdisplay.php,找:
CODE:[Copy to clipboard]define('CUR', 'forumdisplay');
在下面添加:
CODE:[Copy to clipboard]ob_start();
找:
CODE:[Copy to clipboard]include template('forumdisplay');
在下面添加:
CODE:[Copy to clipboard]$cache = './fid-' . $forum['fid'] . '-' . $page . '.htm';
@unlink($cache);
$file = ob_get_contents();
ob_end_clean();
$fp = @fopen($cache, 'w');
if($fp) {
       fwrite($fp, $file);
       fclose($fp);
       header('location: ' . $cache);
}
---------------------------------------------------------------------------------------------------
自动删除临时文件
---------------------------------------------------------------------------------------------------
打开post.php,找:
CODE:[Copy to clipboard]?>
在上面添加:
CODE:[Copy to clipboard]$cache1 = './fid-' . $forum['fid'] . '-' . $page . '.htm';
$cache2 = './thread-' . $thread['tid'] . '-' . $page . '.htm';
@unlink($cache1);
@unlink($cache2);
---------------------------------------------------------------------------------------------------
论坛主页生成html
---------------------------------------------------------------------------------------------------
打开index.php,找:
CODE:[Copy to clipboard]define('CUR', 'index');
在下面加:
CODE:[Copy to clipboard]ob_start();
找:
CODE:[Copy to clipboard]include template('index');
在下面添加:
CODE:[Copy to clipboard]$cache = 'index.htm';
@unlink($cache);
$file = ob_get_contents();
ob_end_clean();
$fp = @fopen($cache, 'w');
if($fp) {
       fwrite($fp, $file);
       fclose($fp);
       header('location: ' . $cache);

posted @ 2010-01-05 04:33  真功夫  阅读(260)  评论(0编辑  收藏  举报