mastergtx โพสต์ 2008-6-8 10:06:54

[Bug Fix] SATILing Toplist สำหรับ 6.1 ครับ ( 8-06-2008)

Style name SATILing Toplist สำหรับ 6.1Applicable version Discuz 6.1.0
Language coding UTF-8Toplist by
SATILingCopyright com-bannok.comเมื่อ22 พ.ค. 2551
Support site http://board.com-bannok.com/index.php



แก้ไขดังนี้ครับ
- ตัวสคริปต์ในส่วนของไฟล์ index.php เปลี่ยนทั้งแผง
- แก้รูปส่วนตัวให้แสดงในหน้าแรกแล้วครับตัวอย่าง
- ใส่เส้นให้มันดูดีขึ้นดังรูป
- และอื่นๆ

อัพโหลดไฟล์ดังนี้
/pic.php
/templates/xxx
/images/focus.swf
/images/listbg_li.gif
/images/rank.gif
/images/xxx

แกไขไฟล์ ควรแบ็คอัพไว้ก่อนกันเดี้ยง เปิดไฟล์ index.php แล้วหา$newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;วางโค้ดนี้ด้านล้างครับ//----start SATILing
$colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
//????
$hack_cut_str = 20; //????????
$hack_cut_strauthor = 9;
$new_post_threadlist = array();
$nthread = array();
$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 (0) AND t.displayorder not in (-1,-2) ORDER BY t.dateline DESC LIMIT 0, 10");
while($nthread = $db->fetch_array($query)) {
      $nthread['forumname'] = ereg_replace('<[^>]*>','',$nthread['name']);
      $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
      $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
      $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
      $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread + ($timeoffset * 3600));
      if($nthread['highlight']) {
                $string = sprintf('%02d', $nthread['highlight']);
                $stylestr = sprintf('%03b', $string);
                $nthread['highlight'] = 'style="';
                $nthread['highlight'] .= $stylestr ? 'font-weight: bold;' : '';
                $nthread['highlight'] .= $stylestr ? 'font-style: italic;' : '';
                $nthread['highlight'] .= $stylestr ? 'text-decoration: underline;' : '';
                $nthread['highlight'] .= $string ? 'color: '.$colorarray[$string] : '';
                $nthread['highlight'] .= '"';
      } else {
                $nthread['highlight'] = '';
      }
      $new_post_threadlist[] = $nthread;
}

//??????
$hack_cut_str = 20; //????????
$hack_cut_strauthor = 9;
$new_reply_threadlist = array();
$rthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fidAND t.closed NOT LIKE 'moved|%' AND t.replies !=0 AND f.fid not in (0) AND t.displayorder not in (-1,-2) ORDER BY t.lastpost DESC LIMIT 0, 10");
while($rthread = $db->fetch_array($query)) {
      $rthread['forumname'] = ereg_replace('<[^>]*>','',$rthread['name']);
      $rthread['view_subject'] = cutstr($rthread['subject'],$hack_cut_str);
      $rthread['view_lastposter'] = cutstr($rthread['lastposter'],$hack_cut_strauthor);
                $rthread['date']= gmdate("$dateformat $timeformat", $rthread['dateline'] + $timeoffset * 3600);
      $rthread['lastreplytime']= gmdate("$dateformat $timeformat", $rthread + ($timeoffset * 3600));
      if($rthread['highlight']) {
                $string = sprintf('%02d', $rthread['highlight']);
                $stylestr = sprintf('%03b', $string);
                $rthread['highlight'] = 'style="';
                $rthread['highlight'] .= $stylestr ? 'font-weight: bold;' : '';
                $rthread['highlight'] .= $stylestr ? 'font-style: italic;' : '';
                $rthread['highlight'] .= $stylestr ? 'text-decoration: underline;' : '';
                $rthread['highlight'] .= $string ? 'color: '.$colorarray[$string] : '';
                $rthread['highlight'] .= '"';
      } else {
                $rthread['highlight'] = '';
      }
      $new_reply_threadlist[] = $rthread;
}

