<%
dim indexdot
'indexdot="<FONT color=#b70000>&nbsp;<B>·</B></FONT>&nbsp;"
indexdot="&nbsp;<img border=0 src='img/c3.gif' align=absmiddle>&nbsp;"
'=================================================
'过程名：index_news
'作  用：首页站点新闻调用
'参  数：num--------------调用条数
'        fontnum----------显示文字长度
'        classid---------一级分类调用id，0为全部
'        classyes--------是否显示分类，True为是，False为否
'        NewWindows------是否新窗打开，True为是，False为否
'=================================================
sub index_news(num,fontnum,classid,classyes,NewWindows)
Response.Write "<table border=0 cellspacing=0 cellpadding=0 width='100%'>" 
if classid=0 then
   sql="select top "&num&" * from news where passed=0 ORDER by news_id DESC"
else
   sql="select top "&num&" * from news where passed=0 and (cat_id="&classid&" or cat_id in(select cat_id from newcat where sid="&classid&")) order by news_id DESC"			
end if 
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
   Response.Write "<font color=""#666666"">目前尚无任何新闻！</font>"
end if
do while not rs.eof
sql="select cat_id,cat_name from newcat where cat_id="&rs("cat_id")
set rscat=server.createobject("adodb.recordset")
rscat.open sql,conn,1,1
dim nnn
if NewWindows=True then
   nnn="target='_blank'"
else
   nnn=""				
end if 
dim uclass
if classyes=True then 
   uclass="<a href='news.asp?cat_id="&rs("cat_id")&"'>［"&rscat("cat_name")&"］</a>"
else
   uclass="" 
end if
Response.Write "<tr><td>"&indexdot&uclass&"<a href='shownews.asp?news_id="&rs("news_id")&"' "& nnn &" Title='新闻名称："&rs("news_title")&"&#13&#10上传时间："&rs("news_date")&"&#13&#10浏览指数："&rs("news_count")&"'><font color="&rs("news_color")&">"&gotTopic(rs("news_title"),fontnum)&"</font></a>" & vbCrLf
Response.Write "</td><td align=right>" & vbCrLf 
Response.Write ""&Right("0"&month(rs("news_date")),2)&"/"&right("0"&day(rs("news_date")),2)&"" & vbCrLf
Response.Write "</td></tr>" & vbCrLf
rscat.close
set rscat=nothing  
rs.movenext      
loop
rs.close
set rs=nothing
Response.Write "</table>" 
end sub



'=================================================
'过程名：FlashNews
'作  用：首页新闻图片FLASH幻灯
'参  数：num--------------调用条数
'        fontnum----------显示文字长度
'        PicWidthStr--------图片宽度
'        PicHeightStr-------图片高度
'        BGcolor------------背景色
'        txtheight----------文字显示高度，0为不显示
'=================================================
Function FlashNews(num,fontnum,PicWidthStr,PicHeightStr,BGcolor,txtheight)
Dim RsFilterObj,FlashStr,ImagesStr,TxtStr,LinkStr
FilterSql = "SELECT top "&num&" * FROM news where isimg=1 and images<>'' ORDER BY news_id DESC"
Set RsFilterObj = Conn.Execute(FilterSql)
If not RsFilterObj.Eof then
  Dim Temp_Num
  Temp_Num = 0
  Do While Not RsFilterObj.Eof
  Temp_Num = Temp_Num + 1
  RsFilterObj.MoveNext
  Loop
  RsFilterObj.MoveFirst
  If Temp_Num <=1 then
  Set RsFilterObj = Nothing
  FlashNews = "至少需要两条幻灯新闻才能正确显示幻灯效果"
  Set RsFilterObj = Nothing
  Exit Function 
  End If
  do while Not RsFilterObj.Eof
   if ImagesStr = "" then
     ImagesStr = RsFilterObj("images")
     TxtStr = gotTopic(RsFilterObj("news_title"),fontnum)
     LinkStr = "shownews.asp?news_id="&RsFilterObj("news_id")
   else
     ImagesStr = ImagesStr &"|"& RsFilterObj("images")
     TxtStr = TxtStr & "|" & gotTopic(RsFilterObj("news_title"),fontnum)
     LinkStr = LinkStr & "|" & "shownews.asp?news_id="& RsFilterObj("news_id")
   end if
  RsFilterObj.MoveNext
  loop
FlashStr="<script type=""text/javascript"">"& Chr(13)
FlashStr=FlashStr&"<!--"& Chr(13)
FlashStr=FlashStr&"var focus_width="&PicWidthStr& Chr(13)   
FlashStr=FlashStr&"var focus_height="&PicHeightStr& Chr(13) 
FlashStr=FlashStr&"var text_height="&txtheight& Chr(13) 
FlashStr=FlashStr&"var swf_height = focus_height+text_height"& Chr(13)
FlashStr=FlashStr&"var pics='"&ImagesStr&"'"&Chr(13)
FlashStr=FlashStr&"var links='"&LinkStr &"'"&Chr(13)
FlashStr=FlashStr&"var texts='"&TxtStr&"'"&Chr(13)
FlashStr=FlashStr&"document.write('<object classid=""clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"" codebase=""http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"" width=""'+ focus_width +'"" height=""'+ swf_height +'"">');"&Chr(13)
FlashStr=FlashStr&"document.write('<param name=""allowScriptAccess"" value=""sameDomain""><param name=""movie"" value=""img/pic.swf""><param name=""quality"" value=""high""><param name=""bgcolor"" value="&BGcolor&">');"&Chr(13)
FlashStr=FlashStr&"document.write('<param name=""menu"" value=""false""><param name=wmode value=""opaque"">');"&Chr(13)
FlashStr=FlashStr&" document.write('<param name=""FlashVars"" value=""pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'"">');"&Chr(13)
FlashStr=FlashStr&"document.write('<embed src=""img/pic.swf"" wmode=""opaque"" FlashVars=""pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'"" menu=""false"" bgcolor="&BGcolor&" quality=""high"" width=""'+ focus_width +'"" height=""'+ swf_height +'"" allowScriptAccess=""sameDomain"" type=""application/x-shockwave-flash"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" />');"&Chr(13)
FlashStr=FlashStr&"document.write('</object>');"&Chr(13)
FlashStr=FlashStr&"//-->"& Chr(13)
FlashStr=FlashStr&"</script>"
  else
    FlashStr="没有幻灯图片"
  end if
    RsFilterObj.Close
Set RsFilterObj = Nothing
    FlashNews= FlashStr
End Function

'=================================================
'过程名：index_diary
'作  用：首页公告
'参  数：num--------------调用条数
'=================================================
sub index_diary(num)
sql="SELECT top "&num&" d_content,d_date FROM diary Where d_top=0 and (d_class=0 or d_class=1) ORDER BY d_date DESC"   
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
i=0
do while not rs.eof
i=i+1
if DateDiff("h",rs("d_date"),now())<=48 then Response.Write "<font color=red>"
Response.Write "<div><img src='img/user/sz2-"&i&".gif'>&nbsp;"&rs("d_content")&""
Response.Write "</div><div align=""right"" class=table-xia>["&year(rs("d_date"))&"-"&month(rs("d_date"))&"-"&day(rs("d_date"))&"]</div></font>" & vbCrLf
rs.movenext
loop
if rs.eof and rs.bof then
Response.Write "<font color=""#666666"">目前尚无公告！</font>"
end if
rs.close
set rs=nothing
end sub

