veverman โพสต์ 2008-6-30 11:41:58

แก้ไขให้ 5 กระทู้ล่าสุดโชว์สีกระทู้ที่เน้น


http://www.cazdesign.com/forums/attachments/day_080523/20080523_67410dca07cab6426f98YTjX2v6khI1P.png

แก้ไขไฟล์index.php หาโค้ด คัดลอกไปที่คลิปบอร์ด

$hack_cut_str =60;
$fids = array();
if (file_exists("./forumdata/cache/cache_forums.php")){
      require_once "./forumdata/cache/cache_forums.php";
      if (is_array($_DCACHE['forums'])){
                foreach ($_DCACHE['forums'] as $k => $v){
                if (!strstr(',sub,forum,',','.$v['type'].',')) continue;
                        $fids[$k] = 5;
                }
      }
}
if (count($fids) < 1){
      $query = $db->query("SELECT fid FROM {$tablepre}forums WHERE type='forum' OR type='sub'");
      while ($row = $db->fetch_array($query)){
                $fids[$row['fid']] = 5;
      }
}
$limit_counts = 0;

foreach ($fids as $k => $v){
      $sql .= "(SELECT t.*, f.name FROM {$tablepre}threads t LEFT JOIN {$tablepre}forums f ON f.fid = t.fid WHERE t.fid='$k' AND t.closed NOT LIKE 'moved|%' AND t.displayorder>=0 ORDER BY t.dateline DESC LIMIT $v) UNION ";
}
if ($sql){
      $sql = substr($sql,0,strlen($sql)-6);
}
$query = $db->query($sql);
while ($row = $db->fetch_array($query)){
      $row['view_subject'] = cutstr($row['subject'],$hack_cut_str);
      $row['date']= gmdate("$dateformat", $row['dateline'] + $timeoffset * 3600);
      ${'new_no'.$row['fid'].'_threadlist'}[] = $row;
}

เปลี่ยนเป็น
คัดลอกไปที่คลิปบอร์ด//??????--??
$colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
$hack_cut_str =60; // ????????
$fids = array();
if (file_exists("./forumdata/cache/cache_forums.php")){
      require_once "./forumdata/cache/cache_forums.php";
      if (is_array($_DCACHE['forums'])){
                foreach ($_DCACHE['forums'] as $k => $v){
                if (!strstr(',sub,forum,',','.$v['type'].',')) continue;
                        $fids[$k] = 5; // ?????????????????????
                }
      }
}
if (count($fids) < 1){
      $query = $db->query("SELECT fid FROM {$tablepre}forums WHERE type='forum' OR type='sub'");
      while ($row = $db->fetch_array($query)){
                $fids[$row['fid']] = 5; // ?????????????????????
      }
}
$limit_counts = 0;

foreach ($fids as $k => $v){
      $sql .= "(SELECT t.*, f.name FROM {$tablepre}threads t LEFT JOIN {$tablepre}forums f ON f.fid = t.fid WHERE t.fid='$k' AND t.closed NOT LIKE 'moved|%' AND t.displayorder>=0 ORDER BY t.dateline DESC LIMIT $v) UNION ";
}
if ($sql){
      $sql = substr($sql,0,strlen($sql)-6);
}
$query = $db->query($sql);
while ($row = $db->fetch_array($query)){
      $row['view_subject'] = cutstr($row['subject'],$hack_cut_str);
      $row['date']= gmdate("$dateformat", $row['dateline'] + $timeoffset * 3600);
      if($row['highlight']) {
                        $string = sprintf('%02d', $row['highlight']);
                        $stylestr = sprintf('%03b', $string);
                        $row['highlight'] = 'style="';
                        $row['highlight'] .= $stylestr ? 'font-weight: bold;' : '';
                        $row['highlight'] .= $stylestr ? 'font-style: italic;' : '';
                        $row['highlight'] .= $stylestr ? 'text-decoration: underline;' : '';
                        $row['highlight'] .= $string ? 'color: '.$colorarray[$string] : '';
                        $row['highlight'] .= '"';
      } else {
                        $row['highlight'] = '';
      }
      ${'new_no'.$row['fid'].'_threadlist'}[] = $row;
}
//??????--??


ตัวนี้ทำงัย ทำตามแล้ว ไม่เห็นได้เลย

[ แก้ไขล่าสุด veverman เมื่อ 2008-6-30 11:46 ]

kookcoo โพสต์ 2008-6-30 15:43:55

สวยๆทั้งนั้นเลย ขอบคุณมากๆเลยครับ

ssss โพสต์ 2008-7-20 19:20:16

reeppo โพสต์ 2008-8-12 13:03:41

หุหุหุแหล่มมากมาย

mrbigbom โพสต์ 2008-8-21 22:43:32

0.0

เด็กใหม่อะก๊าบ อยากได้ยัง

ThaiAnime โพสต์ 2008-8-22 02:18:20

ไม่ทราบว่าถ้าจะใส่ shoutbox แทรก code ไว้ตรงไหนคะ? แทรกตำแหน่งเดิมแล้วใช้ไม่ได้อ่ะ

runjang โพสต์ 2008-9-3 10:37:58

:)ขอบคุณครับ

yodaji โพสต์ 2008-11-5 23:59:39

ขอบคุณครับ ว่าแต่ต้องเอาไปลงตรงไหนครับ

KhanX โพสต์ 2008-11-6 05:25:37

ขอบคุณครับ

noise007 โพสต์ 2009-1-13 02:36:16

ขอบบุญขอบคุณ
หน้า: 1 [2] 3 4
ดูในรูปแบบกติ: All Skins Artery _DZ6.1 29/07/2008