//打开系统文件织梦 /include/arc.archives.class.php 找到GetPreNext函数
 function GetPreNext($gtype='')
{
$rs = '';
if(count($this->PreNext)<2)
{
$aid = $this->ArcID;
$preR = $this->dsql->GetOne("Select id From `#@__arctiny` where id<$aid And arcrank>-1 And typeid='{$this->Fields['typeid']}' order by id desc");
$nextR = $this->dsql->GetOne("Select id From `#@__arctiny` where id>$aid And arcrank>-1 And typeid='{$this->Fields['typeid']}' order by id asc");
$next = (is_array($nextR) ? " where arc.id={$nextR['id']} " : ' where 1>2 ');
$pre = (is_array($preR) ? " where arc.id={$preR['id']} " : ' where 1>2 ');
$query = "Select arc.id,arc.title,arc.shorttitle,arc.typeid,arc.ismake,arc.senddate,arc.arcrank,arc.money,arc.filename,arc.litpic,
t.typedir,t.typename,t.namerule,t.namerule2,t.ispart,t.moresite,t.siteurl,t.sitepath
from `#@__archives` arc left join #@__arctype t on arc.typeid=t.id ";
$nextRow = $this->dsql->GetOne($query.$next);
$preRow = $this->dsql->GetOne($query.$pre);
if(is_array($preRow))
{
$mlink = GetFileUrl($preRow['id'],$preRow['typeid'],$preRow['senddate'],$preRow['title'],$preRow['ismake'],$preRow['arcrank'],
$preRow['namerule'],$preRow['typedir'],$preRow['money'],$preRow['filename'],$preRow['moresite'],$preRow['siteurl'],$preRow['sitepath']);
$this->PreNext['pre'] = "上一篇:<a href='$mlink'>{$preRow['title']}</a> ";
$this->PreNext['preurl']=$mlink;
$this->PreNext['preimg'] = "<a href='$mlink'><img src=\"{$preRow['litpic']}\" alt=\"{$preRow['title']}\"/></a> ";
}
else
{
$this->PreNext['pre'] = "上一篇:没有了 ";
$this->PreNext['preurl'] = "javascript:void:";
$this->PreNext['preimg'] ="<img src=\"/templets/default/images/nophoto.jpg\" alt=\"对不起,没有上一图集了。\"/>";
}
if(is_array($nextRow))
{
$mlink = GetFileUrl($nextRow['id'],$nextRow['typeid'],$nextRow['senddate'],$nextRow['title'],$nextRow['ismake'],$nextRow['arcrank'],
$nextRow['namerule'],$nextRow['typedir'],$nextRow['money'],$nextRow['filename'],$nextRow['moresite'],$nextRow['siteurl'],$nextRow['sitepath']);
$this->PreNext['next'] = "下一篇:<a href='$mlink'>{$nextRow['title']}</a> ";
$this->PreNext['nexturl']=$mlink;
$this->PreNext['nextimg'] = "<a href='$mlink'><img src=\"{$nextRow['litpic']}\" alt=\"{$nextRow['title']}\"/></a> ";
}
else
{
$this->PreNext['next'] = "下一篇:没有了 ";
$this->PreNext['nexturl'] = "javascript:void:";
$this->PreNext['nextimg'] ="<a href='javascript:void(0)' alt=\"\"><img src=\"/templets/default/images/nophoto.jpg\" alt=\"对不起,没有下一图集了! \"/></a>";
}
}
if($gtype=='pre')
{
$rs = $this->PreNext['pre'];
}
else if($gtype=='preimg'){ $rs = $this->PreNext['preimg'];
}
else if($gtype=='next')
{
$rs = $this->PreNext['next'];
}
else if($gtype=='nextimg'){ $rs = $this->PreNext['nextimg'];
}
else if($gtype=='preurl'){
$rs = $this->PreNext['preurl'];
}else if($gtype=='nexturl'){
$rs = $this->PreNext['nexturl'];
} else{
$rs = $this->PreNext['pre']."   ".$this->PreNext['next'];
}
return $rs;
}

调用方法

<li><a href="{dede:prenext get='preurl'/}" class="pr"><</a></li>
<li><a href="{dede:prenext get='nexturl'/}" class="pr">></a></li>

preurl是上一页链接

nexturl这是下一个链接

空的javascript:void;

版权声明:本文博客原创文章。博客,未经同意,不得转载。

