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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

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

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

回复 #128 wwtang 的帖子

  1. <?php

  2. /*
  3. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  4. :: [DISCUZ!]  Crossday Discuz! Board                                    ::
  5. :: (c) 2001-2005 Comsenz Technology Ltd ([url]www.discuz.com)[/url]                ::
  6. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  7. :: Author:  Crossday ([email]tech@discuz.com[/email]) Cnteacher ([email]cnteacher@discuz.com[/email]) ::
  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 (displayorder='3' OR 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. $query = $db->query("SELECT $dotadd1 t.* FROM $table_threads t $dotadd2 WHERE (t.displayorder='3' OR t.fid='$fid') $filteradd ORDER BY t.displayorder DESC, t.lastpost $ascdesc LIMIT $start_limit, $tpp");

  137. while($thread = $db->fetch_array($query)) {
  138.         $thread['icon'] = isset($_DCACHE['icons'][$thread['iconid']]) ? '<img src="'.SMDIR.'/'.$_DCACHE['icons'][$thread['iconid']].'" align="absmiddle">' : ' ';
  139.         $thread['lastposterenc'] = rawurlencode($thread['lastposter']);

  140.         $postsnum = $thread['replies'] + 1;
  141.         if($postsnum  > $ppp) {
  142.                 $pagelinks = '';
  143.                 $topicpages = ceil($postsnum / $ppp);
  144.                 for ($i = 1; $i <= $topicpages; $i++) {
  145.                         $pagelinks .= "<a href="viewthread.php?tid=$thread[tid]&page=$i&fpage=$page">$i</a> ";
  146.                         if($i == 6) {
  147.                                 $i = $topicpages + 1;
  148.                         }
  149.                 }
  150.                 if($topicpages > 6) {
  151.                         $pagelinks .= " .. <a href="viewthread.php?tid=$thread[tid]&page=$topicpages&fpage=$page">$topicpages</a> ";
  152.                 }
  153.                 $thread['multipage'] = '   ( <img src="'.IMGDIR.'/multipage.gif" align="absmiddle" boader="0"> '.$pagelinks.')';
  154.         } else {
  155.                 $thread['multipage'] = '';
  156.         }
  157.         if((time()-$thread['dateline'])<(24*3600)){
  158.                 $thread['multipage'] .= ' <img src="'.IMGDIR.'/new.gif">';
  159.         }

  160.         if($thread['highlight']) {
  161.                 $string = sprintf('%02d', $thread['highlight']);
  162.                 $stylestr = sprintf('%03b', $string[0]);

  163.                 $thread['highlight'] = 'style="';
  164.                 $thread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
  165.                 $thread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
  166.                 $thread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
  167.                 $thread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
  168.                 $thread['highlight'] .= '"';
  169.         } else {
  170.                 $thread['highlight'] = '';
  171.         }

  172. //=====八种自定义参数标题醒目+任意颜色高亮==start==By www.5466.ik8.com==============


  173.    $thread[subject] = cutstr($thread[subject],77);  
  174.    if($thread['xm_hl']) {
  175.         
  176.            $xm_hl_string=explode(',',$thread['xm_hl']);
  177.            
  178.            switch($xm_hl_string[0]){
  179.            
  180.            case 1:
  181.                   $xm_hl_style  = '<font style="';
  182.                   $xm_hl_style .= $xm_hl_string[1] ? 'color: #'.$xm_hl_string[1].'; ' : '';        
  183.                       $xm_hl_style .= $xm_hl_string[2] ? 'font-weight: bold;' : '';
  184.                       $xm_hl_style .= $xm_hl_string[3] ? 'font-style: italic;' : '';
  185.                       $xm_hl_style .= $xm_hl_string[4] ? 'text-decoration: underline;' : '';               
  186.                       $xm_hl_style .= '">';
  187.                       $thread[subject]=$xm_hl_style.$thread[subject].'</font>';
  188.                       break;
  189.            case 2:
  190.                   $xm_hl_style  = '<font textcolor1="#'.$xm_hl_string[1].'"  textbkcolor1="transparent" textcolor2="#'.$xm_hl_string[2];
  191.                   $xm_hl_style .='" textbkcolor2="transparent" speed="'.$xm_hl_string[3].'" letters1="1" letters2="1" pause="'.$xm_hl_string[4];
  192.                   $xm_hl_style .='" style="behavior:url(include/z_FlashText.htc);color:#c000c0;background-color:transparent">';
  193.                       $thread[subject]=$xm_hl_style.$thread[subject].'</font>';
  194.                       break;
  195.            case 3:
  196.                   $xm_hl_style  = '<font textoffset1="'.$xm_hl_string[1].'" textoffset2="'.$xm_hl_string[2];
  197.                   $xm_hl_style .='" speed="'.$xm_hl_string[3].'" letters1="1" letters2="1" pause="'.$xm_hl_string[4];
  198.                   $xm_hl_style .='" style="behavior:url(include/z_WaveText.htc);color:#FF5500;background-color:transparent">';
  199.                       $thread[subject]=$xm_hl_style.$thread[subject].'</font>';
  200.                       break;                     
  201.            case 4:
  202.                   $xm_hl_style  = '<font textcolor="#'.$xm_hl_string[1].'" basesize="12" textsize1="'.$xm_hl_string[2];
  203.                   $xm_hl_style .='" textsize2="14" speed="'.$xm_hl_string[3].'" letters1="1" letters2="1" pause="'.$xm_hl_string[4];
  204.                   $xm_hl_style .='" style="behavior:url(include/z_ResizeText.htc);color:#993300;background-color:transparent;">';
  205.                       $thread[subject]=$xm_hl_style.$thread[subject].'</font>';
  206.                       break;                                            

  207.            case 5:
  208.                   $xm_hl_style  = '<span style=\'border:solid 1px #'.$xm_hl_string[1].';border-left-width:5px;border-left-color:#'.$xm_hl_string[1];
  209.                   $xm_hl_style .=';background:#ffffff;padding:1px 5px 2px 5px;font-size: 8pt\'><font color="#'.$xm_hl_string[2];
  210.                   $xm_hl_style .='">';
  211.                       $thread[subject]=$xm_hl_style.$thread[subject].'</font></span>';
  212.                       break;
  213.            case 6:
  214.                   $start_str=substr($thread[subject],0,$xm_hl_string[2]);
  215.                   $end_str=substr($thread[subject],$xm_hl_string[2]);
  216.                   if($xm_hl_string[3])
  217.                   $thread[subject]  = '<font color="'.$xm_hl_string[1].'">'.$start_str.'</font><font color="'.$xm_hl_string[3].'">'.$end_str.'</font>';                     
  218.               else
  219.               $thread[subject]  = '<font color="'.$xm_hl_string[1].'">'.$start_str.'</font>'.$end_str;
  220.               break;
  221.            case 7:
  222.                   $xm_hl_style  = '<font style="filter: glow(color=#'.$xm_hl_string[1].',strength='.$xm_hl_string[2];
  223.                   $xm_hl_style .='); height:20px; color: #'.$xm_hl_string[3];
  224.                   $xm_hl_style .='">';
  225.                       $thread[subject]=$xm_hl_style.$thread[subject].'</font>';
  226.                       break;
  227.            case 8:
  228.                   $xm_hl_style  = '<font style="filter: shadow(color=#'.$xm_hl_string[1].',direction='.$xm_hl_string[2];
  229.                   $xm_hl_style .='); height:20px; color: #'.$xm_hl_string[3];
  230.                   $xm_hl_style .='">';
  231.                       $thread[subject]=$xm_hl_style.$thread[subject].'</font>';
  232.                       break;                     
  233.            case 9:                  
  234.                       $thread[subject]='<span style="behavior:url(./include/rainbow.htc)">'.$thread[subject].'</span>';
  235.                       break;              
  236.          default:  $thread[subject]=$thread[subject];   
  237.                    }   
  238.         
  239.         
  240.         }
  241. //=====八种自定义参数标题醒目+任意颜色高亮==end==By lu5266=====================
  242.         if($thread['closed']) {
  243.                 $thread['new'] = 0;
  244.                 if($thread['closed'] > 1) {
  245.                         $thread['moved'] = $thread['tid'];
  246.                         $thread['tid'] = $thread['closed'];
  247.                         $thread['replies'] = '-';
  248.                         $thread['views'] = '-';
  249.                 } else {
  250.                         $thread['moved'] = 0;
  251.                 }
  252.                 $thread['folder'] = 'lock_folder.gif';
  253.         } else {
  254.                 $thread['folder'] = 'folder.gif';
  255.                 if($lastvisit < $thread['lastpost'] && !strstr($_COOKIE['oldtopics'], "\t$thread[tid]\t")) {
  256.                         $thread['new'] = 1;
  257.                         $thread['folder'] = 'red_'.$thread['folder'];
  258.                 } else {
  259.                         $thread['new'] = 0;
  260.                 }
  261.                 if($thread['replies'] > $thread['views']) {
  262.                         $thread['views'] = $thread['replies'];
  263.                 }
  264.                 if($thread['replies'] >= $hottopic) {
  265.                         $thread['folder'] = 'hot_'.$thread['folder'];
  266.                 }
  267.         }

  268.         if($thread['attachment']) {
  269.                 require_once DISCUZ_ROOT.'./include/attachment.php';
  270.                 $thread['attachment'] = attachtype($thread['attachment']).' ';
  271.         } else {
  272.                 $thread['attachment'] = '';
  273.         }
  274.         //$thread[subject] = cutstr($thread[subject],77);
  275.         $thread['dateline'] = gmdate($dateformat, $thread['dateline'] + $timeoffset * 3600);
  276.         $thread['lastpost'] = gmdate("$dateformat $timeformat", $thread['lastpost'] + $timeoffset * 3600);

  277.         if($thread['displayorder'] > 0) {
  278.                 $separatepos++;
  279.         }
  280.         $threadlist[] = $thread;

  281. }

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

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

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

  287. include template('forumdisplay');

  288. ?>
复制代码

[ 本帖最后由 lu5266 于 2005-9-16 15:12 编辑 ]
回复

使用道具 举报

M55 发表于 2005-9-16 17:13:46 | 显示全部楼层
刚刚回来,看见兄弟又有新的作品,装与不装顶把先~~~~~~~
回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-16 17:23:47 | 显示全部楼层
原帖由 M55 于 2005-9-16 17:13 发表
刚刚回来,看见兄弟又有新的作品,装与不装顶把先~~~~~~~


哈哈

兄弟就是兄弟

回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-16 17:27:37 | 显示全部楼层
原帖由 Pteranodon 于 2005-9-15 16:24 发表
還是不行=0='''''
不知道是否其他插件相沖了T_T



解决了没

你的问题啊????
回复

使用道具 举报

M55 发表于 2005-9-16 17:29:53 | 显示全部楼层
原帖由 lu5266 于 2005-9-16 17:23 发表


哈哈

兄弟就是兄弟



9494~~看见你有新东西就高兴哈哈!!!!
回复

使用道具 举报

wwtang 发表于 2005-9-16 17:39:00 | 显示全部楼层
哈哈~~OK了~~可以用了,感谢LU5266....
回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-16 18:09:34 | 显示全部楼层
原帖由 wwtang 于 2005-9-16 17:39 发表
哈哈~~OK了~~可以用了,感谢LU5266....



呵呵
能用就好了



忙啊
回复

使用道具 举报

ygm007 发表于 2005-9-17 01:53:34 | 显示全部楼层
我也要装,一般我是去lulu的站看效果先~~
回复

使用道具 举报

pier1943 发表于 2005-9-17 02:16:31 | 显示全部楼层
这里试过好几次 都变空白页

Ⅱ:修改topicadmin.php

查找:

elseif($action == 'digest' && $allowdigest) {


在前面加上:
(注意我的注释后面不能跟其他的代码(d25本身的),否则会出错,如果有就把其换行,下面的修改都要注意这个问题)



//=====八种自定义参数标题醒目+任意颜色高亮==start==By www.5466.ik8.com==============

elseif($action == 'xm_highlight' && $allowhighlight) {
        if(!submitcheck('xm_highlightsubmit')) {
      
                $xm_hl_string=explode(',',$thread['xm_hl']);
               
...................................
回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-17 06:36:50 | 显示全部楼层
原帖由 pier1943 于 2005-9-17 02:16 发表
这里试过好几次 都变空白页

Ⅱ:修改topicadmin.php

查找:

elseif($action == 'digest' && $allowdigest) {


在前面加上:
(注意我的注释后面不能跟其他的代码(d25本身的),否则会出错,如果有 ...


把topicadmin.php和forumdisplay.php贴出来
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-7-6 17:23 , Processed in 0.123477 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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