用sablog的朋友请注意了.学习笔记
March,27

经过Tension提醒.

如果你使用sablog-x 1.6的伪静态,发现有部分URL无法静态的.
请修改 include/func_rewrite.php 文件.

修改后的func_rewrite.php源码.(红色字为多加部分)

<?php
// ========================== 文件说明 ==========================//
// 本文件说明:自动分析替换模板里的URL
// --------------------------------------------------------------//
// 本程序作者:angel
// --------------------------------------------------------------//
// 本程序版本:SaBlog-X Ver 1.6
// --------------------------------------------------------------//
// 本程序主页:http://www.sablog.net
// ========================== 开发环境 ==========================//
// register_globals = Off
// --------------------------------------------------------------//
// magic_quotes_gpc = On
// --------------------------------------------------------------//
// safe_mode = On
// --------------------------------------------------------------//
// Windows server 2003 & Linux & FreeBSD
// --------------------------------------------------------------//
// Apache/1.3.33 & PHP/4.3.2 & MySQL/4.0.17
// --------------------------------------------------------------//
// Apache/1.3.34 & PHP/4.4.1 & MySQL/5.0.16
// --------------------------------------------------------------//
// Apache/2.0.55 & PHP/5.1.1 & MySQL/5.0.15
// --------------------------------------------------------------//
// Copyright (C) Security Angel Team All Rights Reserved.
// ==============================================================//

if(!defined('SABLOG_ROOT')) {
        exit('Access Denied');
}

//转换分类的连接
function rewrite_category($head, $cid, $page = 1, $class = '') {
        global $options;
        !$page && $page = 1;
        return '<a href="'.$head.'category-'.$cid.'-'.$page.'.'.$options['rewrite_ext'].'"'.($class ? ' class="'.$class.'"' : '').'"'.($title ? ' title="'.$title.'"' : '').'>';
}

//转换归档的连接
function rewrite_archives($head, $date, $page = 1, $class = '') {
        global $options;
        !$page && $page = 1;
        return '<a href="'.$head.'archives-'.$date.'-'.$page.'.'.$options['rewrite_ext'].'"'.($class ? ' class="'.$class.'"' : '').'"'.($title ? ' title="'.$title.'"' : '').'>';
}

//转换文章的连接
function rewrite_show($head, $id, $page = 1, $extra = '', $class = '') {
        global $options;
        !$page && $page = 1;
        return '<a href="'.$head.'show-'.$id.'-'.$page.'.'.$options['rewrite_ext'].($extra ? '#'.$extra : '').'"'.($class ? ' class="'.$class.'"' : '').'"'.($title ? ' title="'.$title.'"' : '').'>';
}

//转换其他页面的连接
function rewrite_page($head, $action, $page = 1, $class = '') {
        global $options;
        !$page && $page = 1;
        if (in_array($action,array('search','archives','reg','login','links'))) {
                $pagelink = '';
        } else {
                $pagelink = '-'.$page;
        }
        return '<a href="'.$head.$action.$pagelink.'.'.$options['rewrite_ext'].'"'.($class ? ' class="'.$class.'"' : '').'"'.($title ? ' title="'.$title.'"' : '').'>';
}

?>

修改后的文件下载.(如果你的 include/func_rewrite.php 文件没有修改过.直接覆盖就好)

func_rewrite.rar

« 上一篇 | 下一篇 »

RSS订阅

抓虾 pageflakes Rojo 狗狗
google reader bloglines my yahoo newsgator
netvibes 鲜果 哪吒 有道

2条记录访客评论

想和你交换个连接,贵站的博客连接已经做好了。http://www.hejianba.com/这个我的博客地址:

Post by hejianba on 2008, March 27, 2:28 PM #1

已经完成了.

Post by GoL on 2008, March 27, 5:19 PM #2


发表评论

Your comments:

    Blog info.
  • Articles:214 | Comments:553
  • Blog users:14 | All Tags:479
  • Today Views:533 | All Views:141426
  • Style by Gol. Powered by SaBlog-X.