<%
Function chinese2unicode(Str)
dim i
dim Str_one
dim Str_unicode
For i=1 to len(Str)
Str_one=Mid(Str,i,1)
Str_unicode=Str_unicode&chr(38)
Str_unicode=Str_unicode&chr(35)
Str_unicode=Str_unicode&chr(120)
Str_unicode=Str_unicode& Hex(ascw(Str_one))
Str_unicode=Str_unicode&chr(59)
Next
chinese2unicode = Str_unicode
End Function
dim conn,rs,sql,topic_title,topic_temp
set conn=openbbsdb("oabusy","conn","accessdsn")
set rs=server.createobject("adodb.recordset")
sql="select top 3 * from topic where bd=9 and type<>3 order by top desc, edittime desc"
rs.open sql,conn,3,1
if rs.eof and rs.bof then
response.write ("Sorry,暫無文章錄入!")
else
rs.pagesize=20
response.write "
"
for ipage=1 to rs.pagesize
topicinfo=rs("topicinfo")
topicinfo=split(topicinfo,"|")
topic_temp=chinese2unicode(topicinfo(1))
topic_title=left(topic_temp,96)
if right(topic_title,1)&"CS"<>";CS" then topic_title=left(topic_temp,98)
if right(topic_title,1)&"CS"<>";CS" then topic_title=left(topic_temp,100)
if right(topic_title,1)&"CS"<>";CS" then topic_title=left(topic_temp,94)
if right(topic_title,1)&"CS"<>";CS" then topic_title=left(topic_temp,92)
response.write ""& topic_title &"..."
if datediff("d",rs("edittime"),now())<3 then response.write ("")
response.write " |
"
rs.movenext
if rs.eof then exit for
next
response.write "
"
end if
rs.close
set rs=nothing
%>
<%
set rs=server.createobject("adodb.recordset")
sql="select top 2 * from topic where bd=2 and type<>3 order by top desc, edittime desc"
rs.open sql,conn,3,1
if rs.eof and rs.bof then
response.write ("Sorry,暫無文章錄入!")
else
rs.pagesize=20
response.write "
"
for ipage=1 to rs.pagesize
topicinfo=rs("topicinfo")
topicinfo=split(topicinfo,"|")
topic_temp=chinese2unicode(topicinfo(1))
topic_title=left(topic_temp,96)
if right(topic_title,1)&"CS"<>";CS" then topic_title=left(topic_temp,98)
if right(topic_title,1)&"CS"<>";CS" then topic_title=left(topic_temp,100)
if right(topic_title,1)&"CS"<>";CS" then topic_title=left(topic_temp,94)
if right(topic_title,1)&"CS"<>";CS" then topic_title=left(topic_temp,92)
response.write ""& topic_title &"..."
if datediff("d",rs("edittime"),now())<3 then response.write ("")
response.write " |
"
rs.movenext
if rs.eof then exit for
next
response.write "
"
end if
rs.close
set rs=nothing
%>
<%
set rs=server.createobject("adodb.recordset")
sql="select top 2 * from topic where bd=3 and type<>3 order by top desc, edittime desc"
rs.open sql,conn,3,1
if rs.eof and rs.bof then
response.write ("Sorry,暫無文章錄入!")
else
rs.pagesize=20
response.write "
"
for ipage=1 to rs.pagesize
topicinfo=rs("topicinfo")
topicinfo=split(topicinfo,"|")
topic_temp=chinese2unicode(topicinfo(1))
topic_title=left(topic_temp,96)
if right(topic_title,1)&"CS"<>";CS" then topic_title=left(topic_temp,98)
if right(topic_title,1)&"CS"<>";CS" then topic_title=left(topic_temp,100)
if right(topic_title,1)&"CS"<>";CS" then topic_title=left(topic_temp,94)
if right(topic_title,1)&"CS"<>";CS" then topic_title=left(topic_temp,92)
response.write ""& topic_title &"..."
if datediff("d",rs("edittime"),now())<3 then response.write ("")
response.write " |
"
rs.movenext
if rs.eof then exit for
next
response.write "
"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>