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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

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

[复制链接]
习明 发表于 2007-8-11 00:01:54 | 显示全部楼层

回复 #320 龟兹热线 的帖子

重新改一下吧 最好是按lz的说明操作
回复

使用道具 举报

异域狂想曲 发表于 2007-8-11 16:11:16 | 显示全部楼层
请问下楼主,删除帖子还显示在首页四格里我这个怎么修改,谢谢~
  1. //---------------首页四格 -- 2/2
  2. $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
  3. //新贴//
  4. $hack_cut_str = 33; //修改标题显示字数
  5. $hack_cut_strauthor = 9;
  6. $new_post_threadlist = array();
  7. $nthread = array();
  8. $query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0, 8");
  9. while($nthread = $db->fetch_array($query)) {
  10.         $nthread['forumname'] = $nthread['name'];
  11.         $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
  12.         $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
  13.         $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
  14.         $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
  15.         if($nthread['highlight']) {
  16.                 $string = sprintf('%02d', $nthread['highlight']);
  17.                 $stylestr = sprintf('%03b', $string[0]);
  18.                 $nthread['highlight'] = 'style="';
  19.                 $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
  20.                 $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
  21.                 $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
  22.                 $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
  23.                 $nthread['highlight'] .= '"';
  24.         } else {
  25.                 $nthread['highlight'] = '';
  26.         }
  27.         $new_post_threadlist[] = $nthread;
  28. }
  29. //新贴//
  30. //新回复
  31. $hack_cut_str = 33; //修改标题显示字数
  32. $hack_cut_strauthor = 9;
  33. $new_reply_threadlist = array();
  34. $rthread = array();
  35. $query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid  AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 ORDER BY t.lastpost DESC LIMIT 0, 8");
  36. while($rthread = $db->fetch_array($query)) {
  37.         $rthread['forumname'] = $rthread['name'];
  38.         $rthread['view_subject'] = cutstr($rthread['subject'],$hack_cut_str);
  39.         $rthread['view_lastposter'] = cutstr($rthread['lastposter'],$hack_cut_strauthor);
  40. $rthread['date']= gmdate("$dateformat $timeformat", $rthread['dateline'] + $timeoffset * 3600);
  41.         $rthread['lastreplytime']= gmdate("$dateformat $timeformat", $rthread[lastpost] + ($timeoffset * 3600));
  42.         if($rthread['highlight']) {
  43.                 $string = sprintf('%02d', $rthread['highlight']);
  44.                 $stylestr = sprintf('%03b', $string[0]);
  45.                 $rthread['highlight'] = 'style="';
  46.                 $rthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
  47.                 $rthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
  48.                 $rthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
  49.                 $rthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
  50.                 $rthread['highlight'] .= '"';
  51.         } else {
  52.                 $rthread['highlight'] = '';
  53.         }
  54.         $new_reply_threadlist[] = $rthread;
  55. }
  56. //回复//
  57. //热帖
  58. $hack_cut_str = 33; //修改标题显示字数
  59. $hack_cut_strauthor = 9;
  60. $new_hot_threadlist = array();
  61. $mthread = array();
  62. $query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid  AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 ORDER BY t.views DESC LIMIT 0, 8");
  63. while($mthread = $db->fetch_array($query)) {
  64.         $mthread['forumname'] = $mthread['name'];
  65.         $mthread['view_subject'] = cutstr($mthread['subject'],$hack_cut_str);
  66.         $mthread['view_lastposter'] = cutstr($mthread['lastposter'],$hack_cut_strauthor);
  67. $mthread['date']= gmdate("$dateformat $timeformat", $mthread['dateline'] + $timeoffset * 3600);
  68.         $mthread['lastreplytime']= gmdate("$dateformat $timeformat", $mthread[lastpost] + ($timeoffset * 3600));
  69.         if($mthread['highlight']) {
  70.                 $string = sprintf('%02d', $mthread['highlight']);
  71.                 $stylestr = sprintf('%03b', $string[0]);
  72.                 $mthread['highlight'] = 'style="';
  73.                 $mthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
  74.                 $mthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
  75.                 $mthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
  76.                 $mthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
  77.                 $mthread['highlight'] .= '"';
  78.         } else {
  79.                 $mthread['highlight'] = '';
  80.         }
  81.         $new_hot_threadlist[] = $mthread;
  82. }
  83. //热帖//
  84. //---------------首页四格 -- 2/2 end
复制代码

[ 本帖最后由 异域狂想曲 于 2007-8-11 16:13 编辑 ]
回复

使用道具 举报

龟兹热线 发表于 2007-8-11 18:24:17 | 显示全部楼层

回复 #321 习明 的帖子

习明斑竹,我重新修改了,还是那样阿,我的是从PW5.3转过来的。
另外就是发现,新发出来的帖子都是正常的,但是一旦有人回复了之后,标题就变成了Array[view_subject]。
请习明斑竹帮帮忙,看看这究竟是什么原因阿?
回复

使用道具 举报

习明 发表于 2007-8-11 23:50:44 | 显示全部楼层

回复 #323 龟兹热线 的帖子