织梦不仅是链接到其他调用next的更多相关文章

  1. advancedsearch.php织梦高级自定义模型字段无法调用解决方案

    advancedsearch.php织梦dedecms 高级自定义模型字段无法调用解决方案 ,具体步骤如下: 1  打开修改puls/advancedsearch.php文件,找到复制代码(不同版本可 ...

  2. 织梦DedeCMS给栏目添加缩略图调用的方法

    织梦DedeCMS的栏目调用仅仅只有文字调用,没有栏目缩略图调用,而我们有时候又需要给栏目添加缩略图,并能够在前台调用,就可以试试通过下面的方法,给栏目添加缩略图. 首先要给栏目数据库表添加一个存储缩 ...

  3. DedeCMS织梦系统head.htm里无法调用栏目描述

    {dede:channel type='top'} [field:description/] {/dede:channel} channel 这个标签没有description属性你需要自己把这个属性 ...

  4. 织梦dedecms文章发布日期时间调用标签大全

    dedecms首页时间标签: 1.12-27 样式 [field:pubdate function='strftime("%m-%d",@me)'/] 2.May 15, 2012 ...

  5. 织梦DEDEcms5.7解决arclist标签调用副栏目文章

    使用arclist标签调用文章的时候才发现,根本无法调用相关文章. 下面给出解决办法,希望帮到需要的人. 找到/include/taglib/arclist.lib.php文件然后打开.然后在大约30 ...

  6. 织梦DeDeCMS友情链接文字显示不全

    文件:/include/taglib/flink.lib.php 把下面代码中的24改为合适的值 $attlist=”type|textall,row|24,titlelen|24,linktype| ...

  7. 织梦DedeCms用SQL语句调用数据库任意内容方法

    织梦DedeCms给我们提供了大量调用标签,供我们调用各种数据,但提供再多的标签,也有满足不了我们的时候,这时我们可以用SQL语句,灵活调用我们需要的内容. 如何任意调用数据库中的内容呢?先举个例子: ...

  8. 织梦DedeCms调用全站相关文章方法

    织梦DedeCms 有个标签可以调用相关文章,通过下面的修改可以调用全站的相关文章,文章页内显示相关文章内容,可以提高关键词密度,还是挺不错的. 模板调用代码 <div>     < ...

  9. 织梦文章页调用当前栏目名称和url地址的方法

    其实织梦本身有这2个调用标签,可能大家没怎么注意,下面的代码就是织梦文章页调用当前栏目名称和url地址的方法: {dede:field name='typeurl' function=”GetType ...

随机推荐

  1. HDU 4081-Parsing URL(水)

    Parsing URL Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others) Tota ...

  2. react.js 从零开始(六)Reconciliation

    Reconciliation   React 的关键设计目标是使 API 看起来就像每一次有数据更新的时候,整个应用重新渲染了一样.这就极大地简化了应用的编写,但是同时使 React 易于驾驭,也是一 ...

  3. bigdata_Hadoop jps出现process information unavailable提示解决办法

    启动Hadoop之后,使用jps命令查看当前系统的java进程情况,显示: hduser@jack:/usr/local/hadoop$ jps 18470 SecondaryNameNode 190 ...

  4. HttpGet 请求

    import java.net.HttpURLConnection; import java.text.SimpleDateFormat; import java.util.Calendar; imp ...

  5. HTML DOM的nodeName,nodeValue,nodeType介绍

    将HTML DOM中几个常用的属性做下介绍,工作中作为参考. nodeName 属性可依据节点的类型返回其名称. 元素节点的 nodeName 是标签名称 属性节点的 nodeName 是属性名称 文 ...

  6. ASP.NET上传文件的几种方法

      //上传文件实例 if (fileDealer.HasFile)//判断文件是否存在        {            string filepath = "";     ...

  7. JavaScript闭包的一些理解

    原文:JavaScript闭包的一些理解 简单一点的说:闭包就是能够读取其他函数内部变量的函数.那如何实现读取其它函数内部变量呢,大家都知道在JavaScript中内部函数可以访问其父函数中的变量,那 ...

  8. wamp 已安装cakephp Fatal error: You must enable the intl extension to use CakePHP. in XXX

    今wamp已安装cakephp3.x什么时候.报告这样的错误:Fatal error: You must enable the intl extension to use CakePHP. in D: ...

  9. 【百度地图API】发布静态图API啦!只需一个网址,即可展示定制百度地图!

    原文:[百度地图API]发布静态图API啦!只需一个网址,即可展示定制百度地图! 摘要: 百度地图静态图API!您无须执行任何“特殊”操作便可在网页上显示此图片. 不需要 JavaScript.我们只 ...

  10. 深入理解C指针之五:指针和字符串

    原文:深入理解C指针之五:指针和字符串 基础概念 字符串可以分配到内存的不同区域,通常使用指针来支持字符串操作.字符串是以ASCII字符NUL结尾的字符序列.ASCII字符NUL表示为\0.字符串通常 ...