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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[9.22更新,增加文字底色][原创]10种自定义参数标题醒目高亮

[复制链接]
 楼主| lu5266 发表于 2005-11-11 16:27:57 | 显示全部楼层

回复 #279 西龙 的帖子

forumdisplay.php

  1. <?php

  2. /*
  3. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  4. :: [DISCUZ!]  Crossday Discuz! Board                                    ::
  5. :: (c) 2001-2005 Comsenz Technology Ltd (www.discuz.com)                ::
  6. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  7. :: Author:  Crossday (tech@discuz.com) Cnteacher (cnteacher@discuz.com) ::
  8. :: Version: 2.5F   2004/10/01 05:15                                     ::
  9. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  10. */
  11. //fix:  BY pk0909
  12. /*
  13. 1 そ???硈钡拜肈
  14. 2 accessmask?拜肈
  15. */

  16. define('CURRSCRIPT',  'forumdisplay');

  17. require './include/common.php';
  18. require DISCUZ_ROOT.'./include/forum.php';

  19. $discuz_action = 2;

  20. if(isset($showoldetails)) {
  21.         switch ($showoldetails) {
  22.                 case 'no': setcookie('onlinedetail', 0, $timestamp + 86400 * 365, $cookiepath, $cookiedomain); break;
  23.                 case 'yes': setcookie('onlinedetail', 1, $timestamp + 86400 * 365, $cookiepath, $cookiedomain); break;
  24.         }
  25. } else {
  26.         $showoldetails = false;
  27. }

  28. if(!$forum['fid'] || $forum['type'] == 'group' || ($adminid<>1 && !$forum[status])) {
  29.         showmessage('forum_nonexistence', NULL, 'HALTED');
  30. }

  31. if($forum['type'] == 'forum') {
  32.         $navigation = "&raquo; $forum[name]";
  33.         $navtitle = ' - '.strip_tags($forum['name']);
  34. } else {
  35.         $forumup = $_DCACHE['forums'][$forum['fup']]['name'];
  36.         $navigation = "&raquo; <a href="forumdisplay.php?fid=$forum[fup]">$forumup</a> &raquo; $forum[name]";
  37.         $navtitle = ' - '.strip_tags($forumup).' - '.strip_tags($forum['name']);
  38. }

  39. if($forum['password'] && $action == 'pwverify') {
  40.         if($pw != $forum['password']) {
  41.                 showmessage('forum_passwd_incorrect', NULL, 'HALTED');
  42.         } else {
  43.                 setcookie("fidpw$fid", $pw, 0, $cookiepath, $cookiedomain);
  44.                 showmessage('forum_passwd_correct', "forumdisplay.php?fid=$fid");
  45.         }
  46. }

  47. if($forum['viewperm'] && !strstr($forum['viewperm'], "\t$groupid\t") && !$forum['allowview']) {
  48.         showmessage('forum_nopermission', NULL, 'HALTED');
  49. }

  50. if(!empty($forum['password']) && $forum['password'] != $_COOKIE["fidpw$fid"]) {
  51.         include template('forumdisplay_passwd');
  52.         exit();
  53. }

  54. $ismoderator = modcheck($discuz_user);
  55. $moderatedby = moddisplay($forum['moderator'], 'forumdisplay');

  56. $postcredits = $forum['postcredits'] != -1 ? $forum['postcredits'] : $postcredits;
  57. $replycredits = $forum['replycredits'] != -1 ? $forum['replycredits'] : $replycredits;

  58. $subexists = 0;
  59. foreach($_DCACHE['forums'] as $sub) {
  60.         if($sub['type'] == 'sub' && $sub['fup'] == $fid && ($accessmasks || !$hideprivate || !$sub['viewperm'] || strstr($sub['viewperm'], "\t$groupid\t") || strstr($sub['users'], "\t$discuz_uid\t"))) {
  61.                 $sublist = array();
  62.                 $sql = $accessmasks        ? "SELECT f.fid, f.fup, f.type, f.icon, f.name, f.description, f.moderator, f.threads, f.posts, f.lastpost, f.viewperm, a.allowview FROM $table_forums f
  63.                                                 LEFT JOIN $table_access a ON a.uid='$discuz_uid' AND a.fid=f.fid
  64.                                                 WHERE fup='$fid' AND status='1' AND type='sub' ORDER BY f.displayorder"
  65.                                         : "SELECT fid, fup, type, icon, name, description, moderator, threads, posts, lastpost, viewperm FROM $table_forums WHERE fup='$fid' AND status='1' AND type='sub' ORDER BY displayorder";
  66.                 $query = $db->query($sql);
  67.                 while($sub = $db->fetch_array($query)) {
  68.                         if(forum($sub)) {
  69.                                 $sublist[] = $sub;
  70.                                 $subexists = 1;
  71.                         }
  72.                 }
  73.                 break;
  74.         }
  75. }

  76. $page = intval($page) ? intval($page) : 1;
  77. $start_limit = ($page - 1) * $tpp;

  78. $announcement_list = array();
  79. if($page == 1  && $_DCACHE['announcements_forum']) {
  80.         foreach($_DCACHE['announcements_forum'] as $ann) {
  81.                 $ann['authorencode'] = rawurlencode($ann['author']);
  82.                 $ann['starttime'] = gmdate("$dateformat $timeformat", $ann['starttime'] + ($timeoffset * 3600));
  83.                 $announcement_list[] = $ann ;
  84.         }
  85. }        

  86. $forumdisplayadd = $filteradd = '';
  87. if(!empty($filter)) {
  88.         if(is_numeric($filter)) {
  89.                 $forumdisplayadd .= "&filter=$filter";
  90.                 $filteradd = "AND lastpost>='".($timestamp - $filter)."'";
  91.         } elseif($filter == 'digest') {
  92.                 $forumdisplayadd .= "&filter=digest";
  93.                 $filteradd = "AND digest>'0'";
  94.         }
  95. } else {
  96.         $filter = '';
  97. }

  98. $ascdesc == 'ASC' ? $forumdisplayadd .= "&ascdesc=$ascdesc" : $ascdesc = 'DESC';


  99. if($whosonlinestatus == 2 || $whosonlinestatus == 3) {
  100.         $whosonlinestatus = 0;
  101.         $onlineinfo = explode("\t", $onlinerecord);
  102.         $detailstatus = ((!isset($_COOKIE['onlinedetail']) && $onlineinfo[0] < 500) || ($_COOKIE['onlinedetail'] || $showoldetails == 'yes')) && $showoldetails != 'no';

  103.         if($detailstatus) {
  104.                 updatesession();
  105.                 @include language('actions');

  106.                 $whosonline = array();
  107.                 $forumname = strip_tags($forum['name']);
  108.                 $query = $db->query("SELECT uid, groupid, username, invisible, lastactivity, action FROM $table_sessions WHERE uid>'0' AND fid='$fid' AND invisible='0'");
  109.                 if($db->num_rows($query)) {
  110.                         $whosonlinestatus = 1;
  111.                         while($online = $db->fetch_array($query)) {
  112.                                 $online['icon'] = isset($_DCACHE['onlinelist'][$online['groupid']]) ? $_DCACHE['onlinelist'][$online['groupid']] : $_DCACHE['onlinelist'][0];
  113.                                 $online['action'] = $actioncode[$online['action']];
  114.                                 $online['lastactivity'] = gmdate($timeformat, $online['lastactivity'] + ($timeoffset * 3600));
  115.                                 $whosonline[] = $online;     
  116.                         }
  117.                 }
  118.                 unset($online);
  119.         }
  120. } else {
  121.         $whosonlinestatus = 0;
  122. }

  123. if($discuz_uid && $newpm) {
  124.         require DISCUZ_ROOT.'./include/pmprompt.php';
  125. }

  126. if(!empty($filter)) {
  127.         $query = $db->query("SELECT COUNT(*) FROM $table_threads WHERE fid='$fid' $filteradd");
  128.         $threadcount = $db->result($query, 0);
  129. } else {
  130.         $threadcount = $forum['threads'];
  131. }

  132. $multipage = multi($threadcount, $tpp, $page, "forumdisplay.php?fid=$fid$forumdisplayadd");

  133. $separatepos = 0;
  134. $threadlist = array();
  135. $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
  136. $toptids = '0';
  137. $topcount = 0;
  138. if (!$filter && $page == 1) {
  139.         foreach ($_DCACHE['topthreads'] as $topthread) {
  140.                 $toptids .= ',' . $topthread['tid'];
  141.                 $topcount++;
  142.         }
  143. }
  144. if ($topcount) {
  145.         $tfids = '0';
  146.         $tForumArray = array();
  147.         if ($forum['type'] == 'forum') {
  148.                 $groupfid = $forum['fup'];
  149.         } elseif ($forum['type'] == 'sub') {
  150.                 $groupfid = $_DCACHE['forums'][$forum['fup']]['fup'];
  151.         }
  152.         foreach($_DCACHE['forums'] as $key => $value) {
  153.                 if ($value['type'] == 'forum' && $value['fup'] == $groupfid) {
  154.                         $tfids .= ','.$key;
  155.                         $tForumArray[] = $key;
  156.                 }
  157.         }
  158.         foreach($_DCACHE['forums'] as $key => $value) {
  159.                 if ($value['type'] == 'sub' && in_array($value['fup'],$tForumArray)) {
  160.                         $tfids .= ','.$key;
  161.                 }
  162.         }
  163.         $sql = "SELECT t.* FROM $table_threads t
  164.                         WHERE tid IN ($toptids)
  165.                         AND (t.displayorder=3 OR (t.displayorder=2 AND t.fid IN ($tfids)))
  166.                         ORDER BY t.displayorder DESC, t.lastpost DESC";
  167.         $query = $db->query($sql);
  168.         while($thread = $db->fetch_array($query)) {
  169.                 if($thread['attachment']) {
  170.                         require_once DISCUZ_ROOT.'./include/attachment.php';
  171.                 }
  172.                 parseThread();
  173.                 $threadlist[] = $thread;
  174.         }
  175. }

  176. $sql = "SELECT t.* FROM $table_threads t
  177.                         WHERE t.fid='$fid' $filteradd
  178.                         ORDER BY t.displayorder DESC, t.lastpost $ascdesc
  179.                         LIMIT $start_limit, $tpp ";

  180. $query = $db->query($sql);


  181. while($thread = $db->fetch_array($query)) {
  182.         if($thread['attachment']) {
  183.                 require_once DISCUZ_ROOT.'./include/attachment.php';
  184.         }
  185.         if ($thread['displayorder'] < 2 || !$topcount) {
  186.                 parseThread();
  187.                 $threadlist[] = $thread;
  188.         }
  189. }

  190. $check[$filter] = 'selected="selected"';
  191. $ascdesc == 'ASC' ? $check['asc'] = 'selected="selected"' : $check['desc'] = 'selected="selected"';

  192. $forumselect = $forumjump ? forumselect() : NULL;

  193. $usesigcheck = $signature ? 'checked' : NULL;
  194. $allowpost = (!$forum['postperm'] && $allowpost) || ($forum['postperm'] && strstr($forum['postperm'], "\t$groupid\t")) || $forum['allowpost'];

  195. include template('forumdisplay');
  196. function parseThread() {
  197.         global $thread, $_DCACHE, $postsnum, $ppp, $pagelinks, $topicpages, $string, $colorarray, $dateformat, $timeformat, $timeoffset, $separatepos, $hottopic;
  198.         $thread['icon'] = isset($_DCACHE['icons'][$thread['iconid']]) ? '<img src="'.SMDIR.'/'.$_DCACHE['icons'][$thread['iconid']].'" align="absmiddle">' : '&nbsp;';
  199.         $thread['lastposterenc'] = rawurlencode($thread['lastposter']);

  200.         $postsnum = $thread['replies'] + 1;
  201.         if($postsnum  > $ppp) {
  202.                 $pagelinks = '';
  203.                 $topicpages = ceil($postsnum / $ppp);
  204.                 for ($i = 1; $i <= $topicpages; $i++) {
  205.                         $pagelinks .= "<a href="viewthread.php?tid=$thread[tid]&page=$i&fpage=$page">$i</a> ";
  206.                         if($i == 6) {
  207.                                 $i = $topicpages + 1;
  208.                         }
  209.                 }
  210.                 if($topicpages > 6) {
  211.                         $pagelinks .= " .. <a href="viewthread.php?tid=$thread[tid]&page=$topicpages&fpage=$page">$topicpages</a> ";
  212.                 }
  213.                 $thread['multipage'] = '&nbsp; &nbsp;( <img src="'.IMGDIR.'/multipage.gif" align="absmiddle" boader="0"> '.$pagelinks.')';
  214.         } else {
  215.                 $thread['multipage'] = '';
  216.         }

  217.         if($thread['highlight']) {
  218.                 $string = sprintf('%02d', $thread['highlight']);
  219.                 $stylestr = sprintf('%03b', $string[0]);

  220.                 $thread['highlight'] = 'style="';
  221.                 $thread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
  222.                 $thread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
  223.                 $thread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
  224.                 $thread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
  225.                 $thread['highlight'] .= '"';
  226.         } else {
  227.                 $thread['highlight'] = '';
  228.         }
  229. //=====八种自定义参数标题醒目+任意颜色高亮==start==By www.5466.ik8.com==============   
  230.    if($thread['xm_hl']) {
  231.         
  232.            $xm_hl_string=explode(',',$thread['xm_hl']);
  233.            
  234.            switch($xm_hl_string[0]){
  235.            
  236.            case 1:
  237.                   $xm_hl_style  = '<font style="';
  238.                   $xm_hl_style .= $xm_hl_string[1] ? 'color: #'.$xm_hl_string[1].'; ' : '';        
  239.                       $xm_hl_style .= $xm_hl_string[2] ? 'font-weight: bold;' : '';
  240.                       $xm_hl_style .= $xm_hl_string[3] ? 'font-style: italic;' : '';
  241.                       $xm_hl_style .= $xm_hl_string[4] ? 'text-decoration: underline;' : '';               
  242.                       $xm_hl_style .= '">';
  243.                       $thread[subject]=$xm_hl_style.$thread[subject].'</font>';
  244.                       break;
  245.            case 2:
  246.                   $xm_hl_style  = '<font textcolor1="#'.$xm_hl_string[1].'"  textbkcolor1="transparent" textcolor2="#'.$xm_hl_string[2];
  247.                   $xm_hl_style .='" textbkcolor2="transparent" speed="'.$xm_hl_string[3].'" letters1="1" letters2="1" pause="'.$xm_hl_string[4];
  248.                   $xm_hl_style .='" style="behavior:url(include/z_FlashText.htc);color:#c000c0;background-color:transparent">';
  249.                       $thread[subject]=$xm_hl_style.$thread[subject].'</font>';
  250.                       break;
  251.            case 3:
  252.                   $xm_hl_style  = '<font textoffset1="'.$xm_hl_string[1].'" textoffset2="'.$xm_hl_string[2];
  253.                   $xm_hl_style .='" speed="'.$xm_hl_string[3].'" letters1="1" letters2="1" pause="'.$xm_hl_string[4];
  254.                   $xm_hl_style .='" style="behavior:url(include/z_WaveText.htc);color:#FF5500;background-color:transparent">';
  255.                       $thread[subject]=$xm_hl_style.$thread[subject].'</font>';
  256.                       break;                     
  257.            case 4:
  258.                   $xm_hl_style  = '<font textcolor="#'.$xm_hl_string[1].'" basesize="12" textsize1="'.$xm_hl_string[2];
  259.                   $xm_hl_style .='" textsize2="14" speed="'.$xm_hl_string[3].'" letters1="1" letters2="1" pause="'.$xm_hl_string[4];
  260.                   $xm_hl_style .='" style="behavior:url(include/z_ResizeText.htc);color:#993300;background-color:transparent;">';
  261.                       $thread[subject]=$xm_hl_style.$thread[subject].'</font>';
  262.                       break;                           
  263.            case 5:
  264.                   $xm_hl_style  = '<span style=\'border:solid 1px #'.$xm_hl_string[1].';border-left-width:5px;border-left-color:#'.$xm_hl_string[1];
  265.                   $xm_hl_style .=';background:#ffffff;padding:1px 5px 2px 5px;font-size: 8pt\'><font color="#'.$xm_hl_string[2];
  266.                   $xm_hl_style .='">';
  267.                       $thread[subject]=$xm_hl_style.$thread[subject].'</font></span>';
  268.                       break;
  269.            case 6:
  270.                   $start_str=substr($thread[subject],0,$xm_hl_string[2]);
  271.                   $end_str=substr($thread[subject],$xm_hl_string[2]);
  272.                   if($xm_hl_string[3])
  273.                   $thread[subject]  = '<font color="'.$xm_hl_string[1].'">'.$start_str.'</font><font color="'.$xm_hl_string[3].'">'.$end_str.'</font>';                     
  274.               else
  275.               $thread[subject]  = '<font color="'.$xm_hl_string[1].'">'.$start_str.'</font>'.$end_str;
  276.               break;
  277.            case 7:
  278.                   $xm_hl_style  = '<font style="filter: glow(color=#'.$xm_hl_string[1].',strength='.$xm_hl_string[2];
  279.                   $xm_hl_style .='); height:20px; color: #'.$xm_hl_string[3];
  280.                   $xm_hl_style .='">';
  281.                       $thread[subject]=$xm_hl_style.$thread[subject].'</font>';
  282.                       break;
  283.            case 8:
  284.                   $xm_hl_style  = '<font style="filter: shadow(color=#'.$xm_hl_string[1].',direction='.$xm_hl_string[2];
  285.                   $xm_hl_style .='); height:20px; color: #'.$xm_hl_string[3];
  286.                   $xm_hl_style .='">';
  287.                       $thread[subject]=$xm_hl_style.$thread[subject].'</font>';
  288.                       break;
  289.            case 9:
  290.                   $xm_hl_style  = '<font style="background-color: #'.$xm_hl_string[1].';" color="#'.$xm_hl_string[2].'"><b>';
  291.                   $thread[subject]=$xm_hl_style.$thread[subject].'</b></font>';
  292.                       break;                                            
  293.            case 10:                  
  294.                       $thread[subject]='<span style="behavior:url(./include/rainbow.htc)">'.$thread[subject].'</span>';
  295.                       break;              
  296.          default:  $thread[subject]=$thread[subject];   
  297.                    }   
  298.         
  299.         
  300.         }
  301. //=====八种自定义参数标题醒目+任意颜色高亮==end==By lu5266=====================
  302.         if($thread['closed']) {
  303.                 $thread['new'] = 0;
  304.                 if($thread['closed'] > 1) {
  305.                         $thread['moved'] = $thread['tid'];
  306.                         $thread['tid'] = $thread['closed'];
  307.                         $thread['replies'] = '-';
  308.                         $thread['views'] = '-';
  309.                 } else {
  310.                         $thread['moved'] = 0;
  311.                 }
  312.                 $thread['folder'] = 'lock_folder.gif';
  313.         } else {
  314.                 $thread['folder'] = 'folder.gif';
  315.                 if($lastvisit < $thread['lastpost'] && !strstr($_COOKIE['oldtopics'], "\t$thread[tid]\t")) {
  316.                         $thread['new'] = 1;
  317.                         $thread['folder'] = 'red_'.$thread['folder'];
  318.                 } else {
  319.                         $thread['new'] = 0;
  320.                 }
  321.                 if($thread['replies'] > $thread['views']) {
  322.                         $thread['views'] = $thread['replies'];
  323.                 }
  324.                 if($thread['replies'] >= $hottopic) {
  325.                         $thread['folder'] = 'hot_'.$thread['folder'];
  326.                 }
  327.         }

  328.         if($thread['attachment']) {
  329.                 $thread['attachment'] = attachtype($thread['attachment']).' ';
  330.         } else {
  331.                 $thread['attachment'] = '';
  332.         }
  333.        //$thread[subject] = cutstr($thread[subject],77);
  334.         $thread['dateline'] = gmdate($dateformat, $thread['dateline'] + $timeoffset * 3600);
  335.         $thread['lastpost'] = gmdate("$dateformat $timeformat", $thread['lastpost'] + $timeoffset * 3600);

  336.         if($thread['displayorder'] > 0) {
  337.                 $separatepos++;
  338.         }
  339. }

  340. ?>
