zoukankan      html  css  js  c++  java
  • phpcms2008添加上一篇下一篇的功能

    简介:这是phpcms2008添加上一篇下一篇的功能的详细页面,介绍了和php,php phpcms2008添加上一篇下一篇的功能有关的知识、技巧、经验,和一些php源码等。

    class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=355979' scrolling='no'>


    第一步:修改show.php
    在代码
    if(!$C['defaultchargepoint'] && !$r['readpoint'])
    前面增加代码
    //<FKE.LA添加代码>
    //上一篇文章
    $more_pre = $db->get_one("SELECT title,url FROM `".DB_PRE."content` WHERE `contentid`<$contentid and `catid`='{$r['catid']}' order by contentid desc limit 0,1");
    if(empty($more_pre)) {
    $more_pre['title']='没有了';
    $more_pre['url']='';
    }
    //下一篇文章
    $more_next = $db->get_one("SELECT title,url FROM `".DB_PRE."content` WHERE `contentid`>$contentid and `catid`='{$r['catid']}' order by contentid asc limit 0,1");
    if(empty($more_next)) {
    $more_next['title']='没有了';
    $more_next['url']='';
    }
    //</FKE.LA添加代码>

    第二步:修改include/html.class.php中的show函数
    在代码
    if(strpos($content, '[page]') !== false)
    前增加代码:
    //<FKE.LA添加代码>
    global $db;
    //上一篇文章
    $more_pre = $db->get_one("SELECT title,url FROM `".DB_PRE."content` WHERE `contentid`<$contentid and `catid`='$catid' order by contentid desc limit 0,1");
    if(empty($more_pre)) {
    $more_pre['title']='没有了';
    $more_pre['url']='';
    }
    //下一篇文章
    $more_next = $db->get_one("SELECT title,url FROM `".DB_PRE."content` WHERE `contentid`>$contentid and `catid`='$catid' order by contentid asc limit 0,1");
    if(empty($more_next)) {
    $more_next['title']='没有了';
    $more_next['url']='';
    }
    //</FKE.LA添加代码>

    第三步:在模板目录/phpcms/show.html文件中您认为合适的位置添加
    <div class="moreArticle"><ul>
    <li>上一篇: <a href="{$more_pre[url]}" target="_self">{$more_pre[title]}</a></li>
    <li>下一篇: <a href="{$more_next[url]}" target="_self">{$more_next[title]}</a></li>
    </ul></div>

    第四步:在您的CSS样式文件中添加
    /***上一篇下一篇文章链接(fke.la)***/
    .moreArticle{
    margin:5px 0px;100%;
    font-size:12px;clear:both;
    }
    .moreArticle ul{100%;}
    .moreArticle ul li{100%;height:22px;line-height:22px;}

    爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具

    http://biancheng.dnbcw.info/php/355979.html pageNo:2
  • 相关阅读:
    svn diff
    Design of a ProxySharing Proxy Server
    一个很好的多代理服务器调度软件-ProxyExpert(绿色软件) 『 软件使用交流 』 赢政天下 YingZheng.com Powered by Discuz!
    关于编译Qt以及驱动的一点总结吧 Rollen Holt 博客园
    Spring Bean Scope Prototype
    spring scope="prototype" 和scope="singleton"区分
    Struts2+hibernate+spring 配置文件中scope="prototype"的作用
    nginx 多级代理
    JS中的sleep
    《2013清明忆父》!
  • 原文地址:https://www.cnblogs.com/ooooo/p/2236057.html
Copyright © 2011-2022 走看看