不用修改dedecms模板文章内容页直接点图片进入下

不用修改dedecms模板文章内容页直接点图片进入下一分页,无分页进下一篇
坛里的大都是要改源码,其实是不用改的
以下代码加在HEAD前就可
<!--翻页-->
<script language="javascript" type="text/javascript">
var shortname = "{dede:global.art_shortname/}";
var npage = {dede:field name='nowpage'/};
var totalpage = {dede:field name='totalpage'/};
var namehand = '{dede:field name='namehand'/}';
var displaytype = '{dede:field name='displaytype'/}';
var gtimer = null;

function pageOpenEnd(){
    var nexturl = "{dede:prenext get='next' runphp="yes"}
preg_match_all('/<a.*?(?: |\\t|\\r|\\n)?href=[\'"]?(.+?)[\'"]?(?:(?: |\\t|\\r|\\n)+.*?)?>(.+?)<\/a.*?>/sim', @me, $strResult, PREG_PATTERN_ORDER);
@me=$strResult[1][0];
{/dede:prenext}";
    if( nexturl != '' ){
        window.location = nexturl;
    }else{
        window.location="/";
    }
}
//下一张
function dPlayNext()
{
    if(npage==totalpage) {
    pageOpenEnd();
    }
    else
    {
        if(displaytype=='st' && namehand!='') location.href = namehand+"_"+(npage+1)+shortname;
        else location.href = "view.php?aid={dede:field name='id'/}&pageno="+(npage+1);
    }
}
</script>