登录后,购买下载资源更方便!
您需要 登录 才可以下载或查看,没有账号?立即注册
×
一、Emlog添加上下篇功能教程方法一 1、首先找到文章页模版,默认状态的路径 根目录/content/templates/模版文件夹名称/echo_log.php 2、打开该模版,并在需要显示上下篇的位置添加如下代码: - <?php extract($neighborLog);if($prevLog){
; W2 \' O0 z. ]. _) ]0 T - echo '<div id="prevlog"><a href="'.Url::log($prevLog['gid']).'" title="'.$prevLog['title'].'"></a></div>';}1 m/ o5 R: }4 k U0 J
- else{) u% G2 v/ W! N+ K3 r4 t5 B
- echo '<div id="prevlog"><a href="#" title="没有上一篇了"></a></div>';};
9 N$ F d+ V- H' _. _ - if($nextLog){
1 Q* |6 n& Y6 K7 p& U7 m - echo '<div id="nextlog"><a href="'.Url::log($nextLog['gid']).'" title="'.$nextLog['title'].'"></a></div>';}
/ ~5 ]" q: i4 ` b9 S* c - else{
+ M+ l4 } c7 l( x - echo '<div id="nextlog"><a href="#" title="没有下一篇了"></a></div>';};?>
复制代码& x& T7 i$ h5 x8 l9 r* w
方法二
( n7 z' ~; ^& Z% K方法二和方法一雷同 1、找到核心文件模版,默认状态的路径 根目录/content/templates/模版文件夹名称/module.php 2、添加方法一的php代码 3、在文章页模版,默认状态的路径 根目录/content/templates/模版文件夹名称/echo_log.php 添加调用函数即可 & E6 x ]5 B* b
二、Emlog上下篇功能美化教程在文章页模版,默认状态的路径 根目录/content/templates/模版文件夹名称/echo_log.php 添加如下css样式 - <style>
, l T8 ~) F+ e# \8 n- F" P - #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;}
& _; b$ Q2 h8 d - #prevlog a,#nextlog a{width:40px;height:80px;display:block;}
( Y' h% e% D- u# l- W - #prevlog:hover,#nextlog:hover{filter:alpha(Opacity=100);-moz-opacity:1;opacity:1;}# z) }( S: H" {* Y
- #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;}5 r6 S( K. S6 t! I6 u" p! K+ w
- *html #prevlog, *html #nextlog{position: absolute;top:expression(eval(document.documentElement.scrollTop));}9 }: |5 M, l7 I5 F1 ?/ S& r1 g
- </style>
复制代码 6 _" T, t9 I1 a" j
2 H1 f, S) [, b0 \- E5 M' t这里也可以把样式放在css文件里面,然后调用即可,具体的样式可以根据自己的网站主题模版进行微调。附上一张美化后的截图:
( i# o9 c# `1 L4 c. j, R. U9 y# ]+ u* U+ c
|