为织梦自带图集功能增加上一页下一页链接

时间:2014-09-27 11:34 / 来源:未知 / 作者:酱油 / 点击:

有些朋友说因为要用到图集photoshow模板,想实现下面的效果。

1:当前是第X页 2:增加上一页下一页的功能。

我现在就把5.7版本photoshow的原始代码和实现上图效果的代码都粘贴出来,方便大家比较。

原始代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>" />
<title><?php echo $arctitle; ?></title>
<link href="<?php echo $cfg_templets_skin; ?>/style/search.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
 
<div class="header">
    <div class="top">
        <h1><a href="<?php echo $cfg_basehost;?>" title="<?php echo $cfg_webname;?>"><img src="<?php echo $cfg_templets_skin; ?>/images/logo.gif"  alt=""/></a> </h1>
    </div>
</div>
 
<div class="msgbar">
    <p>
        <strong><b>图集详细页面 >> <a href='<?php echo $arcurl?>'><?php echo $arctitle; ?></a></b></strong>
    </p>
</div>
 
 
<table width='100%' border='0' cellpadding='2' cellspacing='1' >
           <tr>
             <td align='center' >
             <a href='<?php echo $nextlink; ?>'><br />
             <img src='<?php echo $src?>' border='0' /></a><br />
             <div style='line-height:32px;'>
             <a href="<?php echo $src; ?>" target='_blank'>[查看原图]</a>
             </div>
             <div style='line-height:32px;border-top:1px dashed #BED6A7'>
                     <?php echo $pageGuide?>
                        </div>
                </td>
           </tr>
</table>
 
 
</body>
</html>

实现上图效果的代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><?php echo $arctitle?>详细页面 第<?php echo $npos+1?>张</title>
<style>
body{font-size:14px; text-align:center; margin-top:5px; background:#FFFAF0;font-family:"Verdana,Sans-Serif,Arial";font-family:"Microsoft YaHei";}
img{border:0; margin:10px}
a:link,a:visited{color:#000; text-decoration:none;}
a:hover{color:#900;}
.picview{border:1px solid #730; padding:10px; width:850px; margin:10px auto;}
.picview img{ max-width:800px}
.guide{margin:10px;}
.guide a{color:#06c;}
h1{font-size:16px;}
.tishi{ color:#FF0000; font-size:12px; line-height:26px; height:26px;}
</style>
</head>
<body>
<div class="picview">
  <h1><a href="<?php echo $arcurl?>"><?php echo $arctitle?></a></h1>
  第<?php echo $npos+1?>张<br />
  <div class="tishi">提示:点击图片进入下一张</div>
  <a href="<?php echo $nextlink?>"><img src="<?php echo $src?>" border="0" alt="<?php echo $alt?>"/></a><br />
  <div class="guide"><?php echo $pageGuide?></div>
</div>
<br />
返回<a href="http://www.baidu.com"><strong>百度</strong></a>首页
</body>
</html>

综合对比,我们可以看出 当前第几张的代码就是<?phpecho $npos+1?>,而上一页下一页的代码就是<?phpecho $pageGuide?>

(模板文件路径:/templets/plus/showphoto.htm)

猜你喜欢

推荐栏目

DEDECMS
DEDECMS

DEDE使用经验和技巧

WordPress
Wordpress

WP使用经验和技巧

Zblog
Zblog

Zblog使用经验和技巧

CSS
CSS

CSS使用经验和技巧

网络资料
网络资料

转载实用网络资料

按键伤人
按键伤人

转载乱七八糟的网络资源

我是酱油
我是酱油

随笔札记 记录生活点滴

本站推荐

百度站内搜索

专业博客主机