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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

首页n格的问题整理与解决[最后更新:2007.11.05 JS调用附件]

[复制链接]
 楼主| TaRot! 发表于 2007-8-2 09:17:30 | 显示全部楼层

回复 #279 51177 的帖子

你应该是有的版块设置了颜色,看一楼找解决方法.
回复

使用道具 举报

习明 发表于 2007-8-2 09:18:38 | 显示全部楼层

回复 #279 51177 的帖子

Q:使用首页n格后,版块名如何正常使用html代码加颜色?
A:主要是首页n格没有加过滤,参考:https://discuz.dismall.com/thread-622582-1-1.html
回复

使用道具 举报

习明 发表于 2007-8-2 09:20:57 | 显示全部楼层

回复 #280 jlddm 的帖子

这个没办法给解答 具体出什么错也没说 cache版不更新的问题 有一个帖子单独说明过
回复

使用道具 举报

yufly 发表于 2007-8-2 11:52:06 | 显示全部楼层
装了6.0的一个四格  ,但是感觉那个调用的帖子之间的太宽了  我想把行间距缩小一点该怎么做?
bbs.712200.om
回复

使用道具 举报

习明 发表于 2007-8-2 12:04:05 | 显示全部楼层

回复 #284 yufly 的帖子

调整html行高 可能在css里
回复

使用道具 举报

jourdan 发表于 2007-8-2 14:16:03 | 显示全部楼层
请问大大下,如果我不要那些被删除的帖子出现在首页4格要如何加入那个代码?以下是我的index.php。 :)

  1. //---------------首页四格 -- 2/2
  2. $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');

  3. //今日发贴排行
  4. $tomonth=date(n);
  5. $todate=date(j);
  6. $toyear=date(Y);
  7. $time=mktime(0,0,0,$tomonth,$todate,$toyear);
  8. $query=$db->query("select count(pid) as num,authorid,author from $tablepre"."posts where dateline>=$time group by authorid order by num desc limit 0,8");
  9. while($result=$db->fetch_array($query)){
  10. $poststar.="<a href=viewpro.php?uid=".$result[authorid].">".$result[author]."</a> (<font color=red>".$result[num]."</font>)<br>";
  11. }
  12. //今日发贴排行

  13. $hack_subject_len=30; //每个标题最多显示得字数
  14. $hack_subject_num=8; //需要显示记录数

  15. $hack_newthreads_threadlist = array();
  16. $thread = array();
  17. //最新贴
  18. $query = $db->query("SELECT dateline,typeid,tid,subject,author,views,replies,lastpost,lastposter FROM {$tablepre}threads WHERE fid NOT IN(9,12,23,27,28,32,36) ORDER BY dateline DESC LIMIT 0, $hack_subject_num");

  19. while($thread = $db->fetch_array($query)) {
  20.         $typeselect = typeselect($typeid);
  21.         $thread['forumname'] = $thread['name'];
  22.         $thread['date']= gmdate("$dateformat $timeformat", $thread['dateline'] + $timeoffset * 3600);
  23.         $thread['lastreplytime']= gmdate("$dateformat $timeformat", $thread[lastpost] + ($timeoffset * 3600));
  24.         $thread[subject0]=$thread[subject];
  25.         $thread['subject'] = cutstr($thread['subject'], $hack_subject_len);
  26.         $hack_newthreads_threadlist[] = $thread;
  27. }
  28. //最新贴

  29. //最新回复
  30. $query = $db->query("SELECT dateline,tid,subject,author,views,replies,lastpost,lastposter FROM {$tablepre}threads WHERE fid NOT IN(9,12,23,27,28,32,36) AND replies > 0 ORDER BY lastpost DESC LIMIT 0, $hack_subject_num");
  31.         while($thread = $db->fetch_array($query)) {
  32.                 $thread[subject0]=$thread[subject];
  33.                 $thread['forumname'] = $thread['name'];
  34.                 $thread['date']= gmdate("$dateformat $timeformat", $thread['dateline'] + $timeoffset * 3600);
  35.                 $thread['lastreplytime']= gmdate("$dateformat $timeformat", $thread[lastpost] + ($timeoffset * 3600));
  36.                 $thread[subject] = cutstr($thread[subject], $hack_subject_len);
  37.                 $threadreply[] = $thread;
  38.         }
  39. //最新回复

  40. //热帖
  41. $hack_cut_str = 30; //修改标题显示字数
  42. $hack_cut_strauthor = 8;
  43. //这个可以选择安装或者不安装//
  44. //热贴指定天数//
  45. $this_time= time();
  46. $sort_time = $today - ( 60*60*24*30); //30天内,或者改成7天也就是一周
  47. $new_hot_threadlist = array();
  48. $mthread = array();
  49. $query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid AND f.fid NOT IN(9,23,27,28,32,36) AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 and t.dateline > $sort_time ORDER BY t.views DESC LIMIT 0, 10"); //修改显示帖子条数
  50. while($mthread = $db->fetch_array($query)) {
  51.         $mthread['forumname'] = $mthread['name'];
  52.         $mthread['view_subject'] = cutstr($mthread['subject'],$hack_cut_str);
  53.         $mthread['view_lastposter'] = cutstr($mthread['lastposter'],$hack_cut_strauthor);
  54.         $mthread['date']= gmdate("$dateformat $timeformat", $mthread['dateline'] + $timeoffset * 3600);
  55.         $mthread['lastreplytime']= gmdate("$dateformat $timeformat", $mthread[lastpost] + ($timeoffset * 3600));
  56.         if($mthread['highlight']) {
  57.                 $string = sprintf('%02d', $mthread['highlight']);
  58.                 $stylestr = sprintf('%03b', $string[0]);
  59.                 $mthread['highlight'] = 'style="';
  60.                 $mthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
  61.                 $mthread['highlight'] .= '"';
  62.         } else {
  63.                 $mthread['highlight'] = '';
  64.         }
  65.         $new_hot_threadlist[] = $mthread;
  66. }
  67. //热帖,四格代码结束//
  68. //---------------首页四格 -- 2/2 end
