登录后,购买下载资源更方便!
您需要 登录 才可以下载或查看,没有账号?立即注册
×
一、Emlog添加上下篇功能教程方法一 1、首先找到文章页模版,默认状态的路径 根目录/content/templates/模版文件夹名称/echo_log.php 2、打开该模版,并在需要显示上下篇的位置添加如下代码: - <?php extract($neighborLog);if($prevLog){% X# W) I# ^4 C
- echo '<div id="prevlog"><a href="'.Url::log($prevLog['gid']).'" title="'.$prevLog['title'].'"></a></div>';}8 k& t+ P O! u V
- else{
: [3 B7 @, h4 f( } - echo '<div id="prevlog"><a href="#" title="没有上一篇了"></a></div>';};
$ |( Z9 q/ q. B: c8 b& V - if($nextLog){) H+ \( K( ^; _8 E4 ]6 E! s5 S
- echo '<div id="nextlog"><a href="'.Url::log($nextLog['gid']).'" title="'.$nextLog['title'].'"></a></div>';}
6 \6 O- y O0 |1 P1 q/ C1 Q - else{
+ o& {" P- J1 p/ y - echo '<div id="nextlog"><a href="#" title="没有下一篇了"></a></div>';};?>
复制代码 B2 e6 a$ x+ _2 V9 M9 G
方法二
9 d( r; r9 M6 A- f方法二和方法一雷同 1、找到核心文件模版,默认状态的路径 根目录/content/templates/模版文件夹名称/module.php 2、添加方法一的php代码 3、在文章页模版,默认状态的路径 根目录/content/templates/模版文件夹名称/echo_log.php 添加调用函数即可 0 `' w8 @5 z" }2 T
二、Emlog上下篇功能美化教程在文章页模版,默认状态的路径 根目录/content/templates/模版文件夹名称/echo_log.php 添加如下css样式 - <style>
( l$ R8 G; [1 P6 u: Y. k - #prevlog{width:40px;height:80px;background:url(http://img.itc.cn/photo/olZ77IqbZHL) no-repeat; position:fixed;left:50%;top:380px;margin-left:-530px;filter:alpha(Opacity=60);-moz-opacity:0.6;opacity:0.6;z-index:9999;}/ ]% O8 F- O6 g5 \+ w4 T- k- Q# B
- #prevlog a,#nextlog a{width:40px;height:80px;display:block;}
+ f1 s/ }, o2 e' E" g" K9 Q8 N - #prevlog:hover,#nextlog:hover{filter:alpha(Opacity=100);-moz-opacity:1;opacity:1;}
* m; c' \( t5 u' s% m - #nextlog{width:40px;height:80px;background:url(http://img.itc.cn/photo/olZ77phsS28) no-repeat; position:fixed;left:50%;top:380px;margin-left:490px;filter:alpha(Opacity=60);-moz-opacity:0.6;opacity:0.6;z-index:9999;}
% u" a/ P$ R& \% v8 L$ C - *html #prevlog, *html #nextlog{position: absolute;top:expression(eval(document.documentElement.scrollTop));}
; c: a2 l! e$ A) {1 n - </style>
复制代码
/ J. l9 J/ V: o5 J+ d7 Y9 n- |/ Q x+ _& U. f
这里也可以把样式放在css文件里面,然后调用即可,具体的样式可以根据自己的网站主题模版进行微调。附上一张美化后的截图: % j! J- a. a# E3 H* _- n7 U
5 }) N7 d- \6 w" q4 W& S/ ^
|