登录后,购买下载资源更方便!
您需要 登录 才可以下载或查看,没有账号?立即注册
×
一、Emlog添加上下篇功能教程方法一 1、首先找到文章页模版,默认状态的路径 根目录/content/templates/模版文件夹名称/echo_log.php 2、打开该模版,并在需要显示上下篇的位置添加如下代码: - <?php extract($neighborLog);if($prevLog){: H w2 f+ t3 l! ]
- echo '<div id="prevlog"><a href="'.Url::log($prevLog['gid']).'" title="'.$prevLog['title'].'"></a></div>';}$ O& X+ z# Z1 q! x
- else{
/ { Z, }9 a; S4 a# [8 {) V$ M - echo '<div id="prevlog"><a href="#" title="没有上一篇了"></a></div>';};
6 `. ]* Z4 H1 G1 K% Y8 G1 J; w. z - if($nextLog){0 S6 t% L1 y# `
- echo '<div id="nextlog"><a href="'.Url::log($nextLog['gid']).'" title="'.$nextLog['title'].'"></a></div>';}
# y6 N$ H& L. r - else{& v- d5 X7 A- m6 b4 v. b
- echo '<div id="nextlog"><a href="#" title="没有下一篇了"></a></div>';};?>
复制代码, |3 o* p' \5 {" @! N9 T
方法二
; j6 F4 q( j& o方法二和方法一雷同 1、找到核心文件模版,默认状态的路径 根目录/content/templates/模版文件夹名称/module.php 2、添加方法一的php代码 3、在文章页模版,默认状态的路径 根目录/content/templates/模版文件夹名称/echo_log.php 添加调用函数即可 , ?0 }. @; B& Q2 H
二、Emlog上下篇功能美化教程在文章页模版,默认状态的路径 根目录/content/templates/模版文件夹名称/echo_log.php 添加如下css样式 - <style>
' T- c2 E8 U' Y2 N$ |' ? I5 j - #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;}: X1 i& f# v0 o* [. s% J& v
- #prevlog a,#nextlog a{width:40px;height:80px;display:block;}
( ~6 P P) G9 O - #prevlog:hover,#nextlog:hover{filter:alpha(Opacity=100);-moz-opacity:1;opacity:1;}
/ I( j+ J3 C2 P8 X' f% k6 N - #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;}" b7 W& W! B* t4 t
- *html #prevlog, *html #nextlog{position: absolute;top:expression(eval(document.documentElement.scrollTop));}
* ?. m' c) R6 Z3 N - </style>
复制代码 1 ]5 ^# J+ c' d4 c/ {/ k# M O
a! f/ f- ~1 M$ D! g这里也可以把样式放在css文件里面,然后调用即可,具体的样式可以根据自己的网站主题模版进行微调。附上一张美化后的截图:
4 W' O" w8 z) L+ h8 N. o" s. Q- P$ y/ C' o" I) C0 m7 e
|