[其他] Emlog文章页增加上下篇功能,美化版教程

[复制链接]
admin 发表于 2020-9-6 19:03:15 | 显示全部楼层 |阅读模式

登录后,购买下载资源更方便!

您需要 登录 才可以下载或查看,没有账号?立即注册

×
一、Emlog添加上下篇功能教程
方法一
1、首先找到文章页模版,默认状态的路径 根目录/content/templates/模版文件夹名称/echo_log.php
2、打开该模版,并在需要显示上下篇的位置添加如下代码:
  1. <?php extract($neighborLog);if($prevLog){% X# W) I# ^4 C
  2. echo '<div id="prevlog"><a href="'.Url::log($prevLog['gid']).'" title="'.$prevLog['title'].'"></a></div>';}8 k& t+ P  O! u  V
  3. else{
    : [3 B7 @, h4 f( }
  4. echo '<div id="prevlog"><a href="#" title="没有上一篇了"></a></div>';};
    $ |( Z9 q/ q. B: c8 b& V
  5. if($nextLog){) H+ \( K( ^; _8 E4 ]6 E! s5 S
  6. 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
  7. else{
    + o& {" P- J1 p/ y
  8. 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样式
  1. <style>
    ( l$ R8 G; [1 P6 u: Y. k
  2. #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
  3. #prevlog a,#nextlog a{width:40px;height:80px;display:block;}
    + f1 s/ }, o2 e' E" g" K9 Q8 N
  4. #prevlog:hover,#nextlog:hover{filter:alpha(Opacity=100);-moz-opacity:1;opacity:1;}
    * m; c' \( t5 u' s% m
  5. #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
  6. *html #prevlog, *html #nextlog{position: absolute;top:expression(eval(document.documentElement.scrollTop));}
    ; c: a2 l! e$ A) {1 n
  7. </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/ ^
评论0

手机版|小黑屋|源码模版|全球支付|VISA信用卡|MASTER信用卡|科恒数字网-持续研发、集成、交付、运营方案资源库

GMT+8, 2026-7-17 22:43 , Processed in 0.048213 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.