我的博客刚刚升级为最新版了,因为有很多网友也提出类似的问题就是程序升级了,但是模板如何升级?以后只要时间允许,我将持续为大家更新,我的查找方法并不先进,只要一款代码对比软件即可完成。以下是5.3.1版本重模板需要更新的内容.
2 b: R9 }' n* @8 i- L本次更新,只涉及两个模板文件:modul.php和side.php:
( o& U% n$ q8 |. _8 K* Q1 X1、在modul.php中查找如下代码:
- s3 T# ~: Z7 a, `/ t- k- <?php1 c+ I! `. A+ P" }; @9 a- u
- //widget:分类
_ p8 Z! \9 z3 w - function widget_sort($title){$ Z- o6 q, |' g+ {6 L
- global $CACHE;* h7 k5 C; N l5 B7 [" x2 C
- $sort_cache = $CACHE->readCache('sort'); ?>9 @+ e3 R! C L# Q: |
- <li>3 ^- f u; ?+ Z$ Y
- <h3><span><?php echo $title; ?></span></h3>& ?! j* x0 z6 p
- <ul id="blogsort">& ^( ]- F3 n1 R! s
- <?php
0 ?) w) j: U3 {( m7 g7 M# ` - foreach($sort_cache as $value):: r$ E9 B3 Y; _1 l& q$ g$ p
- if ($value['pid'] != 0) continue;
+ n& e, w5 Q) h - ?>
; F7 Z# ?& G0 s: N4 _* @ - <li>$ O, |1 B$ A& Z9 {
- <a href="<?php echo Url::sort($value['sid']); ?>"><?php echo $value['sortname']; ?>(<?php echo $value['lognum'] ?>)</a>
+ D) U( M- B& X/ o t+ z - <?php if (!empty($value['children'])): ?>
# q" g5 w, I3 m u* u* c9 f" c - <ul>' {" R# ~: o% D7 f# E( [+ |. S4 t
- <?php
% M7 i. h) ^# x) A/ C - $children = $value['children'];
9 C9 Y1 Z3 A# O6 x9 t - foreach ($children as $key):8 F, H* ]1 X: Z
- $value = $sort_cache[$key];
3 |9 T* a' ]' [) Y9 | - ?>; D7 t! B0 U" _) y
- <li>
7 J b' l$ `! l w( M l7 G - <a href="<?php echo Url::sort($value['sid']); ?>"><?php echo $value['sortname']; ?>(<?php echo $value['lognum'] ?>)</a>: h8 T: N! D% r
- </li>
5 N) I$ K. r! h: R* K$ f- N - <?php endforeach; ?>+ m& F" t7 \0 a- Z2 E% b, E
- </ul>
- @5 v: F. C G: a& I! W+ G1 n - </li>
' @! D+ |( t1 ?. r% G/ B' K0 d3 A - <?php endif; ?>! y# z+ d) `( ^. Q
- <?php endforeach; ?>
) O2 W& t0 c7 V/ X1 v% ] - </ul>
1 E: N. k# f; C - </li>
+ Y- l' M5 Z7 w0 t- m1 C% ? - <?php }?>
复制代码 将其替换为:- <?php5 K* F7 f/ k9 p. e8 j8 p
- //widget:分类
0 e5 c4 I* }! A( a1 K2 U7 E - function widget_sort($title){
$ g7 E5 @$ u/ c; g' N; r - global $CACHE;
4 L/ B6 p% {( Z3 Y* M - $sort_cache = $CACHE->readCache('sort'); ?>: p2 @7 O7 c2 B$ i
- <li>" U: g! n9 C4 C) K8 I, E
- <h3><span><?php echo $title; ?></span></h3>
1 t1 G d3 l' s( S: C0 M; P - <ul id="blogsort">* l: h* x) ^% J3 n& k
- <?php
p: R% ^% ?( b6 g& O) s - foreach($sort_cache as $value):
9 T Y7 T) Q& D/ D. ] - if ($value['pid'] != 0) continue;3 m8 l7 f/ R- n8 J8 [+ y9 O# I
- ?>
; c/ p Y$ }: t3 E- f - <li>
6 R1 G4 j7 D; R6 r% F) T) [ - <a href="<?php echo Url::sort($value['sid']); ?>"><?php echo $value['sortname']; ?>(<?php echo $value['lognum'] ?>)</a>
% y0 [ I9 M) B$ B `5 i( a3 t - <?php if (!empty($value['children'])): ?>
2 ]/ `. D" Z5 o8 h/ S, v( U1 \ - <ul>& {2 \: Z- J& t- |; T& _2 k
- <?php& z6 `7 p4 O) Z7 O3 X5 _$ R
- $children = $value['children'];
/ ^* c4 |( ~" w5 M* m - foreach ($children as $key):
7 V' c! k$ ~& n9 v( n - $value = $sort_cache[$key];, Y9 C. ?+ u6 s8 ^% m1 n1 w
- ?>
0 W- Z+ f( v) d! a" g8 Q! S. O S - <li>
' Q' G/ f% T+ \1 r6 P5 O- J - <a href="<?php echo Url::sort($value['sid']); ?>"><?php echo $value['sortname']; ?>(<?php echo $value['lognum'] ?>)</a>
8 f, _+ ?# \5 q7 t - </li>
4 c _+ S! }' Z: Y( y! Q - <?php endforeach; ?>6 Y. h8 D$ b$ O5 N
- </ul>
0 t3 [3 b6 G$ F6 B5 u0 w - <?php endif; ?>5 `0 g1 d! }2 j& y& L5 V8 o6 ?
- </li>
\% ~/ s4 G2 V' g$ Y9 ` - <?php endforeach; ?>
, g& V& U. c4 ]8 @3 l - </ul>/ `7 K2 r2 ^: W2 s
- </li>
. z2 g. j* ]4 n* A9 l - <?php }?>
) k) J8 ~, R& Z' H6 r$ l: {4 \ - 复制代码
复制代码 2、在side.php文件中查找- <?php if (Option::get('rss_output_num')):?>" G0 I6 N/ c9 N
- <div class="rss">( Z q) U0 ]8 i7 ?
- <a href="<?php echo BLOG_URL; ?>rss.php" title="RSS订阅"><img src="<?php echo TEMPLATE_URL; ?>images/rss.gif" alt="订阅Rss"/></a>
7 a. ^0 D1 I) J* o4 d, x+ T- p - </div># F1 y. i2 ?/ ?7 P$ \" C
- <?php endif;?>
复制代码 将其替换为:- <?php if (Option::get('rss_output_num')):?>
/ I4 g9 r$ O- l; S( w3 z7 T1 O7 ? - <li style="padding-left:0;background:none;">5 ?& I. p( B! r# s' @( b7 }+ t$ N
- <div class="rss">$ D- U* `' N' J6 x, f9 c: E
- <a href="<?php echo BLOG_URL; ?>rss.php" title="RSS订阅"><img src="<?php echo TEMPLATE_URL; ?>images/rss.gif" alt="订阅Rss"/></a>
/ f0 K, |* Y5 o" p" D( E: D$ |3 j - </div>
$ F3 W5 i/ a% T/ u, o! Z7 e9 ` - </li>
`& T) d B3 A# { P0 y/ K - <?php endif;?>
复制代码 就是这样简单,完成后,更新下缓存就可以了!再次说明本次模板更新只适用于5.3.0的模板升级! |