//????
$hack_cut_str = 20; //????????
$hack_cut_strauthor = 9;
$new_hot_threadlist = array();
$mthread = array();
$ctime=$timestamp-3600*24*7;//????7????????????
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fidAND t.closed NOT LIKE 'moved|%' AND t.replies !=0 AND t.dateline>$ctime AND f.fid not in (0) AND t.displayorder not in (-1,-2) ORDER BY t.replies DESC LIMIT 0, 10");
while($mthread = $db->fetch_array($query)) {
      $mthread['forumname'] = ereg_replace('<[^>]*>','',$mthread['name']);
      $mthread['view_subject'] = cutstr($mthread['subject'],$hack_cut_str);
      $mthread['view_lastposter'] = cutstr($mthread['lastposter'],$hack_cut_strauthor);
                $mthread['date']= gmdate("$dateformat $timeformat", $mthread['dateline'] + $timeoffset * 3600);
      $mthread['lastreplytime']= gmdate("$dateformat $timeformat", $mthread + ($timeoffset * 3600));
      if($mthread['highlight']) {
                $string = sprintf('%02d', $mthread['highlight']);
                $stylestr = sprintf('%03b', $string);
                $mthread['highlight'] = 'style="';
                $mthread['highlight'] .= $stylestr ? 'font-weight: bold;' : '';
                $mthread['highlight'] .= $stylestr ? 'font-style: italic;' : '';
                $mthread['highlight'] .= $stylestr ? 'text-decoration: underline;' : '';
                $mthread['highlight'] .= $string ? 'color: '.$colorarray[$string] : '';
                $mthread['highlight'] .= '"';
      } else {
                $mthread['highlight'] = '';
      }
      $new_hot_threadlist[] = $mthread;
}

//????????????
$tomonth=date(n);
$todate=date(j);
$toyear=date(Y);
$time=mktime(0,0,0,$tomonth,$todate,$toyear);
$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,10");
while($result=$db->fetch_array($query)){
      $poststar.="<div style=\"overflow: hidden;height: 20px;width: 100%;\"><a href=space.php?uid=".$result.">".cutstr($result,8)."</a><font color=red>[".$result."]</font></div>";
}
//----End SATILingSave

เปิดไฟล์ header.htm ของสกินที่คุณใช้ ขึ้นมาแล้วหา<script type="text/javascript" src="include/javascript/common.js"></script>วางโค้ดนี้ด้านบนครับ<link href="{IMGDIR}/css.css" rel="stylesheet" type="text/css" />หา</head>วางโค้ดนี้ด้านบนครับ<style type="text/css">
.style5 {
    border-collapse: collapse;
    background-image: url('{IMGDIR}/foot.jpg');}
.style6 {
    border-collapse: collapse;}
.style7 {
    text-align: left;
    background-image: url('{IMGDIR}/1.png');}
.style8 {
    text-align: center;
    background-image: url('{IMGDIR}/3.png');}
.style9 {
    text-align: right;
    background-image: url('{IMGDIR}/2.png');}
</style>
<script language="javascript">
function setTab(area,id) {
    var tabArea=document.getElementById(area);

    var contents=tabArea.childNodes;
    for(i=0; i<contents.length; i++) {
      if(contents.className=='tabcontent'){contents.style.display='none';}
    }
    document.getElementById(id).style.display='';

    var tabs=document.getElementById(area+'tabs').getElementsByTagName('span');
    for(i=0; i<tabs.length; i++) { tabs.className=''; }
    document.getElementById(id+'tab').className='active';
}
</script>เปิดไฟล์ css_common.htm ของสกินที่คุณใช้ ขึ้นมาแล้วหา#threadtypes table td, #threadtypes table th { border-top: 1px solid {BGBORDER}; border-bottom: 0;}วางโค้ดนี้ด้านล้างครับ
#button1 { border-style: solid; border-width: 0; background: url(images/dz_back/login_lo.gif); width:61px; height:63px; }
#button2 { border-style: solid; border-width: 0; background: url(images/dz_back/login_lo1.gif); width:54px; height:63px; }images/dz_back/login_lo.gif :: เปลี่ยนให้ตรงกับโฟลเดอร์สกินของคุณใช้

เปิดไฟล์ discuz.htm ของสกินที่คุณใช้ หา<!--{if $admode && empty($insenz['hardadstatus']) && !empty($advlist['text'])}--><div class="ad_text" id="ad_text"><table summary="Text Ad" cellpadding="0" cellspacing="1">$advlist</table></div><!--{else}--><div id="ad_text"></div><!--{/if}-->วางโค้ดนี้ด้านล้างครับ<div style="border:1px solid {BORDERCOLOR};margin-top:10px; margin-bottom:5px; padding-bottom:10px"
>
<div style=" background:url(images/wind/header_bg.gif) ; height:31px">
<span class="headactions">
               
      
<img id="category_toplist_img" src="{IMGDIR}/collapsed_no.gif" title="{lang spread}"