复制代码
回复

使用道具 举报

西龙 发表于 2005-11-11 17:01:51 | 显示全部楼层
Discuz! info: MySQL Query Error

User: ﹁纒
Time: 2005-11-11 5:03pm
Script: /bbs/topicadmin.php

SQL: UPDATE threads SET xm_hl='2,FFFF00,FFCC99,100,500' WHERE tid='290'
Error: Unknown column 'xm_hl' in 'field list'
程序文件跟数据库有冲突,请使用正确的程序文件上传上去覆盖

Similar error report has beed dispatched to administrator before.



这个是什么问题?
回复

使用道具 举报

西龙 发表于 2005-11-11 17:06:10 | 显示全部楼层
我的天啊`````````````
回复

使用道具 举报

西龙 发表于 2005-11-11 17:06:33 | 显示全部楼层
原帖由 西龙 于 2005-11-11 17:01 发表
Discuz! info: MySQL Query Error

User: ﹁纒
Time: 2005-11-11 5:03pm
Script: /bbs/topicadmin.php

SQL: UPDATE threads SET xm_hl='2,FFFF00,FFCC99,100,500' WHERE tid='290'
Error: Unknown column ...

````````````````````
回复

使用道具 举报

 楼主| lu5266 发表于 2005-11-11 17:11:06 | 显示全部楼层
原帖由 西龙 于 2005-11-11 17:06 发表
我的天啊`````````````



