为织梦自带图集功能增加上一页下一页链接
有些朋友说因为要用到图集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)
推荐栏目
本站推荐
- 修改DEDE链接中的单引号为双引号
- DEDECMS启用绝对路径后远程缩略图存BUG
- 织梦dedecms自由列表的"不使用目录默认
- dedecms把文章批量设为未审核的办法
- 织梦调用父级栏目链接和名称
- 织梦data文件夹移动到程序上一层目录
- 优化增加搜索栏目功能后的搜索结果
- 织梦同级栏目指定文章调用实现相关文章教
- 织梦获取顶级栏目\当前栏目\上级栏目的相
- 织梦dedecms栏目添加自定义字段,增加栏
- 织梦DedeCMS自增函数[field:global name=
- dedecms织梦上传图片 缩略图路径统一
- 新增DEDE栏目页,无法更新,无权限
- 修改织梦摘要长度字数限制
- DEDECMS后台批量替换数据安全码不显示
- 织梦DEDECMS网站标签Tag静态化,生成静态
- 去掉FCK编辑器复制粘贴产生的<p>&a
- 完美解决FCK编辑器上传图片自动带DIV标签
- 去掉FCK编辑器每一段之前的空格 
- 织梦登录后台显示空白
百度站内搜索
Copyright © 2007-2014 芒果 保留所有权利.
无心无力无时间来进行无用的备案
Theme by 芒果 坚持不一定胜利 也许你在南辕北辙!



![织梦DedeCMS自增函数[field:global name=/]用法示例](http://www.muou.cc/uploads/allimg/170108/1-1F10R12922538-lp.jpg)