alt="{lang spread}" />
      </span>
<span class="headactions"><b><a href="http://www.tmd.go.th/index.php" target="bank_"><font color=#375368>สภาพอากาศวันนี้</font></a></b></span>      
<h3 style="padding-top:6px"><font color=#375368>    สถิติของกระดานข่าว และรูปจากกระดาน</font></h3>      

</div>
<divstyle="height:241px; padding-top:3px" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td style="padding-right:5px; padding-left:4px">
    <div id="hotarticle" style="width:350px; float:left; height:auto">
                        <p id="hotarticletabs">
                        
                        <span id="rggtab" style="margin-right:0px">         
<img src="{IMGDIR}/a04.gif" align="absmiddle"/>ประกาศ</span>
                        
                        <span id="rjstab">
                <img src="{IMGDIR}/a03.gif" align="absmiddle"/>เมนูสมาชิก</span>
                        
                        <span id="rhdtab" class="active"><img
src="{IMGDIR}/a02.gif" align="absmiddle"/>รูปจากกระดาน</span>

                        
                        </p>
                        
                        <h3 style="margin-left:1px">¡¡</h3>
                        <ul id="rhd" class="tabcontent" style="border:1px solid #9DB3C5;
border-top:none;margin-left:1px;">
<script type="text/javascript" src="pic.php"></script>
                        </ul>
                        <ul id="rjs" class="tabcontent" style="display: none;border:1px solid #9DB3C5;
border-top:none;margin-left:1px">
{template index_dl}
                        </ul>
                        <ul id="rgg" class="tabcontent" style="display: none;border:1px solid #9DB3C5;
border-top:none;margin-left:1px ">

{template index_gg}
                        </ul>
      </div></td>
    <td width="100%">
    <div style="float:right; height:auto;padding-top:0px; width:100%">
<tablealign="right" width="100%" border="0" cellpadding="0" >
<tr>
    <td width="33%">{template new}</td>
    <td width="33%">{template rep}</td>

    <td width="33%" style="padding-right:5px">{template hot}</td>
</tr>
</table>
</div></td>
</tr>
</table>
</div>
</div>

========================================

อธิบายวิธีติดตั้งละเอียดนิดนึง หวังว่าจะเข้าใจมากขึ้นนะ:lol

อัพโหลดไฟล์ไปไว้ที่โฟลเดอร์ของสกิน ที่ตรงกับการแก้ไขไฟล์ของสกินนั้นๆ นะครับ เรียบร้อยอัพเดทแคช

[ แก้ไขล่าสุด mastergtx เมื่อ 2008-6-8 10:22 ]

acaz โพสต์ 2008-6-8 10:17:40

ขอบคุณมากครับผม

mastergtx โพสต์ 2008-6-8 10:30:53

:lol -*-

ข้างบนเป็นตัวติดตั้งใหม่ สำหรับแก้บัคคนที่เล่นก่อนหน้านี้แล้ว แก้ 2 จุดเองคือ
- index_dl.htm เปิดไฟล์ขึ้นมาหา<A href="memcp.php?action=profile&typeid=4" border="0" height="50" title="แก้ไขข้อมูลส่วนตัว" align="absmiddle" id="avatarlogin">$avatar</A>เปลี่ยนเป็น<A href="memcp.php?action=profile&typeid=4" border="0" height="50" title="แก้ไขข้อมูลส่วนตัว" align="absmiddle" id="avatarlogin"><img src="{echo discuz_uc_avatar($discuz_uid)}"/></A>- discuz.htm หา<div id="blank" style="height:245px">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td style="padding-right:5px"><div id="hotarticle" style="width:350px; float:left; height:auto">
            <p id="hotarticletabs">
            
            <span id="rggtab" onMouseOver="setTab('hotarticle','rgg')" style="margin-right:0px">   <img src="{IMGDIR}/a04.gif" align="absmiddle"/>กระทู้สำคัญ </span>
            
            <span id="rjstab" onMouseOver="setTab('hotarticle','rjs')">
      <img src="{IMGDIR}/a03.gif" align="absmiddle"/>เมนูสมาชิก</span>
            
            <span id="rhdtab" class="active" onMouseOver="setTab('hotarticle','rhd')"><img src="{IMGDIR}/a02.gif" align="absmiddle"/>รูปจากกระดาน</span>
            
            </p>
            
            <h3 style="margin-left:1px">¡¡</h3>
            <ul id="rhd" class="tabcontent" style="border:1px solid #9db3c5; border-top:none;margin-left:1px;">
