Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索

[已答复] 官方【门户】【文章列表】【两列模板】【调用文章数】

[复制链接]
不爱吃鸡蛋 发表于 2011-4-5 23:21:53 | 显示全部楼层 |阅读模式
问题描述
适用版本: Discuz! X1.5
浏览器: IE6 IE8 IE9 firefox 
使用模板: 官方模板
BUG地址: https://discuz.dismall.com
默认门户 文章列表 两列模板

调用的文章数是10篇

我想变成5篇

如何???

回复

使用道具 举报

 楼主| 不爱吃鸡蛋 发表于 2011-4-6 13:00:21 | 显示全部楼层
回复

使用道具 举报

cr180 发表于 2011-4-6 15:35:14 | 显示全部楼层
回复 不爱吃鸡蛋 的帖子

source\module\portal\portal_list.php
查找:
  1. if($key == 'portalhotarticle') {
  2.                                 $dateline = TIMESTAMP - 3600 * 24 * 90;
  3.                                 $sql = "SELECT at.* FROM ".DB::table('portal_article_count')." ac, ".DB::table('portal_article_title')." at WHERE $wheresql AND ac.dateline>'$dateline' AND ac.aid=at.aid ORDER BY ac.viewnum DESC LIMIT 10";
  4.                         } elseif($key == 'portalnewarticle') {
  5.                                 $sql = "SELECT * FROM ".DB::table('portal_article_title')." at WHERE $wheresql ORDER BY at.dateline DESC LIMIT 10";
  6.                         } elseif(substr($key, 0, 7) == 'subcate') {
  7.                                 $cacheid = intval(str_replace('subcate', '', $key));
  8.                                 if(!empty($_G['cache']['portalcategory'][$cacheid])) {
  9.                                         $where = '';
  10.                                         if(!empty($_G['cache']['portalcategory'][$cacheid]['children']) && dimplode($_G['cache']['portalcategory'][$cacheid]['children'])) {
  11.                                                 $_G['cache']['portalcategory'][$cacheid]['children'][] = $cacheid;
  12.                                                 $where = 'at.catid IN ('.dimplode($_G['cache']['portalcategory'][$cacheid]['children']).')';
  13.                                         } else {
  14.                                                 $where = 'at.catid='.$cacheid;
  15.                                         }
  16.                                         $where .= " AND at.status='0'";
  17.                                         $sql = "SELECT * FROM ".DB::table('portal_article_title')." at WHERE $where ORDER BY at.dateline DESC LIMIT 10";
  18.                                 }                        }
复制代码
把代码里的10改为5试试看
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-9-10 07:07 , Processed in 0.116321 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表