登录后,购买下载资源更方便!
您需要 登录 才可以下载或查看,没有账号?立即注册
×
一、Emlog添加上下篇功能教程方法一 1、首先找到文章页模版,默认状态的路径 根目录/content/templates/模版文件夹名称/echo_log.php 2、打开该模版,并在需要显示上下篇的位置添加如下代码: - <?php extract($neighborLog);if($prevLog){1 Q" g( K& K, }* ]
- echo '<div id="prevlog"><a href="'.Url::log($prevLog['gid']).'" title="'.$prevLog['title'].'"></a></div>';}4 \0 u; r5 x% t% h! |
- else{* U: X6 V, \* D3 `. o( Q
- echo '<div id="prevlog"><a href="#" title="没有上一篇了"></a></div>';};3 ~% g* M! |+ X( `, D
- if($nextLog){
& O, W% V) w2 `! r( O' F - echo '<div id="nextlog"><a href="'.Url::log($nextLog['gid']).'" title="'.$nextLog['title'].'"></a></div>';}
9 V! C H4 D. h: W% }6 e - else{( P: K" C. u( V+ n' H
- echo '<div id="nextlog"><a href="#" title="没有下一篇了"></a></div>';};?>
复制代码% ? h$ x, l1 P/ T
方法二4 V- m( F6 b% ]6 J7 c0 Q$ u
方法二和方法一雷同 1、找到核心文件模版,默认状态的路径 根目录/content/templates/模版文件夹名称/module.php 2、添加方法一的php代码 3、在文章页模版,默认状态的路径 根目录/content/templates/模版文件夹名称/echo_log.php 添加调用函数即可
7 R% J- I. J+ J) F8 t+ z' N2 |, J二、Emlog上下篇功能美化教程在文章页模版,默认状态的路径 根目录/content/templates/模版文件夹名称/echo_log.php 添加如下css样式 - <style>% \6 k7 M1 L# B4 M
- #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;}6 K9 ?9 T' Q% S# k J. m+ n
- #prevlog a,#nextlog a{width:40px;height:80px;display:block;}# l3 n) v2 S. g, ] v9 _
- #prevlog:hover,#nextlog:hover{filter:alpha(Opacity=100);-moz-opacity:1;opacity:1;}( T) d- \9 q( W" u/ r7 N" [$ ]( R
- #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;}
1 K% w( N" {) q; f - *html #prevlog, *html #nextlog{position: absolute;top:expression(eval(document.documentElement.scrollTop));}" D& A- y+ ~) x, g. B# O! x8 o% ?
- </style>
复制代码
( `, y+ Q4 h; E5 l1 d6 o) Y: U8 a3 C6 _4 J n# D4 r$ T
这里也可以把样式放在css文件里面,然后调用即可,具体的样式可以根据自己的网站主题模版进行微调。附上一张美化后的截图: 5 n5 s+ \5 Z0 V+ f: N/ L& A
O7 p% z" K, |, _3 S
|