<script type="text/javascript" src="pic.php"></script>
            </ul>
            <ul id="rjs" class="tabcontent" style="display: none;border:1px solid #9db3c5; border-top:none;margin-left:1px">
{template index_dl}
            </ul>
            <ul id="rgg" class="tabcontent" style="display: none;border:1px solid #9db3c5; border-top:none;margin-left:1px ">

{template index_gg}
            </ul>
    </div></td>
    <td width="100%"><div style="float:right; height:auto;padding-top:0px; width:100%">
<tablealign="right" width="100%" border="0" cellpadding="0" >
<tr>
    <td width="33%">{template new}</td>
    <td width="33%">{template rep}</td>
    <td width="33%">{template hot}</td>
</tr>
</table>
</div></td>
</tr>
</table>
</div>เปลี่ยนเป็น
<div style="border:1px solid {BORDERCOLOR};margin-top:10px; margin-bottom:5px; padding-bottom:10px"
>
<div style=" background:url(images/wind/header_bg.gif) ; height:31px">
<span class="headactions">
               
      
<img id="category_toplist_img" src="{IMGDIR}/collapsed_no.gif" title="{lang spread}"

alt="{lang spread}" />
      </span>
<span class="headactions"><b><a href="http://www.tmd.go.th/index.php" target="bank_"><font color=#375368>สภาพอากาศวันนี้</font></a></b></span>      
<h3 style="padding-top:6px"><font color=#375368>    สถิติของกระดานข่าว และรูปจากกระดาน</font></h3>      

</div>
<divstyle="height:241px; padding-top:3px" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td style="padding-right:5px; padding-left:4px">
    <div id="hotarticle" style="width:350px; float:left; height:auto">
                        <p id="hotarticletabs">
                        
                        <span id="rggtab" style="margin-right:0px">         
<img src="{IMGDIR}/a04.gif" align="absmiddle"/>ประกาศ</span>
                        
                        <span id="rjstab">
                <img src="{IMGDIR}/a03.gif" align="absmiddle"/>เมนูสมาชิก</span>
                        
                        <span id="rhdtab" class="active"><img
src="{IMGDIR}/a02.gif" align="absmiddle"/>รูปจากกระดาน</span>

                        
                        </p>
                        
                        <h3 style="margin-left:1px">¡¡</h3>
                        <ul id="rhd" class="tabcontent" style="border:1px solid #9DB3C5;
border-top:none;margin-left:1px;">
<script type="text/javascript" src="pic.php"></script>
                        </ul>
                        <ul id="rjs" class="tabcontent" style="display: none;border:1px solid #9DB3C5;
border-top:none;margin-left:1px">
{template index_dl}
                        </ul>
                        <ul id="rgg" class="tabcontent" style="display: none;border:1px solid #9DB3C5;
border-top:none;margin-left:1px ">

{template index_gg}
                        </ul>
      </div></td>
    <td width="100%">
    <div style="float:right; height:auto;padding-top:0px; width:100%">
<tablealign="right" width="100%" border="0" cellpadding="0" >
<tr>
    <td width="33%">{template new}</td>
    <td width="33%">{template rep}</td>

    <td width="33%" style="padding-right:5px">{template hot}</td>
</tr>
</table>
</div></td>
</tr>
</table>
</div>
</div>

เรียบร้อย

[ แก้ไขล่าสุด mastergtx เมื่อ 2008-6-8 10:32 ]

buachompoox โพสต์ 2008-6-8 10:34:17

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

aueeua โพสต์ 2008-12-7 16:45:46

ขอบคุณมากครับ
หน้า: [1]
ดูในรูปแบบกติ: [Bug Fix] SATILing Toplist สำหรับ 6.1 ครับ ( 8-06-2008)