下一篇 » « 上一篇

在首页最新更新文章标题前加上分类名称的MOD

作者:aqua19    时间:2008-01-22    来源:    点击:10223    本文共1篇文章 字体:[ ]

在首页最新更新文章标题前加上分类名称的MOD

此mod仅适用于pa201
打开index.php

查找

php学习之家

if ($showrecentarticle=="1"){

    $articles = $DB->query("SELECT article.* FROM ".$db_prefix."article AS article
                                     LEFT JOIN ".$db_prefix."sort AS sort
                                          USING(sortid)
                                     WHERE sort.showinrecent=1 AND article.visible=1
                                     ORDER BY date DESC

www.444p.com php学习之家


                                     LIMIT $recentarticlenum");

www.444p.com


改成 www.444p.com

if ($showrecentarticle=="1"){ www.444p.com

    $articles = $DB->query("SELECT sort.sortid,sort.title as stitle,article.* FROM ".$db_prefix."article AS article
                                     LEFT JOIN ".$db_prefix."sort AS sort
                                          USING(sortid)
                                     WHERE sort.showinrecent=1 AND article.visible=1
                                     ORDER BY date DESC

www.444p.com


                                     LIMIT $recentarticlenum");
本文来自 www.444p.com


然后进后台打开articlelistbit模板,用下面的替换 php学习之家

<table width="100%" border="0" cellspacing="0" cellpadding="3">
  <tr>
    <td colspan="2"><span class="normalfont"><a href="$phparticleurl/sort.php?sortid=$article[sortid]">$article[stitle]</a>--<a href="$phparticleurl/article.php?articleid=$article[articleid]">$article[title]</a>
      - <font color="$style[datecolor]">$article[date]</font> <font color="$style[timecolor]">$article[time]</font> - $article[author]</span></td>
  </tr>
  <tr>
    <td valign="top">$article[img]<span class="normalfont">$article[description]</span></td>
  </tr>

php学习之家

  <tr>
    <td height="5"></td>
  </tr>
</table>

php学习之家

这样就可以在首页的最新更新栏目文章标题前显示栏目的名称和链接了

php学习之家http://www.444p.com

责任编辑:semirock
发表评论
密码: (游客不需要密码)
记住我【Alt+S 或 Ctrl+Enter 快速提交】

搜索工具


热门搜索: [html][html][else][MYsql][mysql][调用][date][print][配置][配置]

《Phparticle》点击排行