复制代码







我试了一楼的方法但出现错误。这个是错误讯息...我是用Discuz6,本地主机测试的。

Discuz! info: MySQL Query Error

User: J34
Time: 2007-8-2 2:08pm
Script: /forum/index.php

SQL: SELECT dateline,typeid,tid,subject,author,views,replies,lastpost,lastposter FROM [Table]threads WHERE t.displayorder>=0 AND fid NOT IN(9,12,23,27,28,32,36) ORDER BY dateline DESC LIMIT 0, 8
Error: Unknown column 't.displayorder' in 'where clause'
程序文件跟数据库有冲突,请使用正确的程序文件上传上去覆盖

Similar error report has beed dispatched to administrator before.

[ 本帖最后由 jourdan 于 2007-8-2 14:20 编辑 ]
回复

使用道具 举报

习明 发表于 2007-8-2 14:38:23 | 显示全部楼层

回复 #286 jourdan 的帖子

  1. t.displayorder>=0
复制代码

to
  1. displayorder>=0
复制代码
回复

使用道具 举报

jourdan 发表于 2007-8-2 15:19:22 | 显示全部楼层

回复 #287 习明 的帖子

解决了,谢谢你了! ^_^
回复

使用道具 举报

jourdan 发表于 2007-8-2 17:53:09 | 显示全部楼层
不晓得可发问这样的问题吗?如果不允许那请版主删除这帖。。。:)

请问下,要如何能把"≡ 今日发贴 ≡"的会员名单的布局做得像其它三个格子这样?有条线在名字底部。。。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

习明 发表于 2007-8-2 18:22:34 | 显示全部楼层

回复 #289 jourdan 的帖子

这个只是个模版问题 修改一下那个4格提供的模版试试
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-22 14:36 , Processed in 0.137309 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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