<!-- 首页四格 -->
<div class="mainbox forumlist">
<table cellspacing="0" cellpadding="0">
  <thead class="category">
  <tr>
   <td align="center" style="padding:1px"><h3>≡ 论坛图片 ≡</h3></td>
   <td align="center" style="padding:1px"><h3>≡ 最新帖子 ≡</h3></td>
   <td align="center" style="padding:1px"><h3>≡ 最新回复 ≡</h3></td>
   <td align="center" style="padding:1px"><h3>≡ 热门帖子 ≡</h3></td>
  </tr>
  </thead>
  <tr>
   <td width="25%">
<?php
require_once 'pic.php';
?>
   </td>
   <td width="25%">
    <!--{loop $new_post_threadlist $nthread}-->
    <table border="0" width="100%"
cellspacing="2">
     <tr>
      <td height="12"
width="100%" style="border-top: 0px;padding:1px">
      <!--{if $nthread
[replies]}-->
       <img
src="images/picli.gif" border="0" /><a href="viewthread.php?tid=$nthread[tid]" $nthread['highlight'] title='最新话题 {LF}所在论坛: $nthread[forumname]{LF}主题标题: $nthread[subject] {LF}主题作者: $nthread[author]{LF}发表时间: $nthread[date]{LF}浏览次数: $nthread[views] 次 {LF}回复次数: $nthread[replies] 次{LF}最后回复: $nthread[lastreplytime]{LF}{lang lastpost}: $nthread[lastposter]'>$nthread[view_subject]</a>
                  <!--{else}-->
       <img
src="images/picli.gif" border="0" /><a href="viewthread.php?tid=$nthread[tid]" $nthread['highlight'] title='最新话题 {LF}所在论坛: $nthread[forumname]{LF}主题标题: $nthread[subject] {LF}主题作者: $nthread[author]{LF}发表时间: $nthread[date]{LF}浏览次数: $nthread[views] 次 {LF}回复次数: $nthread[replies] 次{LF}最后回复: 暂时没有回复'>$nthread[view_subject]</a>
      <!--{/if}-->
      </td>
     </tr>
    </table>
    <!--{/loop}-->
   </td>
   <td width="25%">
    <!--{loop $new_reply_threadlist $rthread}-->
    <table border="0" width="100%" cellspacing="2">
     <tr>
      <td height="12" width="100%" style="border-top: 0px;padding:1px"><img
src="images/picli.gif" border="0" /><a href="viewthread.php?tid=$rthread[tid]" $rthread['highlight'] title='最新回复 {LF}所在论坛: $rthread[forumname]{LF}主题标题: $rthread[subject]{LF}主题作者: $rthread[author]{LF}发表时间: $rthread[date]{LF}浏览次数: $rthread[views] 次{LF}回复次数: $rthread[replies] 次{LF}最后回复: $rthread[lastreplytime]{LF}{lang lastpost}: $rthread[lastposter]'>$rthread[view_subject]</a></td>
     </tr>
    </table>
    <!--{/loop}-->         
   </td>
   <td width="25%">
    <!--{loop $new_hot_threadlist $mthread}-->
    <table border="0" width="100%" cellspacing="2">
     <tr>
      <td height="12" width="100%" style="border-top: 0px;padding:1px"><img src="images/picli.gif" border="0" /><a href="viewthread.php?tid=$mthread[tid]" $mthread['highlight'] title='热门话题 {LF}所在论坛: $mthread[forumname]{LF}主题标题: $mthread[subject]{LF}主题作者: $mthread[author]{LF}发表时间: $mthread[date]{LF}浏览次数: $mthread[views] 次{LF}回复次数: $mthread[replies] 次{LF}最后回复: $mthread[lastreplytime]{LF}{lang lastpost}: $mthread[lastposter]'>$mthread[view_subject]</a></td>
     </tr>
    </table>
    <!--{/loop}-->   
   </td>
  </tr>
</table>
</div>
<!-- 首页四格end -->

复制这段代码 替换原程序中在discuz.htm中增加的内容
回复

使用道具 举报

龟兹热线 发表于 2007-8-12 01:34:48 | 显示全部楼层
耶,全部正常了阿,谢谢习明版主!感激不尽!!!!
可惜不能评分阿,不然一定给使劲加分!!!
回复

使用道具 举报

习明 发表于 2007-8-12 11:32:42 | 显示全部楼层

回复 #325 龟兹热线 的帖子

呵呵 正常了就好 不用客气
作为欢迎LZ来到DZ的一点见面礼~:)
回复

使用道具 举报

wjwh 发表于 2007-8-12 16:49:38 | 显示全部楼层
我使用的是猎英夜客的(https://discuz.dismall.com/thread-660745-1-1.html),5.50版的论坛,图片无法显示,属性为http://www.yqle.cn/bbs/images/toplist/bfg1.jpg?1186756310
在SS首页该图片显示正常
附件路径是否正确(论坛在BBS目录下,改动过):
./attachments
/attachments

[[i] 本帖最后由 wjwh 于 2007-8-12 16:56 编辑 [/i]]
回复

使用道具 举报

qq595406615 发表于 2007-8-12 17:13:19 | 显示全部楼层
看得我眼花缭乱......好多东西啊!~~
回复

使用道具 举报

习明 发表于 2007-8-12 21:45:07 | 显示全部楼层

回复 #327 wjwh 的帖子

没看明白
回复

使用道具 举报

wjwh 发表于 2007-8-12 22:08:02 | 显示全部楼层
首页N格中的图片不显示,是后台的“附件设置”错误了?
http://www.yqle.cn/bbs/index.php
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-22 16:41 , Processed in 0.128994 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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