'=================================================
'过程名：index_vote
'作  用：首页投票
'参  数：无
'=================================================
sub index_vote()
sql="select top 1 * from votetopic where datediff('d',Now(),vt_expiredate)>0 order by vt_id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof then
Response.Write "<script language=""JavaScript"" type=""text/JavaScript"">" & vbCrLf
Response.Write "<!--" & vbCrLf
Response.Write "function MM_openBrWindow(theURL,winName,features) { //v2.0" & vbCrLf
Response.Write "  window.open(theURL,winName,features);" & vbCrLf
Response.Write "}" & vbCrLf
Response.Write "//-->" & vbCrLf
Response.Write "</script>" & vbCrLf
Response.Write "<TABLE cellPadding=2 cellspacing=0 width=""100%""><TBODY><form name=""form1"" method=""post"" action=""savevote.asp?vt_id="&rs("vt_id")&"&vt_name="&rs("vt_name")&""" target=""vote"" onsubmit=""return vote()"">" & vbCrLf
Response.Write "   <TR>" & vbCrLf
Response.Write "   <TD>&nbsp;<B>"&rs("vt_name")&"</B></TD>" & vbCrLf
Response.Write "   </TR>" & vbCrLf
Response.Write "   <TR>" & vbCrLf
Response.Write "   <TD>"
sql="select * from voteitem where vt_id="&rs("vt_id")
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
Response.Write "<input type=""radio"" name=""item_id"" value="""&rs2("item_id")&""">"&rs2("item_name")&"&nbsp;["&rs2("item_count")&"]<BR>" & vbCrLf
rs2.movenext
loop
if rs2.eof and rs2.bof then
Response.Write "<TABLE cellSpacing=0 cellPadding=0 border=0 ><TR height=""120""><TD align=middle><font color=""#666666"">当前没有投票选项！</font></TD></TR></TABLE>"
end if
rs2.close
set rs2=nothing
Response.Write "</TD></TR>" & vbCrLf
Response.Write "<TR><TD align=middle>" & vbCrLf
Response.Write "<input name=""itemname"" type=""hidden"" value="""&rs("vt_name")&""">"
if request.cookies("npw")("voted")<>"yes" or request.cookies("npw")("topic")<>rs("vt_name") then
Response.Write "<input name='Submit' type='image' src='img/vote01.gif' width='59' height='19' border='0'>" & vbCrLf
else
Response.Write "<input name='Submit' type='image' disabled src='img/vote01.gif' width='59' height='19' border='0'>" & vbCrLf
end if
Response.Write "&nbsp;&nbsp;<a href=""javascript:;"" onFocus=""if(this.blur)this.blur()"" onClick=""window.open('showvote.asp?vt_id="&rs("vt_id")&"','_blank','menubar=no,toolbar=no,status=no,dependent=yes,scrollbars=no,Width=655,Height=375,top=98,left=72')""><img src='img/vote02.gif' width='59' height='19' border='0'></a>" & vbCrLf 
Response.Write "</TD></TR>" & vbCrLf
Response.Write "</FORM></TBODY></TABLE>" & vbCrLf
else
response.write "<TABLE cellSpacing=0 cellPadding=0 border=0><TR height=""160""><TD align=middle><font color=""#666666"">当前没有投票主题！</font></TD></TR></TABLE>" & vbCrLf
end if
rs.close
set rs=nothing
end sub

'=================================================
'过程名：index_pic
'作  用：首页最新图片调用
'参  数：num--------------调用条数
'        classid----------分类调用id，0为全部
'        ImgWidth   ----图片宽度
'        ImgHeight  ----图片高度
'        NewWindows------是否新窗打开，True为是，False为否
'=================================================
sub index_pic(num,classid,ImgWidth,ImgHeight,NewWindows)
Response.Write "<TABLE width='100%' cellSpacing=5 cellPadding=0 border=0 align='center'>" & vbCrLf
if classid=0 then
   sql="select top "&num&" * from pic where passed=0 ORDER by pic_id DESC"
else
   sql="select top "&num&" * from pic where passed=0 and (piccat_id="&classid&" or piccat_id in(select piccat_id from piccat where sid="&classid&")) order by pic_id DESC"			
end if 
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
dim nnn
if NewWindows=True then
   nnn="target='_blank'"
else
   nnn=""				
end if
Response.Write "<TD>"
Response.Write "<table border='0' align='center' cellpadding='0' cellspacing='0' class='img'>"
Response.Write "<tr><td align='center'><a title='图片名称："&rs("pic_name")&"&#13&#10点击次数："&rs("pic_count")&"&#13&#10上传时间："&rs("pic_date")&"' href='showpic.asp?pic_id="&rs("pic_id")&"' Title='查看详细内容' "& nnn &"><img border='0' src='"&rs("pic_spic")&"' width='"&ImgWidth&"' height='"&ImgHeight&"'></a></TD></TR>" & vbCrLf
Response.Write "</table></TD>" & vbCrLf
rs.movenext
loop
if rs.bof and rs.eof then
   Response.Write "<li>当前没有图片！</li>"
end if
rs.close
set rs=nothing
if picway=1 then Response.Write "</TR>" & vbCrLf
Response.Write "</TABLE>" & vbCrLf
end sub

'=================================================
'过程名：index_shop
'作  用：首页最新产品
'参  数：num--------------调用条数
'        fontnum----------显示标题长度
'        classid----------一级分类调用id，0为全部
'        priceyes---------是否显示价格，True为是，False为否
'        cavalcadenum-----每行显示数
'        img_width--------图片宽度
'        img_height-------图片高度
'=================================================
sub index_shop(num,fontnum,classid,priceyes,cavalcadenum,img_width,img_height)
Response.Write "<TABLE cellSpacing=3 cellPadding=1 border=0><TBODY><TR align=middle>" & vbCrLf
if classid=0 then
   sql="select top "&num&" * from shop where passed=0 ORDER by s_id DESC"
else
   sql="select top "&num&" * from shop where passed=0 and (scat_id="&classid&" or scat_id in(select scat_id from scat where sid="&classid&")) order by s_id DESC"			
end if 
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
i=0
do while not rs.eof
Response.Write "<TD>" & vbCrLf
Response.Write "<table border=0 cellspacing=0 cellpadding=0 width='138'>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td width=7><img src=img/22_1.gif border=0></td>" & vbCrLf
Response.Write "<td width=""*"" background=img/22_2.gif></td>" & vbCrLf
Response.Write "<td width=7><img src=img/22_3.gif border=0></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<TR>" & vbCrLf
Response.Write "<td background=img/22_7.gif></td>" & vbCrLf
Response.Write "<td width=""*"" align=center bgcolor=#ffffff><a href='shopView.asp?s_id="&rs("s_id")&"'><b>"&gotTopic(rs("s_name"),fontnum)&"</b></a></td>" & vbCrLf
Response.Write "<td background=img/22_8.gif></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<TR>" & vbCrLf
Response.Write "<td background=img/22_7.gif></td>" & vbCrLf
Response.Write "<td width=""*"" align=center bgcolor=#ffffff>" & vbCrLf
Response.Write "<table border='0' align='center' cellpadding='2' cellspacing='1' bgcolor='#F0F0F0'>"
Response.Write "<tr><td align='center' bgcolor='#FFFFFF'><a href='shopView.asp?s_id="&rs("s_id")&"'><img border=0 src="&rs("s_pic")&" width='"&Img_Width&"' height='"&Img_height&"'></a></td>" & vbCrLf
Response.Write "</tr></table></td>" & vbCrLf
Response.Write "<td background=img/22_8.gif></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
if priceyes=True then
Response.Write "<TR>" & vbCrLf
Response.Write "<td background=img/22_7.gif></td>" & vbCrLf
Response.Write "<td width=""*"" align=center bgcolor=#ffffff><font color='#666666'>市场价:<strike>"&FormatNumber(rs("price_1"),2)&"</strike></font></td>" & vbCrLf
Response.Write "<td background=img/22_8.gif></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<TR>" & vbCrLf
Response.Write "<td background=img/22_7.gif></td>" & vbCrLf
Response.Write "<td width=""*"" align=center bgcolor=#ffffff><font color='#006666'>会员价:"&FormatNumber(rs("price_2"),2)&"</font></td>" & vbCrLf
Response.Write "<td background=img/22_8.gif></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<TR>" & vbCrLf
Response.Write "<td background=img/22_7.gif></td>" & vbCrLf
Response.Write "<td width=""*"" align=center bgcolor=#ffffff><font color='#FF6600'>VIP 价:"&FormatNumber(rs("price_3"),2)&"</font></td>" & vbCrLf
Response.Write "<td background=img/22_8.gif></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
end if
Response.Write "<TR>" & vbCrLf
Response.Write "<td background=img/22_7.gif></td>" & vbCrLf
Response.Write "<td width=""*"" align=center bgcolor=#ffffff><a href='shopView.asp?s_id="&rs("s_id")&"'><img border=0 src=img/btn_view.gif></a>&nbsp;<a href='shop_Basket.asp?id="&rs("s_id")&"' target=""CartFrame""><img border=0 src=img/btn_buy.gif></a></td>" & vbCrLf
Response.Write "<td background=img/22_8.gif></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td width=7><img src=img/22_9.gif border=0></td>" & vbCrLf
Response.Write "<td width=""*"" background=img/22_10.gif></td>" & vbCrLf
Response.Write "<td width=7><img src=img/22_11.gif border=0></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
Response.Write "</td>" & vbCrLf
i=i+1
if i mod cavalcadenum = 0 then
Response.Write "</tr><tr>"
end if
rs.movenext
loop
if rs.bof and rs.eof then
   Response.Write "<tr><td align=""center"" valign=""middle"">当前没有产品！</td></tr>" & vbCrLf
end if
rs.close
set rs=nothing
Response.Write "</TBODY></TABLE>" & vbCrLf
end sub


'=================================================
'过程名：index_coolsites
'作  用：首页酷站推荐
'参  数：num--------------调用条数
'        classid----------分类调用id，0为全部
'        ImgWidth   ----图片宽度
'        ImgHeight  ----图片高度
'        NewWindows------是否新窗打开，True为是，False为否
'=================================================
sub index_coolsites(num,classid,ImgWidth,ImgHeight,NewWindows)
Response.Write "<TABLE width='100%' cellSpacing=5 cellPadding=0 border=0 align='center'>" & vbCrLf
if classid=0 then
   sql="select top "&num&" * from coolsites where passed=0 ORDER by cs_date DESC"
else
   sql="select top "&num&" * from coolsites where passed=0 and cscat_id="&classid&" order by cs_id DESC"			
end if 
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
dim nnn
if NewWindows=True then
   nnn="target='_blank'"
else
   nnn=""				
end if
Response.Write "<TD>"
Response.Write "<table border='0' align='center' cellpadding='0' cellspacing='0' class='img'>"
Response.Write "<tr><td align='center'><a title='图片名称："&rs("cs_name")&"&#13&#10点击次数："&rs("cs_count")&"&#13&#10站点地址："&rs("cs_url")&"' href='web.asp?action=go&cs_id="&rs("cs_id")&"' Title='查看详细内容' "& nnn &"><img border='0' src='"&rs("cs_pic")&"' width='"&ImgWidth&"' height='"&ImgHeight&"'></a></TD></TR>" & vbCrLf
Response.Write "</table></TD>" & vbCrLf
rs.movenext
loop
if rs.bof and rs.eof then
   Response.Write "<li>稍后推出！</li>"
end if
rs.close
set rs=nothing
if picway=1 then Response.Write "</TR>" & vbCrLf
Response.Write "</TABLE>" & vbCrLf
end sub


'=================================================
'过程名：index_soft
'作  用：首页下载调用
'参  数：num-------------调用条数
'        fontnum---------标题长度
'        classid---------一级分类调用id，0为全部
'        classyes--------是否显示分类，True为是，False为否
'        NewWindows------是否新窗打开，True为是，False为否
'=================================================
sub index_soft(num,fontnum,classid,classyes,NewWindows)
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 align=center border=0>" & vbCrLf
if classid=0 then
   sql="select top "&num&" * from soft where passed=0 order by soft_id DESC"
else
   sql="select top "&num&" * from soft where passed=0 and soft_catid="&classid&" order by soft_id DESC"			
end if 
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
dim nnn
if NewWindows=True then
   nnn="target='_blank'"
else
   nnn=""				
end if    
Response.Write "<TR>" & vbCrLf
Response.Write "<TD height='22' class=table-xia>"
if classyes=True then 
Response.Write "<a href='down.asp?cat_id="&rs("soft_catid")&"&class_id="&rs("soft_classid")&"'>『"&left(rs("soft_classname"),10)&"』</a>"
else
Response.Write ""&indexdot&"" 
end if
Response.Write "<a href='showdown.asp?soft_id="&rs("soft_id")&"' Title='文件名称："&rs("soft_name")&"&#13&#10下载次数："&rs("soft_dcount")&"&#13&#10上传时间："&rs("soft_joindate")&"' "& nnn &">"&gotTopic(rs("soft_name"),fontnum)&"</a>" & vbCrLf
Response.Write "</TD>" & vbCrLf
Response.Write "<TD align=right class=table-xia>" & vbCrLf
if DateDiff("h",rs("soft_joindate"),now())<=24 then Response.Write "<FONT color=red>"
Response.Write ""&Right("0"&month(rs("soft_joindate")),2)&"/"&right("0"&day(rs("soft_joindate")),2)&"</FONT>" & vbCrLf
Response.Write "</TD>" & vbCrLf
Response.Write "</TR>"
rs.movenext
loop
if rs.eof and rs.bof then
   Response.Write "<TR><TD>暂时没有软件下载</TD></TR>"
end if
rs.close
set rs=nothing
Response.Write "</TABLE>" & vbCrLf
end sub


'=================================================
'过程名：index_game
'作  用：首页游戏调用(分类图片显示)
'参  数：num-------------调用条数
'        classid---------一级分类调用id，0为全部
'        ImgWidth   ----图片宽度
'        ImgHeight  ----图片高度
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub index_game(num,classid,ImgWidth,ImgHeight,NewWindows)
Response.Write "<TABLE width='100%' cellSpacing=10 cellPadding=0  align=center border=0><TR>" & vbCrLf
if classid=0 then
   sql="select top "&num&" * from game_soft where passed=0 order by soft_id DESC"
else
   sql="select top "&num&" * from game_soft where passed=0 and soft_catid="&classid&" order by soft_id DESC"			
end if 
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
dim nnn
if NewWindows=True then
   nnn="target='_blank'"
else
   nnn=""				
end if
Response.Write "<TD>"
Response.Write "<table border='0' align='center' cellpadding='1' cellspacing='1' bgcolor='#000000'>"
Response.Write "<tr><td align='center' bgcolor='#FFFFFF'><a title='游戏名称："&rs("soft_name")&"&#13&#10查看次数："&rs("soft_rcount")&"&#13&#10上传时间："&rs("soft_joindate")&"' href='showgame.asp?soft_id="&rs("soft_id")&"' Title='查看详细内容' "& nnn &"><img border='0' src='"&rs("soft_showpic")&"' width='"&ImgWidth&"' height='"&ImgHeight&"'></a></TD></TR>" & vbCrLf
Response.Write "</table></TD>" & vbCrLf
i=i+1
if i mod 4 = 0 then
Response.Write "</tr>"
end if
rs.movenext
loop
if rs.eof and rs.bof then
Response.Write "<td align=center>暂时没有游戏</td>"
end if
rs.close
set rs=nothing
Response.Write "</TR></table>" & vbCrLf
end sub


'=================================================
'过程名：index_game_soft
'作  用：首页游戏下载调用
'参  数：num-------------调用条数
'        fontnum---------标题长度
'        classid---------一级分类调用id，0为全部
'        classyes--------是否显示分类，True为是，False为否
'        NewWindows------是否新窗打开，True为是，False为否
'=================================================
sub index_game_soft(num,fontnum,classid,classyes,NewWindows)
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 align=center border=0>" & vbCrLf
if classid=0 then
   sql="select top "&num&" * from game_soft where passed=0 order by soft_id DESC"
else
   sql="select top "&num&" * from game_soft where passed=0 and soft_catid="&classid&" order by soft_id DESC"			
end if 
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
dim nnn
if NewWindows=True then
   nnn="target='_blank'"
else
   nnn=""				
end if    
Response.Write "<TR>" & vbCrLf
Response.Write "<TD height='22' class=table-xia>"
if classyes=True then 
Response.Write "<a href='game.asp?cat_id="&rs("soft_catid")&"&class_id="&rs("soft_classid")&"'>『"&left(rs("soft_classname"),10)&"』</a>"
else
Response.Write ""&indexdot&"" 
end if
Response.Write "<a href='showgame.asp?soft_id="&rs("soft_id")&"' Title='文件名称："&rs("soft_name")&"&#13&#10下载次数："&rs("soft_dcount")&"&#13&#10上传时间："&rs("soft_joindate")&"' "& nnn &">"&gotTopic(rs("soft_name"),fontnum)&"</a>" & vbCrLf
Response.Write "</TD>" & vbCrLf
Response.Write "<TD align=right class=table-xia>" & vbCrLf
if DateDiff("h",rs("soft_joindate"),now())<=24 then Response.Write "<FONT color=red>"
Response.Write ""&Right("0"&month(rs("soft_joindate")),2)&"/"&right("0"&day(rs("soft_joindate")),2)&"</FONT>" & vbCrLf
Response.Write "</TD>" & vbCrLf
Response.Write "</TR>"
rs.movenext
loop
if rs.eof and rs.bof then
   Response.Write "<TR><TD>暂时没有游戏下载</TD></TR>"
end if
rs.close
set rs=nothing
Response.Write "</TABLE>" & vbCrLf
end sub


'=================================================
'过程名：index_js
'作  用：首页网页特效调用
'参  数：num-------------调用条数
'        fontnum---------标题长度
'        classid---------一级分类调用id，0为全部
'        classyes--------是否显示分类，True为是，False为否
'        NewWindows------是否新窗打开，True为是，False为否
'=================================================
sub index_js(num,fontnum,classid,classyes,NewWindows)
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 align=center border=0>" & vbCrLf
if classid=0 then
   sql="select top "&num&" * from js order by js_id DESC"
else
   sql="select top "&num&" * from js where js_catid="&classid&" order by js_id DESC"			
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
dim nnn
if NewWindows=True then
   nnn="target='_blank'"
else
   nnn=""				
end if 
sql="select jscat_id,jscat_name from jscat where jscat_id="&rs("jscat_id")
set rscat=server.createobject("adodb.recordset")
rscat.open sql,conn,1,1
Response.Write "<TR>" & vbCrLf
Response.Write "<TD height='22' class=table-xia>"
if classyes=True then 
Response.Write "<a href='js.asp?jscat_id="&rs("jscat_id")&"'>『"&left(rscat("jscat_name"),10)&"』</a>"
else
Response.Write ""&indexdot&"" 
end if
rscat.close
set rscat=nothing
Response.Write "<a href='showjs.asp?js_id="&rs("js_id")&"' Title='特效名称："&rs("js_name")&"&#13&#10查看次数："&rs("js_count")&"&#13&#10上传时间："&rs("js_date")&"' "& nnn &">"&gotTopic(rs("js_name"),fontnum)&"</a>" & vbCrLf
Response.Write "</TD><TD align=right class=table-xia>" & vbCrLf
if DateDiff("h",rs("js_date"),now())<=24 then Response.Write "<FONT color=red>"
Response.Write ""&Right("0"&month(rs("js_date")),2)&"/"&right("0"&day(rs("js_date")),2)&"</FONT>" & vbCrLf
Response.Write "</TD></TR>"
rs.movenext
loop
if rs.eof and rs.bof then
   Response.Write "<TR><TD>暂时没有特效</TD></TR>"
end if
rs.close
set rs=nothing
Response.Write "</TABLE>" & vbCrLf
end sub

'=================================================
'过程名：class2_art
'作  用：文章分类
'参  数：无
'=================================================
sub class2_art(classid)
sql="select * from a_cat where sid="&classid&""
set rs1=conn.execute(sql)
do while not rs1.eof
if request("cat_id")=cstr(rs1("cat_id")) then
response.write "&nbsp;·<font color=""#FF0000"">"&rs1("cat_name")&"</font><BR>"
else
response.write "&nbsp;·<font color=""#FF0000""></font><a href='art_list.asp?cat_id="&rs1("cat_id")&"'>"&rs1("cat_name")&"</a><BR>"
end if
sql="select * from a_cat where sid="&rs1("cat_id") 
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
if request("cat_id")=cstr(rs2("cat_id")) then
response.write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=""#FF0000"">├ "&rs2("cat_name")&"</a></font><BR>"
else
response.write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='art_list.asp?cat_id="&rs2("cat_id")&"'>├ "&rs2("cat_name")&"</a><BR>"
end if
rs2.movenext
loop
rs1.movenext
loop
rs2.close
set rs2=nothing
rs1.close
set rs1=nothing
end sub

'=================================================
'过程名：index_img_art
'作  用：图片文章
'参  数：n-调用条数
'        classid---------一级分类调用id，0为全部
'        ImgWidth   ----图片宽度
'        ImgHeight  ----图片高度
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub index_img_art(n,classid,ImgWidth,ImgHeight,NewWindows)
dim nnn,imagess
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""				
end if
Response.Write "<TABLE width='100%' cellSpacing=5 cellPadding=0 border=0 align='center'>" & vbCrLf
Response.Write "<TR>" & vbCrLf
set rs=conn.execute("SELECT top "&n&" * FROM art where isimg=1 and (cat_id="&classid&" or cat_id in(select cat_id from a_cat where sid="&classid&")) order by art_id desc") 
if rs.EOF then
	Response.Write ("<TD align=center>暂无图片文章</TD>")
else
	do while not rs.eof
if rs("images")<>"" then
imagess=rs("images")
else
imagess="img/nopic.gif"
end if
Response.Write "<TD align=center>"
Response.Write "<table width='100%' border=0 cellpadding=2 cellspacing=0 background='skin/1/pic_bg.gif'><tr><td><a href='Showart.asp?art_id="&rs("art_id")&"' title='最新图片文章："&rs("art_title")&"' "& nnn &"><img src='"&imagess&"' width='"& ImgWidth &"' height='"& ImgHeight &"' border=0 alt='最新图片文章："&rs("art_title")&"'></a></td>"
Response.Write "<td><a href='Showart.asp?art_id="&rs("art_id")&"' title='最新图片文章："&rs("art_title")&"' "& nnn &">"&left(rs("art_content"),35)&" >>详细</a></TD></tr></table>"
rs.movenext
loop
end if
rs.close
set rs=nothing
Response.Write "</TR></TABLE>" & vbCrLf
end sub

'=================================================
'过程名：index_dj
'作  用：首页音乐单曲调用
'参  数：num-------------调用条数
'        fontnum---------标题长度
'=================================================
sub index_dj(num,fontnum)
Response.Write "<table width='100%' border='1' align='center' cellspacing='0' cellpadding='0' bgcolor='#FFFFFF' bordercolor='#f0f0f0' style='border-collapse: collapse'>" & vbCrLf
'Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 align=center border=0>" & vbCrLf
Response.Write "<form name='form' onsubmit='return lbsong();' target='lbsong' action='djplaylist.asp'>"
Response.Write "<TR align=center><TD height='22'>歌曲名称</TD>" & vbCrLf
Response.Write "<TD>人气</TD>" & vbCrLf
Response.Write "<TD>播放</TD>" & vbCrLf
Response.Write "<TD>下载</TD>" & vbCrLf
Response.Write "<TD>歌词</TD>" & vbCrLf
Response.Write "<TD>连播</TD></TR>" & vbCrLf
sql="select top "&num&" * from dj where passed=0 order by dj_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
Response.Write "<TR><TD height='22' class=table-xia width='58%'>"&indexdot&"<a href='showdj.asp?dj_id="&rs("dj_id")&"' Title='歌曲名称："&rs("dj_name")&"&#13&#10视听次数："&rs("dj_count")&"&#13&#10上传时间："&rs("dj_date")&"'>"&gotTopic(rs("dj_name"),fontnum)&"</a></TD>" & vbCrLf
Response.Write "<TD class=table-xia align=center width='10%'>"&rs("dj_count")&"</TD>" & vbCrLf
Response.Write "<TD class=table-xia align=center width='8%'><a href='djplaylist.asp?checked="&rs("dj_id")&"&player=+' onclick=""HxWindow(this.href,'dj','350','260','no','no','center');return false"" Title='点击单首弹窗试听'><img border='0' src='img/play_dj/bt_play.gif' width='14' height='14'></a></TD>" & vbCrLf
Response.Write "<TD class=table-xia align=center width='8%'><a title='点击下载' href='opendj.asp?dj_id="&rs("dj_id")&"&url='><img border='0' src='img/musicdown.gif' width='12' height='12'></a></TD>" & vbCrLf
Response.Write "<TD class=table-xia align=center width='8%'><a title='查看歌词' href='dj_word.asp?id="&rs("dj_id")&"&singer="&rs("dj_user")&"&musicname="&rs("dj_name")&"' onclick=""HxWindow(this.href,'dj','330','280','yes','yes','center');return false""><img border='0' src='img/musicart.gif' width='12' height='12'></a></TD>" & vbCrLf
Response.Write "<TD class=table-xia align=center width='8%'><input type='checkbox' name='checked' value='"&rs("dj_id")&"'></TD></TR>" & vbCrLf
rs.movenext
loop
if rs.eof and rs.bof then
   Response.Write "<TR><TD>暂时没有音乐</TD></TR>"
end if
Response.Write "<TR><TD colspan=7 align=Center height='26'><div align='center'>"
Response.Write "<input type='button' name='chkall' value='' onclick=""CheckAll(this.form)"" title=""选择显示的所有歌曲"" style=""width: 62px; height: 23px; background-image: url('img/ly1.gif'); border-style: none; border-width: medium"">&nbsp;" & vbCrLf         
Response.Write "<input type='button' name='chkOthers' value='' onclick=""CheckOthers(this.form)"" title=""反向选择歌曲"" style=""width: 62px; height: 23px; background-image: url('img/ly2.gif'); border-style: none; border-width: medium"">&nbsp;" & vbCrLf
Response.Write "<input type='submit' name='player' value='' title=""请先选择你想听的歌曲后再点击播放"" style=""width: 62px; height: 23px; background-image: url('img/ly3.gif'); border-style: none; border-width: medium"">" & vbCrLf
Response.Write "</div></TD></TR></form>" & vbCrLf
Response.Write(MultiPages)
Response.Write "</table>" & vbCrLf
rscat.close
set rscat=nothing
rs.close
set rs=nothing
end sub


'=================================================
'过程名：index_dj1
'作  用：首页音乐单曲调用
'参  数：num-------------调用条数
'参  数：classid------------一级分类调用id，0为全部
'参  数：orders------------调用方式，0为最新歌曲，1为热门歌曲，2为推荐歌曲，3为固顶歌曲,4为下载最多的歌曲
'        fontnum---------标题长度
'=================================================
sub index_dj1(num,classid,orders,fontnum)
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 align=center border=0>" & vbCrLf
Response.Write "<form name='form' onsubmit='return lbsong();' target='lbsong' action='djplaylist.asp'>"
dim orders1
if orders=0 then
orders1="dj_id DESC"
elseif orders=1 then
orders1="dj_count desc,dj_id DESC"
elseif orders=2 then
orders1="isbest desc,dj_id desc"
elseif orders=3 then
orders1="istop desc,dj_id desc"
elseif orders=4 then
orders1="dj_dcount desc,dj_id desc"
end if
if classid=0 then
   sql="select top "&num&" * from dj where passed=0 order by "&orders1&""
else
   sql="select top "&num&" * from dj where passed=0 and (djcat_id="&classid&" or djcat_id in(select djcat_id from djcat where sid="&classid&")) order by "&orders1&""   
end if 
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
Response.Write "<TR><TD height='23' class=table-xia width='58%'>"&indexdot&"<a href='showdj.asp?dj_id="&rs("dj_id")&"' Title='歌曲名称："&rs("dj_name")&"&#13&#10视听次数："&rs("dj_count")&"&#13&#10上传时间："&rs("dj_date")&"'>"&gotTopic(rs("dj_name"),fontnum)&"</a></TD>" & vbCrLf
Response.Write "<TD class=table-xia align=center width='8%'><input type='checkbox' name='checked' value='"&rs("dj_id")&"'></TD></TR>" & vbCrLf
rs.movenext
loop
if rs.eof and rs.bof then
   Response.Write "<TR><TD>暂时没有舞曲</TD></TR>"
end if
Response.Write "<TR><TD colspan=7 align=Center height='26'><div align='center'>"
Response.Write "<input type='button' name='chkall' value='' onclick=""CheckAll(this.form)"" title=""选择显示的所有歌曲"" style=""width: 62px; height: 23px; background-image: url('img/ly1.gif'); border-style: none; border-width: medium"">&nbsp;" & vbCrLf         
Response.Write "<input type='button' name='chkOthers' value='' onclick=""CheckOthers(this.form)"" title=""反向选择歌曲"" style=""width: 62px; height: 23px; background-image: url('img/ly2.gif'); border-style: none; border-width: medium"">&nbsp;" & vbCrLf
Response.Write "<input type='submit' name='player' value='' title=""请先选择你想听的歌曲后再点击播放"" style=""width: 62px; height: 23px; background-image: url('img/ly3.gif'); border-style: none; border-width: medium"">" & vbCrLf
Response.Write "</div></TD></TR></form>" & vbCrLf
Response.Write(MultiPages)
Response.Write "</table>" & vbCrLf
rscat.close
set rscat=nothing
rs.close
set rs=nothing
end sub



'=================================================
'过程名：index_djSpecial
'作  用：首页音乐专集调用
'参  数：num-------------调用条数
'        fontnum---------标题长度
'        ImgWidth   ----图片宽度
'        ImgHeight  ----图片高度
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub index_djSpecial(num,fontnum,ImgWidth,ImgHeight,NewWindows)
Response.Write "<TABLE width='100%' cellSpacing=2 cellPadding=0 align=center border=0><TR>" & vbCrLf
set rs=conn.execute("SELECT top "&num&" * FROM djSpecial order by Specialid desc") 
if rs.EOF then
	Response.Write "<TD align=center>暂无专集</TD>"
else
	do while not rs.eof
dim nnn
if NewWindows=True then
        nnn="target='_blank'"
else
        nnn=""				
end if 
Response.Write "<TD>"
Response.Write "<table border='0' align='center' cellpadding='1' cellspacing='1' bgcolor='#C5C5C5'>"
Response.Write "<tr><td align='center' bgcolor='#FFFFFF'><a href='Showdj_Special.asp?Specialid="&rs("SpecialID")&"' title='最新专辑："&rs("name")&"' "& nnn &"><img src="&rs("pic")&" width='"&ImgWidth&"' height='"&ImgHeight&"' border=0 alt='最新专辑："&rs("name")&"'></a></TD></TR>" & vbCrLf
Response.Write "</table><table border='0' align='center' cellpadding='0' cellspacing='0'>" & vbCrLf
Response.Write "<tr><td align='center'><a href='Showdj_Special.asp?Specialid="&rs("SpecialID")&"' title='最新专辑："&rs("name")&"' "& nnn &">"&gotTopic(rs("name"),fontnum)&"</a></TD></TR>" & vbCrLf
Response.Write "</table></TD>" & vbCrLf
i=i+1
if i mod 4 = 0 then
Response.Write "</tr>"
end if
rs.movenext
loop
end if
rs.close
Response.Write "</TR></TABLE>" & vbCrLf
end sub

'=================================================
'过程名：index_vid
'作  用：首页影视调用(单片显示)
'参  数：num-------------调用条数
'        fontnum---------内容简介长度
'        ImgWidth   ----图片宽度
'        ImgHeight  ----图片高度
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub index_vid(num,fontnum,ImgWidth,ImgHeight,NewWindows)
sql="select top "&num&" * from vid order by vid_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
if rs("Grade")="0" then
   hxGrade="游客身份"
elseif rs("Grade")="1" then
   hxGrade="会员身份"       
elseif rs("Grade")="2" then
   hxGrade="VIP身份"       
end if 
dim nnn
if NewWindows=True then
   nnn="target='_blank'"
else
   nnn=""				
end if
Response.Write "<TABLE width='100%' cellSpacing=3 cellPadding=1 align=center border=0><TR>" & vbCrLf      
Response.Write "<TD align=middle width='130'>" & vbCrLf
Response.Write "<table cellSpacing='1' cellPadding='4' width='1' bgColor='#b5b6b5' border='0'><tr>" & vbCrLf
Response.Write "<td bgColor='#ffffff'><a title='影片名称："&rs("title")&"&#13&#10查看次数："&rs("hits")&"&#13&#10上传时间："&rs("dateandtime")&"' href='showvid.asp?vid_id="&rs("vid_id")&"' "& nnn &"><img border='0' src='"&rs("images")&"' width='"&ImgWidth&"' height='"&ImgHeight&"'></a></TD>" & vbCrLf
Response.Write "</tr></table></TD>" & vbCrLf
Response.Write "<td valign=top width='450'><table border=0 width='100%'>" & vbCrLf
Response.Write "<TR><td width='50%'>影片名称：<a title='影片名称："&rs("title")&"&#13&#10查看次数："&rs("hits")&"&#13&#10上传时间："&rs("dateandtime")&"' href='showvid.asp?vid_id="&rs("vid_id")&"' "& nnn &"><font style=""font-size: 14px"" color=""#E73A00"">"&rs("title")&"</font></TD><td width='50%'>影片格式："&rs("runsystem")&"</TD></TR>" & vbCrLf
Response.Write "<TR><td>领衔主演："&gotTopic(rs("dog"),30)&"</TD><td>推荐程度："&rs("filmlevel")&"</TD></TR>" & vbCrLf
Response.Write "<TR><td>添加日期："&formatdatetime(rs("dateandtime"),2)&"</TD><td>观看权限："&hxGrade&"</TD></TR>" & vbCrLf
Response.Write "<TR><td>观看次数："&rs("hits")&"</TD><td>所需收费：<font color=red>"&rs("points")&"</font> "&moneyname&"/集</TD></TR>" & vbCrLf
Response.Write "<TR><td colspan=2>内容简介：</TD></TR>" & vbCrLf
Response.Write "<TR><td colspan=2>&nbsp;&nbsp;&nbsp;&nbsp;"&gotTopic(rs("content"),fontnum)&"</TD></TR>" & vbCrLf
Response.Write "</table></TD>" & vbCrLf
Response.Write "</TR></table>" & vbCrLf
rs.movenext
loop
if rs.eof and rs.bof then
Response.Write "<li>暂时没有影片</li>"
end if
rs.close
set rs=nothing
end sub

'=================================================
'过程名：index_vid1
'作  用：首页影视调用(分类图片显示)
'参  数：num-------------调用条数
'        fontnum---------标题长度
'        classid---------一级分类调用id，0为全部
'        ImgWidth   ----图片宽度
'        ImgHeight  ----图片高度
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub index_vid1(num,fontnum,classid,ImgWidth,ImgHeight,NewWindows)
Response.Write "<TABLE width='100%' cellSpacing=5 cellPadding=0 align=center border=0><TR>" & vbCrLf
if classid=0 then
   sql="select top "&num&" * from vid order by vid_id DESC"
else
   sql="select top "&num&" * from vid where vidcat_id="&classid&" or vidcat_id in(select vidcat_id from vidcat where sid="&classid&") order by vid_id DESC"			
end if 
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
dim nnn
if NewWindows=True then
   nnn="target='_blank'"
else
   nnn=""				
end if
Response.Write "<TD>"
Response.Write "<table border='0' align='center' cellpadding='1' cellspacing='1' bgcolor='#C5C5C5'>"
Response.Write "<tr><td align='center' bgcolor='#FFFFFF'><a title='影片名称："&rs("title")&"&#13&#10查看次数："&rs("hits")&"&#13&#10上传时间："&rs("dateandtime")&"' href='showvid.asp?vid_id="&rs("vid_id")&"' "& nnn &"><img border='0' src='"&rs("images")&"' width='"&ImgWidth&"' height='"&ImgHeight&"'></a></TD></TR>" & vbCrLf
Response.Write "</table></TD>" & vbCrLf
rs.movenext
loop
if rs.eof and rs.bof then
Response.Write "<td align=center>暂时没有影片</td>"
end if
rs.close
set rs=nothing
Response.Write "</TR></table>" & vbCrLf
end sub

'=================================================
'过程名：index_vid2
'作  用：首页影片调用
'参  数：num-------------调用条数
'        fontnum---------标题长度
'        classid---------一级分类调用id，0为全部
'        classyes--------是否显示分类，True为是，False为否
'        NewWindows------是否新窗打开，True为是，False为否
'=================================================
sub index_vid2(num,fontnum,classid,classyes,NewWindows)
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 align=center border=0>" & vbCrLf
if classid=0 then
   sql="select top "&num&" * from vid order by vid_id DESC"
else
   sql="select top "&num&" * from vid where vidcat_id="&classid&" or vidcat_id in(select vidcat_id from vidcat where sid="&classid&") order by vid_id DESC"			
end if 
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
dim nnn
if NewWindows=True then
   nnn="target='_blank'"
else
   nnn=""				
end if    
Response.Write "<TR>" & vbCrLf
Response.Write "<TD height='22' class=table-xia>"
if classyes=True then 
Response.Write "<a href='vid.asp?vidcat_id="&rs("vidcat_id")&"'>『"&left(rs("vidcat_name"),10)&"』</a>"
else
Response.Write ""&indexdot&"" 
end if
Response.Write "<a href='showvid.asp?vid_id="&rs("vid_id")&"' Title=''影片名称："&rs("title")&"&#13&#10查看次数："&rs("hits")&"&#13&#10上传时间："&rs("dateandtime")&"' "& nnn &">"&gotTopic(Rs("title"),fontnum)&"</a>" & vbCrLf
Response.Write "</TD>" & vbCrLf
Response.Write "<TD align=right class=table-xia>" & vbCrLf
if DateDiff("h",rs("dateandtime"),now())<=24 then Response.Write "<FONT color=red>"
Response.Write ""&Right("0"&month(rs("dateandtime")),2)&"/"&right("0"&day(rs("dateandtime")),2)&"</FONT>" & vbCrLf
Response.Write "</TD>" & vbCrLf
Response.Write "</TR>"
rs.movenext
loop
if rs.eof and rs.bof then
   Response.Write "<TR><TD>暂时没有影片</TD></TR>"
end if
rs.close
set rs=nothing
Response.Write "</TABLE>" & vbCrLf
end sub

'=================================================
'过程名：index_top_vid
'作  用：热门排行
'参  数：n-调用条数,nn-显示长度
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub index_top_vid(n,nn,NewWindows)
dim nnn
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""				
end if
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 border=0 align='center'>" & vbCrLf
set RsHxcms=server.createobject("adodb.recordset")
set RsHxcms=conn.execute("SELECT top "&n&" * FROM vid ORDER by hits DESC,vid_id DESC")
do while not RsHxcms.eof
Response.Write "<tr><td height='25' class=table-xia>"
if classyes=True then 
Response.Write "<a href='vid.asp?vidcat_id="&rs("vidcat_id")&"'>『"&left(rs("vidcat_name"),10)&"』</a>"
else
Response.Write ""&indexdot&"" 
end if
Response.Write "<a href='showvid.asp?vid_id="&RsHxcms("vid_id")&"' Title='影片名称："&RsHxcms("title")&"&#13&#10观看次数："&RsHxcms("hits")&"&#13&#10上传时间："&RsHxcms("dateandtime")&"' "& nnn &">"&gotTopic(RsHxcms("title"),nn)&"</a></td></tr>" & vbCrLf
RsHxcms.movenext
loop
if RsHxcms.bof and RsHxcms.eof then
Response.Write "<tr><td align='center' valign='middle'>当前没有影片！</td></tr>"
end if
RsHxcms.close
set RsHxcms=nothing
Response.Write "</TABLE>" & vbCrLf
end sub

'=================================================
'过程名：index_best_vid
'作  用：推荐影片
'参  数：n-调用条数,nn-显示长度
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub index_best_vid(n,nn,NewWindows)
dim nnn
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""				
end if
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 border=0 align='center'>" & vbCrLf
set RsHxcms=server.createobject("adodb.recordset")
set RsHxcms=conn.execute("SELECT top "&n&" * FROM vid where isbest = 1 order by vid_id desc")
do while not RsHxcms.eof
Response.Write "<tr><td height='25' class=table-xia>"
if classyes=True then 
Response.Write "<a href='vid.asp?vidcat_id="&rs("vidcat_id")&"'>『"&left(rs("vidcat_name"),10)&"』</a>"
else
Response.Write ""&indexdot&"" 
end if
Response.Write "<a href='showvid.asp?vid_id="&RsHxcms("vid_id")&"' Title='影片名称："&RsHxcms("title")&"&#13&#10观看次数："&RsHxcms("hits")&"&#13&#10上传时间："&RsHxcms("dateandtime")&"' "& nnn &">"&gotTopic(RsHxcms("title"),nn)&"</a></td></tr>" & vbCrLf
RsHxcms.movenext
loop
if RsHxcms.bof and RsHxcms.eof then
Response.Write "<tr><td align='center' valign='middle'>没有推荐影片！</td></tr>"
end if
RsHxcms.close
set RsHxcms=nothing
Response.Write "</TABLE>" & vbCrLf
end sub

'=================================================
'过程名：index_book
'作  用：首页留言调用
'参  数：num-------------调用条数
'        fontnum---------标题长度
'=================================================
sub index_book(num,fontnum)
sql="select top "&num&" id,zt,name,words,date,reply from words order by date DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 align=center border=0>" & vbCrLf
do while not rs.eof
dim abc
if rs("reply")="" or isnull(rs("reply")) then
abc="<img src='img/musicring.gif' border='0' title='此留言等待回复'>"
else
abc="<img src='img/musicdown.gif' border='0' title='此留言已被回复'>"
end if
Response.Write "<TR><TD height='22' class=table-xia><img border=0 src='img/c3.gif' hspace=5 vspace=4 align=absmiddle><a href='book.asp?select=name&keyword="&rs("name")&"' title='留言姓名："&rs("name")&"&#13&#10留言时间："&rs("date")&"'>"&gotTopic(rs("zt"),fontnum)&"</a>"&abc&"</td></tr>" & vbCrLf
rs.movenext
loop
if rs.eof and rs.bof then
Response.Write "<TR><TD>暂时没有留言</td></tr>"               
end if
rs.close
set rs=nothing
Response.Write "</TABLE>" & vbCrLf
end sub

'=================================================
'过程名：index_flash
'作  用：首页图片动漫调用
'参  数：num-------------调用条数
'=================================================
sub index_flash(num)
Response.Write "<TABLE width='100%' cellSpacing=3 cellPadding=0 align=center border=0><TR>" & vbCrLf
sql="select top "&num&" * from FLASH order by id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
Response.Write "<TD>"
Response.Write "<table border='0' align='center' cellpadding='0' cellspacing='0'>"
Response.Write "<tr><td align='center' bgcolor='#FFFFFF'><a href='showflash.asp?id="&rs("id")&"',""动慢名称："&rs("title")&"&#13&#10上传时间："&rs("time")&"><img border='0' src='"&rs("img")&"' width='80' height='60'></a></TD></TR>" & vbCrLf
Response.Write "</table></TD>" & vbCrLf
rs.movenext
loop
if rs.eof and rs.bof then
   Response.Write "<TD align=center>暂无FLASH动慢！</TD>"
end if
rs.close
set rs=nothing
Response.Write "</TR></TABLE>" & vbCrLf
end sub

'=================================================
'过程名：index_flashwz
'作  用：首页文字动漫调用
'参  数：num-------------调用条数
'        fontnum---------标题长度
'        classyes--------是否显示分类，True为是，False为否
'        NewWindows------是否新窗打开，True为是，False为否
'=================================================
sub index_flashwz(num,fontnum,classyes,NewWindows)
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 align=center border=0>" & vbCrLf
sql="select top "&num&" * from FLASH order by id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
sql="select cat_id,cat_name from f_cat where cat_id="&rs("cat_id")
set rscat=server.createobject("adodb.recordset")
rscat.open sql,conn,1,1
dim nnn
if NewWindows=True then
   nnn="target='_blank'"
else
   nnn=""				
end if 
Response.Write "<TR><TD height='22' width='100%' class=table-xia>" & vbCrLf
if classyes=True then 
Response.Write "<a href='flash.asp?cat_id="&rs("cat_id")&"'>『"&left(rscat("cat_name"),10)&"』</a>"
else
Response.Write ""&indexdot&"" 
end if
Response.Write "<a href='showflash.asp?id="&rs("id")&"' Title='动慢名称："&rs("title")&"&#13&#10发布时间："&rs("time")&"' "& nnn &">"&gotTopic(rs("title"),fontnum)&"</a>" & vbCrLf
Response.Write "</TD></TR>" & vbCrLf
rs.movenext
loop
if rs.eof and rs.bof then
Response.Write "<TR><TD align=center>暂无FLASH动慢！</TD></TR>"
end if
rscat.close
set rscat=nothing
rs.close
set rs=nothing
Response.Write "</TABLE>" & vbCrLf
end sub

'=================================================
'过程名：index_gq
'作  用：首页供求信息调用
'参  数：num-------------调用条数
'        fontnum---------标题长度
'        classid---------一级分类调用id，0为全部
'        classyes--------是否显示分类，True为是，False为否
'        NewWindows------是否新窗打开，True为是，False为否
'=================================================
sub index_gq(num,fontnum,classid,classyes,NewWindows)
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 align=center border=0>" & vbCrLf
if classid=0 then
   sql="select top "&num&" * from gq where passed=0 order by gq_id DESC"
else
   sql="select top "&num&" * from gq where gq_catid="&classid&" and passed=0 order by gq_id DESC"   
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
dim nnn
if NewWindows=False then
   nnn="target='_blank'"
else
   nnn=""    
end if 
sql="select gqcat_id,gqcat_name from gqcat where gqcat_id="&rs("gqcat_id")
set rscat=server.createobject("adodb.recordset")
rscat.open sql,conn,1,1
Response.Write "<TR>" & vbCrLf
Response.Write "<TD height='22' class=table-xia>"
if classyes=True then 
Response.Write "<a href='fillbuy.asp?gqcat_id="&rs("gqcat_id")&"'>["&left(rscat("gqcat_name"),10)&"]</a>"
else
Response.Write ""&indexdot&"" 
end if
Response.Write "<a href='showgq.asp?gq_id="&rs("gq_id")&"' Title='信息主题："&rs("gq_name")&"&#13&#10阅读次数："&rs("gq_count")&"&#13&#10发布时间："&rs("gq_date")&"' "& nnn &">"&gotTopic(rs("gq_name"),fontnum)&"</a>" & vbCrLf
if rs("InfoClass")=1 then
Response.Write "<font color=#009933>[供应]</font>"
elseif rs("InfoClass")=2 then
Response.Write "<font color=#FF0000>[求购]</font>"
elseif rs("InfoClass")=3 then
Response.Write "<font color=#FF00FF>[要闻]</font>"
elseif rs("InfoClass")=4 then
Response.Write "<font color=#008080>[动态]</font>"
elseif rs("InfoClass")=5 then
Response.Write "<font color=#0000FF>[招聘]</font>"
elseif rs("InfoClass")=6 then
Response.Write "<font color=#9900FF>[求职]</font>"
elseif rs("InfoClass")=7 then
Response.Write "<font color=#FF6600>[展会]</font>"
elseif rs("InfoClass")=8 then
Response.Write "<font color=#336699>[其它]</font>"
end if
Response.Write "</td><TD align=right class=table-xia>" & vbCrLf
if DateDiff("h",rs("gq_date"),now())<=24 then Response.Write "<FONT color=red>"
Response.Write ""&Right("0"&month(rs("gq_date")),2)&"/"&right("0"&day(rs("gq_date")),2)&"  </FONT>" & vbCrLf
Response.Write "</TD></TR>"
rs.movenext
loop
if rs.eof and rs.bof then
   Response.Write "<TR><TD>暂时没有信息</TD></TR>"
end if
rscat.close
set rscat=nothing
rs.close
set rs=nothing
Response.Write "</TABLE>" & vbCrLf
end sub 

'=================================================
'过程名：index_points
'作  用：首页会员积分排行调用
'参  数：num-------------调用条数
'=================================================
sub index_points(num)
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=1 align=center border=0 class=table-2>" & vbCrLf
sql="select top "&num&" UserName,points,usergrade from [user] where userlock=0 order by points DESC,userid DESC"  
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
i=1
do while not rs.eof
Response.Write "<TR><TD height='22' class=table-xia align=absmiddle border=0>&nbsp;<img src='img/blog/top"&i&".gif'> "&rs(0)&"" & vbCrLf
%>
<%if rs("usergrade")=1 then%>
<img src="img/vip.gif" align="absmiddle" alt="VIP会员"><%else%>
<img src="img/user.gif" align="absmiddle" alt="普通会员"><%end if%>
<%
Response.Write "</TD><TD align=right class=table-xia>"&rs(1)&"&nbsp;</TD></TR>" & vbCrLf
i=i+1
rs.movenext
loop
if rs.eof and rs.bof then
   Response.Write "<TR><TD align=center>暂无会员信息！</TD></TR>"
end if
rs.close
set rs=nothing
Response.Write "</TABLE>" & vbCrLf
end sub 

'=================================================
'过程名：index_Blog
'作  用：Bolg首页调用
'参  数：num--------------调用条数
'        fontnum----------显示文字长度
'        ls---------------0最新，1精华,2热门排行
'        classyes---------是否显示分类，True为是，False为否
'        NewWindows-------是否新窗打开，True为是，False为否
'=================================================
Sub index_Blog(num,fontnum,ls,classyes,NewWindows) 
  Response.Write("<TABLE width='100%' cellSpacing=0 cellPadding=0 align=center border=0>")
dim nnn
if NewWindows=True then
   nnn="target='_blank'"
else
   nnn=""                
end if 
if ls=0 then
   Set Rs=Conn.Execute("SELECT TOP "&num&" T.blog_ID,T.blog_CateID,C.cate_Name,T.blog_Title,T.blog_Author,blog_PostTime,blog_IsShow FROM b_Content T,b_cat C WHERE T.blog_cateID=C.cate_ID ORDER BY T.blog_PostTime DESC")
elseif ls=1 then
   Set Rs=Conn.Execute("SELECT TOP "&num&" T.blog_ID,T.blog_CateID,C.cate_Name,T.blog_Title,T.blog_Author,blog_PostTime,blog_IsShow FROM b_Content T,b_cat C WHERE T.blog_cateID=C.cate_ID and blog_isbest=True ORDER BY T.blog_PostTime DESC")
elseif ls=2 then
   Set Rs=Conn.Execute("SELECT TOP "&num&" T.blog_ID,T.blog_CateID,C.cate_Name,T.blog_Title,T.blog_Author,blog_PostTime,blog_IsShow FROM b_Content T,b_cat C WHERE T.blog_cateID=C.cate_ID ORDER BY T.blog_ViewNums DESC, T.blog_PostTime DESC")
end if
  IF Rs.EOF AND Rs.BOF Then
      Response.Write("暂无")
  Else
      Do While NOT Rs.EOF
          Response.Write "<TR><TD height='22' class=table-xia>"
          if classyes=True then 
                Response.Write "<a href='blog.asp?cat_id="&Rs("blog_CateID")&"'>『"&left(Rs("cate_Name"),10)&"』</a>"
          else
                Response.Write ""&indexdot&""
          end if
          IF Rs("blog_IsShow")=False Then
        Response.Write("<a href='showblog.asp?blog_id="&Rs("blog_ID")&"' title='隐藏日志，不显示预览' "& nnn &">隐藏日志……</a>")
      Else
                Response.Write("<a href='showblog.asp?blog_id="&Rs("blog_ID")&"' title='日志标题："&Rs("blog_Title")&"&#13;&#10;发表日期："&Rs("blog_PostTime")&"&#13;&#10;日志作者："&Rs("blog_Author")&"' "& nnn &">"&gotTopic(Rs("blog_Title"),fontnum)&"</a>")
          End IF
          Response.Write "</TD><TD align=right class=table-xia>" & vbCrLf
          if DateDiff("h",Rs("blog_PostTime"),now())<=24 then Response.Write "<FONT color=red>"
             Response.Write ""&Right("0"&month(Rs("blog_PostTime")),2)&"/"&right("0"&day(Rs("blog_PostTime")),2)&"</FONT>" & vbCrLf
             Response.Write "</TD></TR>"
      Rs.MoveNext
      Loop
  End IF
  Rs.Close
  Set Rs=Nothing
Response.Write("</TABLE>")
End Sub

'=================================================
'过程名：djs
'作  用：首页倒记时调用
'=================================================
sub djs()
response.write "今天是"
response.write formatDateTime(Date(),1) & "," 
'格式化为长日期格式输出显示
response.write " 离<font color=red>"&riqi&"</font>还有"
response.write "<font color=blue><u>"
'调用DateDiff函数,计算日期间隔.
response.write DateDiff("d",Date(),""&rdate&"")
response.write "</font></u>"
response.write "天"
end sub
%>

