News.Asp
上传用户:btntkt
上传日期:2021-04-16
资源大小:5296k
文件大小:7k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

DOS

  1. <!--#include file="Inc/SysConfig.Asp"-->
  2. <%
  3. Dim Action,num,Border,trHeight,Bordercolor,Bgcolor,BBSURL,Show,Face,tg,slen,rs,Shokw
  4. Set Rs=YxBBs.execute("Select BBSUrl From [YX_config]")
  5. BBSURL=""&Rs("BBSUrl")&""
  6. Num=request.querystring("num")
  7. Border=request.querystring("bo")
  8. bordercolor=Left(request.querystring("boc"),9)
  9. bgcolor=Left(request.querystring("bgc"),9)
  10. trHeight=Left(request.querystring("h"),2)
  11. Face=Left(request.querystring("face"),2)
  12. tg=left(request.querystring("tg"),2)
  13. slen=Request.QueryString("len")
  14. If Num="" or Not YxBBs.Fun.isInteger(Num) Then Num="10"
  15. If Int(Num)>50 then Num="50"
  16. If slen="" Or Not YxBBs.Fun.isInteger(slen) Then slen=25
  17. If Border="" or not YxBBs.Fun.isInteger(Border) Then Border="0"
  18. If bgcolor<>"" Then bgcolor="bgcolor='#"&bgcolor&"' "
  19. If bordercolor<>"" Then bordercolor="bordercolor='#"&bordercolor&"'"
  20. If trHeight="" or not YxBBs.Fun.isInteger(trHeight) Then trHeight="18"
  21. Action=Request.querystring("action")
  22. If len(Action)>10 Then Response.Write"请检查调用语句":Response.End
  23. Select Case Action
  24. Case"topic"
  25. Topic
  26. Case"board"
  27. Board
  28. Case"info"
  29. Info
  30. Case"login"
  31. Login
  32. End Select
  33. Set YxBBs=Nothing
  34. Sub Login
  35. Show="<form method='POST' action='"&BBSURL&"/login.asp?action=login' style='margin:0'"
  36. If tg="1" then Show=Show&" target='_blank' "
  37. Show=Show&"><tr height='"&trHeight&"'><td>用户:<input size='8' name='name' /></td></tr><tr><td> 密码:<input type='password' size='8' name='password' class='text' /></td></tr>"
  38. If request.querystring("CK")="1" Then Show=Show&"<tr height='"&trHeight&"'><td>保存:<SELECT size=1 name='cookies'><OPTION value=0 selected>不保存</OPTION><OPTION value=1>保存一天</OPTION><OPTION value=30>保存一月</OPTION><PTION value=365>保存一年</OPTION></SELECT></td></tr>"
  39. If request.querystring("HI")="1" Then Show=Show&"<tr height='"&trHeight&"'><td>方式:<SELECT size=1 name='hidden'><OPTION value='1' selected>正常登陆</OPTION><OPTION value=2>隐身登陆</OPTION></SELECT></td></tr>"
  40. If YxBBs.BBSSetting(6)="0" Then Show=Show&"<tr height='"&trHeight&"'><td><input  type=text name='CheckCode' size=8><img align='absmiddle' Src='"&BBSURL&"/Inc/code.Asp'></td></tr>"
  41. Show=Show&"<tr height='"&trHeight&"'><td><input type='submit' class='button' value='登 陆' /></td></tr></form>"
  42. End Sub
  43. Sub Topic
  44. Dim Sql,Rs,ARs,Sqlwhere,Sqlorder,i,Order,BoardID,TopicType,UserName,ShowTime,DayBound,temp
  45. Dim Border,Height
  46. BoardID=request.querystring("boardid")
  47. TopicType=request.querystring("type")
  48. Order=request.querystring("order")
  49. UserName=request.querystring("user")
  50. ShowTime=request.querystring("time")
  51. DayBound=request.querystring("day")
  52. If Order="1" Then
  53. Sqlorder="AddTime DESC"
  54. ElseIf Order="2" Then
  55. Sqlorder="ReplyNum DESC"
  56. ElseIf Order="3" Then
  57. Sqlorder="Hits DESC"
  58. Else
  59. Sqlorder="LastTime DESC"
  60. End If
  61. Sqlwhere="isdel=0"
  62. If DayBound<>"" And YxBBs.Fun.isInteger(DayBound) then
  63. Sqlwhere=Sqlwhere&" And DATEDIFF('d',[AddTime],'"&YxBBs.NowBbsTime&"')<"&DayBound
  64. End If
  65. If BoardID<>"" And Yxbbs.Fun.IsInteger(BoardID) And BoardID<>"0" Then
  66. Temp=BoardID&","
  67. Set Rs=Yxbbs.Execute("Select BoardID,ParentStr From Yx_Board")
  68. Do While Not Rs.Eof
  69. If  Instr(Rs("ParentStr")&",",Temp)>0 Then
  70. BoardID=BoardID&","&Rs("BoardID")
  71. End If
  72. Rs.MoveNext
  73. Loop
  74. Rs.Close
  75. Set Rs=Nothing
  76. Sqlwhere=Sqlwhere&" and boardid in("&BoardID&")"
  77. End If
  78. Select Case Int(TopicType)
  79. Case 1
  80. Sqlwhere=Sqlwhere&" AND topType>0"
  81. Case 2
  82. Sqlwhere=Sqlwhere&" AND isGood"
  83. Case 3
  84. Sqlwhere=Sqlwhere&" AND isVote=1"
  85. End Select 
  86. Sql="SELECT Top "&Num&" TopicID,Name,Face,Caption,BoardID,LastTime,SqlTableID FROM [Yx_Topic] WHERE "&Sqlwhere&" ORDER BY "&Sqlorder&""
  87. Set Rs=YxBBs.Execute(Sql)
  88. If Not Rs.Eof Then
  89. ARs=Rs.GetRows(Num)
  90. Rs.Close
  91. Set Rs=Nothing
  92. For I=0 To Ubound(ARs,2)
  93.                   if ARs(2,i)=99 then ARs(2,i)=1
  94. Show=Show&"<tr height='"&trHeight&"'>"
  95. If Face="1" Then Show=Show&"<td width='20'><img src='"&BBSURL&"/images/face/"&ARs(2,i)&".gIf'/></td>"
  96. Show=Show&"<td width=*>"
  97. If Face<>"1" Then
  98. If Face="0" Then
  99. Show=Show&i+1&"."
  100. Else
  101. Show=Show&Face
  102. End If
  103. End If
  104. Show=Show&" <a"
  105. If tg="1" then Show=Show&" target='_blank' "
  106. Show=Show&" href='"&BBSURL&"/Show.asp?ID="&ARs(0,i)&"&BoardID="&ARs(4,i)&"&TB="&ARs(6,i)&"'>"&YxBBs.Fun.StrLeft(ARs(3,i),Int(slen))&"</a></td>"
  107. If UserName="1" Then Show=Show&"<td width='110' align='center'>"&ARs(1,i)&"</td>"
  108. If ShowTime="1" Then Show=Show&"<td width='120' align='center'>"&ARs(5,i)&"</td>"
  109. Show=Show&"</tr>"
  110. Next
  111. Else
  112. Show="<tr height="&trHeight&"><td>没有内容</td></tr>"
  113. End If
  114. End Sub
  115. Sub Board
  116. Dim I,II,po
  117. If Not IsArray(YxBBs.Board_Rs) Then YxBBs.CacheBoard()
  118. If IsArray(YxBBs.Board_Rs) Then
  119. For i=0 To Ubound(YxBBs.Board_Rs,2)
  120. po=""
  121. If YxBBs.Board_Rs(0,i)<>0  Then
  122. For II=1 To YxBBs.Board_Rs(0,i)
  123. Po=Po&"&nbsp;"
  124. Next
  125. End If
  126. Show=Show&"<tr height="&trHeight&"><td>"&Po&" ├ <a "
  127. If tg="1" Then Show=Show&"target='_blank' "
  128. Show=Show&"href='"&BBSURL&"/List.asp?boardID="&YxBBs.Board_Rs(1,i)&"'>"&YxBBs.Board_Rs(3,i)&"</a></td></tr>"
  129. Next
  130. End If
  131. End Sub
  132. Sub Info
  133. Dim flag
  134. flag=request.querystring("flag")
  135. YxBBs.Getonline'读取在线
  136. If instr(flag,"|1|")=0 then Show=Show&"<tr height="&trHeight&"><td>"&face&" 论坛帖数:<font color=red>"&YxBBs.AllEssayNum&"</a></td></tr>"
  137. If instr(flag,"|2|")=0 then Show=Show&"<tr height="&trHeight&"><td>"&face&" 主题帖数:<font color=red>"&YxBBs.TopicNum&"</a></td></tr>"
  138. If instr(flag,"|3|")=0 then Show=Show&"<tr height="&trHeight&"><td>"&face&" 今日帖数:<font color=red>"&YxBBs.TodayNum&"</a></td></tr>"
  139. If instr(flag,"|4|")=0 then Show=Show&"<tr height="&trHeight&"><td>"&face&" 昨日帖数:<font color=red>"&YxBBs.YsterdayNum&"</a></td></tr>"
  140. If instr(flag,"|5|")=0 then Show=Show&"<tr height="&trHeight&"><td>"&face&" 最高日帖:<font color=red>"&YxBBs.MaxEssayNum&"</a></td></tr>"
  141. If instr(flag,"|6|")=0 then Show=Show&"<tr height="&trHeight&"><td>"&face&" 注册人数:<font color=red>"&YxBBs.UserNum&"</a></td></tr>"
  142. If instr(flag,"|7|")=0 then Show=Show&"<tr height="&trHeight&"><td>"&face&" 最新会员:<a target='_blank' href='"&BBSURL&"/Userinfo.asp?name="&YxBBs.NewUser&"'><font color=red>"&YxBBs.NewUser&"</a></td></tr>"
  143. If instr(flag,"|8|")=0 then Show=Show&"<tr height="&trHeight&"><td>"&face&" 论坛在线:<font color=red>"&YxBBs.AllonlineNum&"</a></td></tr>"
  144. If instr(flag,"|9|")=0 then Show=Show&"<tr height="&trHeight&"><td>"&face&" 在线会员:<font color=red>"&YxBBs.useronlineNum&"</a></td></tr>"
  145. If instr(flag,"|10|")=0 then Show=Show&"<tr height="&trHeight&"><td>"&face&" 在线游客:<font color=red>"&YxBBs.AllonlineNum-YxBBs.useronlineNum&"</a></td></tr>"
  146. If instr(flag,"|11|")=0 then Show=Show&"<tr height="&trHeight&"><td>"&face&" 最高在线:<font color=red>"&YxBBs.MaxOnlineNum&"</a></td></tr>"
  147. If instr(flag,"|12|")=0 then Show=Show&"<tr height="&trHeight&"><td>"&face&" 建站时间:<font color=red>"&FORMATDATETIME(YxBBs.BuildDate,1)&"</a></td></tr>"
  148. End Sub
  149. %>
  150. document.write("<table width='100%' border='<%=border%>' <%=bgcolor&bordercolor%> cellpadding='0' cellspacing='0' style='border-collapse:collapse'><%=Show%></table>");