举个例子:
HTM文件:
复制内容到剪贴板
代码:
<DIV class=WXTEACHER_NO5_Right>
<DIV class=WXTEACHER_NO5_Right_Baby>
<DIV class=Title>
<UL>
<LI><SPAN class=WXTEACHER_NO5_Right_Baby_Nav id=Baby16_Title0
onmouseover="Baby16('0')"><A href="forumdisplay.php?fid=201" target=_blank>化工机械</a></SPAN> </LI>
<LI><SPAN class=WXTEACHER_NO5_Right_Baby_Nav_Current id=Baby12_Title1
onmouseover="Baby16('1')"><A href="forumdisplay.php?fid=285" target=_blank>重型机械</a></SPAN> </LI>
<LI><SPAN class=WXTEACHER_NO5_Right_Baby_Nav_Current id=Baby12_Title2
onmouseover="Baby16('2')"><A href="forumdisplay.php?fid=304" target=_blank>建筑机械</a></SPAN> </LI></UL></DIV>
<DIV class=List id=Baby16_Main0>
<UL>
<!--{loop $fid1129_new_post_threadlist $nthread}-->
<li><span>$nthread[author]</span><a href="viewthread.php?tid=$nthread[tid]" target="_blank" $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></li>
<!--{/loop}-->
</UL></DIV>
<DIV class=List id=Baby16_Main1 style="DISPLAY: none">
<UL>
<!--{loop $fid1130_new_post_threadlist $nthread}-->
<li><span>$nthread[author]</span><a href="viewthread.php?tid=$nthread[tid]" target="_blank" $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></li>
<!--{/loop}--></UL></DIV>
<DIV class=List id=Baby16_Main2 style="DISPLAY: none">
<UL>
<!--{loop $fid1131_new_post_threadlist $nthread}-->
<li><span>$nthread[author]</span><a href="viewthread.php?tid=$nthread[tid]" target="_blank" $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></li>
<!--{/loop}-->
</UL></DIV>
</DIV></DIV></DIV>PHP文件:
复制内容到剪贴板
代码:
//调用化工机械、压力容器及工程管道新贴//
$hack_cut_str =30; //修改标题显示字数
$hack_cut_strauthor = 9;
$fid1129_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 in (201) AND t.displayorder not in (-1,-2) ORDER BY t.dateline DESC LIMIT 0, 10");
while($nthread = $db->fetch_array($query)) {
$nthread['forumname'] = $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[lastpost] + ($timeoffset * 3600));
if($nthread['highlight']) {
$string = sprintf('%02d', $nthread['highlight']);
$stylestr = sprintf('%03b', $string[0]);
$nthread['highlight'] = 'style="';
$nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
$nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
$nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
$nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
$nthread['highlight'] .= '"';
} else {
$nthread['highlight'] = '';
}
$fid1129_new_post_threadlist[] = $nthread;
}
//完毕//
//调用重型机械及特种机械新贴//
$hack_cut_str =30; //修改标题显示字数
$hack_cut_strauthor = 9;
$fid1130_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 in (285) AND t.displayorder not in (-1,-2) ORDER BY t.dateline DESC LIMIT 0, 10");
while($nthread = $db->fetch_array($query)) {
$nthread['forumname'] = $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[lastpost] + ($timeoffset * 3600));
if($nthread['highlight']) {
$string = sprintf('%02d', $nthread['highlight']);
$stylestr = sprintf('%03b', $string[0]);
$nthread['highlight'] = 'style="';
$nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
$nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
$nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
$nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
$nthread['highlight'] .= '"';
} else {
$nthread['highlight'] = '';
}
$fid1130_new_post_threadlist[] = $nthread;
}
//调用建筑机械、建筑科学及建设工程技术新贴//
$hack_cut_str =30; //修改标题显示字数
$hack_cut_strauthor = 9;
$fid1131_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 in (304) AND t.displayorder not in (-1,-2) ORDER BY t.dateline DESC LIMIT 0, 10");
while($nthread = $db->fetch_array($query)) {
$nthread['forumname'] = $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[lastpost] + ($timeoffset * 3600));
if($nthread['highlight']) {
$string = sprintf('%02d', $nthread['highlight']);
$stylestr = sprintf('%03b', $string[0]);
$nthread['highlight'] = 'style="';
$nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
$nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
$nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
$nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
$nthread['highlight'] .= '"';
} else {
$nthread['highlight'] = '';
}
$fid1131_new_post_threadlist[] = $nthread;
}
//完毕//JS文件:
复制内容到剪贴板
代码:
//亲16
function Baby16(id)
{
for (var i = 0;i < 3;i++)
{
var searchtitle = document.getElementById("Baby16_Title" + i);
var searchmain = document.getElementById("Baby16_Main" + i);
if (i == id)
{
searchtitle.className = 'WXTEACHER_NO5_Right_Baby_Nav';
searchmain.style.display = "";
}
else
{
searchtitle.className = 'WXTEACHER_NO5_Right_Baby_Nav_Current';
searchmain.style.display = "none";
}
}
}