本帖最后由 gu1001 于 2009-6-10 20:45 编辑
如题 求助我在首页热门标签上加了倒计时的代码 怎么不显示
<?exit?>
<!--{template header}-->
<!--{eval $ads = getad('system', 'news', '1'); }-->
<!--{if !empty($ads['pageheadad']) }-->
<div class="ad_header">$ads[pageheadad]</div>
<!--{/if}-->
</div><!--header end-->
<div id="nav">
<div class="main_nav">
<ul>
<!--{if empty($_SCONFIG['defaultchannel'])}-->
<li><a href="{S_URL}/index.php">首页</a></li>
<!--{/if}-->
<!--{loop $channels['menus'] $key $value}-->
<li <!--{if $key == 'news' }--> class="current"<!--{/if}-->><a href="$value[url]">$value[name]</a></li>
<!--{/loop}-->
</ul>
</div>
<!--{block name="category" parameter="type/news/isroot/1/order/c.displayorder/limit/0,100/cachetime/80800/cachename/category"}-->
<ul class="ext_nav clearfix">
<!--{eval $dot = '|'}-->
<!--{eval $total = count($_SBLOCK['category'])}-->
<!--{eval $i = 1;}-->
<!--{loop $_SBLOCK['category'] $value}-->
<li><a href="$value[url]">$value[name]</a><!--{if $total != $i}--> $dot <!--{/if}--></li>
<!--{eval $i++;}-->
<!--{/loop}-->
</ul>
</div><!--nav end-->
<!--{block name="spacenews" parameter="haveattach/2/showattach/1/showdetail/1/order/i.dateline DESC/limit/0,11/subjectlen/48/subjectdot/0/messagelen/170/messagedot/1/cachetime/11930/cachename/picnews"}-->
<!--{if !empty($_SBLOCK['picnews'])}-->
<!--{eval $picnews = @array_slice($_SBLOCK['picnews'], 0, 5);}-->
<!--{/if}-->
<div class="column">
<div class="col1">
<div class="clearfix">
<div class="col3">
<div id="focus_turn">
<ul id="focus_pic">
<!--{eval $j = 0}-->
<!--{loop $picnews $pkey $pvalue}-->
<!--{eval $pcurrent = ($j == 0 ? 'current' : 'normal');}-->
<li class="$pcurrent"><a href="#action/viewnews/itemid/$pvalue[itemid]#"><img src="$pvalue['a_filepath']" alt="$pvalue[subject]" /></a></li>
<!--{eval $j++}-->
<!--{/loop}-->
</ul>
<ul id="focus_tx">
<!--{eval $i = 0}-->
<!--{loop $picnews $key $value}-->
<!--{eval $current = ($i == 0 ? 'current' : 'normal');}-->
<li class="$current"><a href="$value[url]">$value[subject]</a></li>
<!--{eval $i++}-->
<!--{/loop}-->
</ul>
<div id="focus_opacity"></div>
</div><!--focus_turn end-->
</div><!--col3 end-->
<!--最新资讯-->
<!--{block name="spacenews" parameter="order/i.dateline DESC/limit/0,3/cachetime/85400/subjectlen/40/subjectdot/0/showdetail/1/messagelen/150/messagedot/1/cachename/newnews1"}-->
<div class="col4" id="hot_news">
<h3>最新资讯</h3>
<!--{loop $_SBLOCK['newnews1'] $value}-->
<div class="hot_news_list">
<h4><a href="$value[url]" title="$value[subjectall]">$value[subject]</a></h4>
<p>$value[message]</p>
</div>
<!--{/loop}-->
</div><!--col4 end-->
</div>
<!--{if !empty($ads['pagecenterad'])}-->
<div class="ad_pagebody">$ads[pagecenterad]</div>
<!--{/if}-->
<div class="catalog_list clearfix">
<!--各分类最新资讯列表-->
<!--{eval $i = 1;}-->
<!--{loop $_SBLOCK['category'] $ckey $cat}-->
<!--{eval $ctime=1800+30*$ckey;}-->
<!--{eval $cachetime = 1877+30*$ckey;}-->
<!--{block name="spacenews" parameter="catid/$cat[subcatid]/order/i.dateline DESC/limit/0,6/cachetime/$cachetime/subjectlen/36/subjectdot/0/cachename/newslist"}-->
<!--{if ($i % 2) == 0}-->
<div class="global_module box_r">
<!--{else}-->
<div class="global_module">
<!--{/if}-->
<div class="global_module1_caption"><h3>$cat[name]</h3><a href="#action/category/catid/$cat[catid]#" class="more">更多>></a></div>
<ul class="global_tx_list1">
<!--{loop $_SBLOCK['newslist'] $value}-->
<li><span class="box_r">#date('m-d', $value['dateline'])#</span><a href="$value[url]" title="$value[subjectall]">$value[subject]</a></li>
<!--{/loop}-->
</ul>
</div>
<!--{eval $i++;}-->
<!--{/loop}-->
</div>
</div><!--col1 end-->
<div class="col2">
<div id="user_login">
<script src="{S_URL}/batch.panel.php?rand={eval echo rand(1, 999999)}" type="text/javascript" language="javascript"></script>
</div><!--user_login end-->
<SCRIPT language=JavaScript1.2>
function setcountdown(theyear,themonth,theday){
yr=theyear;mo=themonth;da=theday
}
setcountdown(2009,9,19)
var occasion="2009年司法考试"
var message_on_occasion="盼望已久的时刻终于来到了!"
var countdownwidth='480px'
var countdownheight='20px'
var countdownbgcolor='tan'
var opentags='<font face="宋体"><small>'
var closetags='</small></font>'
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
var crosscount=''
function start_countdown(){
if (document.layers)
document.countdownnsmain.visibility="show"
else if (document.all||document.getElementById)
crosscount=document.getElementById&&!document.all?document.getElementById("countdownie") : countdownie
countdown()
}
if (document.all||document.getElementById)
document.write('<span id="countdownie" style="width:'+countdownwidth+'; background-
color:'+countdownbgcolor+'"></span>')
window.onload=start_countdown
function countdown(){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[mo-1]+" "+da+", "+yr
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=1&&todayd==da){
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+message_on_occasion+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+message_on_occasion+closetags
return
}
else if (dday<=-1){
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+"时间已经过了!"+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+"Occasion already passed! "+closetags
return
}
else{
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+dday+ " days, "+dhour+" hours,
"+dmin+" minutes, and "+dsec+" seconds left until "+occasion+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+"还有 "+dday+ " 天, "+dhour+" 小时, "+dmin+" 分, "+dsec+" 秒 就是
"+occasion+closetags
}
setTimeout("countdown()",1000)
}
</SCRIPT>
<ILAYER id=countdownnsmain visibility="hide" bgColor="&{countdownbgcolor};"
height="&{countdownheight};" width="&{countdownwidth};"><LAYER
id=countdownnssub height="&{countdownheight};"
width="&{countdownwidth};" top="0" left="0"></LAYER></ILAYER> <!--{block name="tag" parameter="order/spacenewsnum DESC/limit/0,30/cachetime/88008/cachename/hottag/tpl/data"}-->
<div class="global_module margin_bot10 bg_fff">
<div class="global_module2_caption"><h3>热门标签</h3></div>
<ul class="tag_list clearfix">
<!--{loop $_SBLOCK['hottag'] $value}-->
<li><a href="$value[url]">$value[tagname]</a>($value[spacenewsnum])</li>
<!--{/loop}-->
</ul>
</div>
<!--最新评论资讯显示-->
<!--{block name="spacenews" parameter="order/i.lastpost DESC/limit/0,30/subjectlen/26/subjectdot/0/cachetime/7500/cachename/newnews"}-->
<div class="global_module margin_bot10 bg_fff">
<div class="global_module2_caption"><h3>最新评论</h3></div>
<ul class="global_tx_list3">
<!--{loop $_SBLOCK['newnews'] $value}-->
<li><span class="box_r">#date('m-d', $value['lastpost'])#</span><a href="$value[url]" title="$value[subjectall]">$value[subject]</a></li>
<!--{/loop}-->
</ul>
</div>
<!--月度评论热点-->
<!--{block name="spacenews" parameter="lastpost/2592000/order/i.replynum DESC/limit/0,15/cachetime/75400/subjectlen/26/subjectdot/0/cachename/replyhot"}-->
<div class="global_module margin_bot10 bg_fff">
<div class="global_module2_caption"><h3>月度评论</h3></div>
<ul class="global_tx_list3">
<!--{loop $_SBLOCK['replyhot'] $value}-->
<li><span class="box_r">$value[replynum]</span><a href="$value[url]" title="$value[subjectall]">$value[subject]</a></li>
<!--{/loop}-->
</ul>
</div>
</div><!--col2 end-->
</div><!--column end-->
<!--{if !empty($ads['pagefootad'])}-->
<div class="ad_pagebody">$ads[pagefootad]</div>
<!--{/if}-->
<!--{if !empty($ads['pagemovead']) || !empty($ads['pageoutad'])}-->
<!--{if !empty($ads['pagemovead'])}-->
<div id="coupleBannerAdv" style="z-index: 10; position: absolute; width:100px;left:10px;top:10px;display:none">
<div style="position: absolute; left: 6px; top: 6px;">
$ads[pagemovead]
<br />
<img src="{S_URL}/images/base/advclose.gif" onMouseOver="this.style.cursor='hand'" onClick="closeBanner('coupleBannerAdv');">
</div>
<div style="position: absolute; right: 6px; top: 6px;">
$ads[pagemovead]
<br />
<img src="{S_URL}/images/base/advclose.gif" onMouseOver="this.style.cursor='hand'" onClick="closeBanner('coupleBannerAdv');">
</div>
</div>
<!--{/if}-->
<!--{if !empty($ads['pageoutad'])}-->
<div id="floatAdv" style="z-index: 10; position: absolute; width:100px;left:10px;top:10px;display:none">
<div id="floatFloor" style="position: absolute; right: 6px; bottom:-700px">
$ads[pageoutad]
</div>
</div>
<!--{/if}-->
<script type="text/javascript" src="{S_URL}/include/js/floatadv.js"></script>
<script type="text/javascript">
<!--{if !empty($ads['pageoutad'])}-->
var lengthobj = getWindowSize();
lsfloatdiv('floatAdv', 0, 0, 'floatFloor' , -lengthobj.winHeight).floatIt();
<!--{/if}-->
<!--{if !empty($ads['pagemovead'])}-->
lsfloatdiv('coupleBannerAdv', 0, 0, '', 0).floatIt();
<!--{/if}-->
</script>
<!--{/if}-->
<!--{if !empty($ads['pageoutindex'])}-->
$ads[pageoutindex]
<!--{/if}-->
<!--{if !empty($_SCONFIG['showindex'])}-->
<!--{block name="friendlink" parameter="order/displayorder/limit/0,$_SCONFIG['showindex']/cachetime/11600/namelen/32/cachename/friendlink/tpl/data"}-->
<div id="links">
<h3>友情链接</h3>
<!--{eval $imglink=$txtlink="";}-->
<!--{loop $_SBLOCK['friendlink'] $value}-->
<!--{if $value[logo]}-->
<!--{eval $imglink .= "<a href=\"".$value[url]."\" target=\"_blank\"><img src=\"".$value[logo]."\" alt=\"".$value[description]."\" border=\"0\" /></a>\n";}-->
<!--{else}-->
<!--{eval $txtlink .= "<li><a href=\"".$value[url]."\" title=\"".$value[description]."\" target=\"_blank\">".$value[name]."</a></li>\n";}-->
<!--{/if}-->
<!--{/loop}-->
<!--{if !empty($imglink)}-->
<div class="links_img">
$imglink
</div>
<!--{/if}-->
<!--{if !empty($txtlink)}-->
<div class="links_tx">
<ul class="s_clear">
$txtlink
</ul>
</div>
<!--{/if}-->
</div>
<!--{/if}-->
<!--{template footer}-->
红色部分是倒计时代码 |