数据库

你还没升级呢

就是第一步啊
回复

使用道具 举报

西龙 发表于 2005-11-11 17:17:23 | 显示全部楼层
升级过拉
在安装前就升过了
Discuz! info: MySQL Query Error

User: ﹁纒
Time: 2005-11-11 5:18pm
Script: /bbs/topicadmin.php

SQL: UPDATE threads SET xm_hl='2,FFFF00,FFCC99,200,500' WHERE tid='290'
Error: Unknown column 'xm_hl' in 'field list'
程序文件跟数据库有冲突,请使用正确的程序文件上传上去覆盖

Similar error report has beed dispatched to administrator before.
回复

使用道具 举报

 楼主| lu5266 发表于 2005-11-11 17:43:24 | 显示全部楼层
原帖由 西龙 于 2005-11-11 17:17 发表
升级过拉
在安装前就升过了
Discuz! info: MySQL Query Error

User: ﹁纒
Time: 2005-11-11 5:18pm
Script: /bbs/topicadmin.php

SQL: UPDATE threads SET xm_hl='2,FFFF00,FFCC99,200,500' WHERE tid= ...


我感觉你没升级

  1. Unknown column 'xm_hl' in 'field list'
复制代码


这个就是说明


你pm给 管理员的帐号我看下
回复

使用道具 举报

西龙 发表于 2005-11-11 18:03:44 | 显示全部楼层
恩。pm給你了`
回复

使用道具 举报

 楼主| lu5266 发表于 2005-11-11 19:05:05 | 显示全部楼层
原帖由 西龙 于 2005-11-11 18:03 发表
恩。pm給你了`


收到
回复

使用道具 举报

 楼主| lu5266 发表于 2005-11-11 19:22:09 | 显示全部楼层
原帖由 西龙 于 2005-11-11 18:03 发表
恩。pm給你了`




ok了

因为你的数据库前缀名不是默认的(你一个mysql同时安装两个论坛)
所以出错

现在已经解决了

http://www.nanquanmama.net/bbs/forumdisplay.php?fid=18&page=0
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-29 23:52 , Processed in 0.108651 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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