<!--#include file="../conn.asp" -->
<%
id=request("id")
userid=request("userid")
Set Rss=Server.CreateObject("adodb.recordset")
Select Case request("itype")
Case "pinglunshu"
sql="Select count(playID) as pinglunshu From replay where playID="&id
Rss.Open sql,Conn,1,1
response.write("document.write(""<FONT color=brown>"&Rss("pinglunshu")&"</FONT>"")")
Case "pre"
if session("username")="" or session("userid")="" then
Sql="select top 1 * from diary where userid="&userid&" and diaryid<"&id&" and display=1 order by diaryid desc"
else
Sql="select top 1 * from diary where userid="&userid&" and diaryid<"&id&" order by diaryid desc"
end if
Rss.Open SQL,Conn,1,1
If not Rss.EOF Then
response.write("document.write(""<FONT color=grey>上一篇:</FONT><a href='../w/riji"&rss("diaryid")&".htm'><FONT color=#aaa>"&rss("title")&"</FONT></a>"")")
else
response.write("document.write(""<FONT color=brown>上一篇:没有了</FONT>"")")
end If
Case "next"
if session("username")="" or session("userid")="" then
Sql="select top 1 * from diary where userid="&userid&" and diaryid>"&id&" and display=1 order by diaryid asc"
else
Sql="select top 1 * from diary where userid="&userid&" and diaryid>"&id&" order by diaryid asc"
end if
Rss.Open SQL,Conn,1,1
If not Rss.EOF Then
response.write("document.write(""<FONT color=grey>下一篇:</FONT><a href='../w/riji"&rss("diaryid")&".htm'><FONT color=#aaa>"&rss("title")&"</FONT></a>"")")
else
response.write("document.write(""<FONT color=brown>下一篇:没有了</FONT>"")")
end If
Case "preno"
if session("username")="" or session("userid")="" then
Sql="select top 1 * from diary where userid="&userid&" and diaryid<"&id&" and display=1 order by diaryid desc"
else
Sql="select top 1 * from diary where userid="&userid&" and diaryid<"&id&" order by diaryid desc"
end if
Rss.Open SQL,Conn,1,1
If not Rss.EOF Then
response.write("document.write(""<a href='../w/riji"&rss("diaryid")&".htm'><FONT color=#aaa>上一篇</FONT></a>"")")
else
response.write("document.write(""<FONT color=brown>没有了</FONT>"")")
end If
Case "nextno"
if session("username")="" or session("userid")="" then
Sql="select top 1 * from diary where userid="&userid&" and diaryid>"&id&" and display=1 order by diaryid asc"
else
Sql="select top 1 * from diary where userid="&userid&" and diaryid>"&id&" order by diaryid asc"
end if
Rss.Open SQL,Conn,1,1
If not Rss.EOF Then
response.write("document.write(""<a href='../w/riji"&rss("diaryid")&".htm'><FONT color=#aaa>下一篇</FONT></a>"")")
else
response.write("document.write(""<FONT color=brown>下一篇</FONT>"")")
end If

Case "apre"
if session("username")="" or session("userid")="" then
Sql="select top 1 * from diary where userid="&userid&" and diaryid<"&id&" and display=1 order by diaryid desc"
else
Sql="select top 1 * from diary where userid="&userid&" and diaryid<"&id&" order by diaryid desc"
end if
Rss.Open SQL,Conn,1,1
If not Rss.EOF Then
response.write("document.write(""<area shape=rect coords='"&request("a")&","&request("b")&","&request("c")&","&request("d")&"' href='../w/riji"&rss("diaryid")&".htm'>"")")
else
end If
Case "anext"
if session("username")="" or session("userid")="" then
Sql="select top 1 * from diary where userid="&userid&" and diaryid>"&id&" and display=1 order by diaryid asc"
else
Sql="select top 1 * from diary where userid="&userid&" and diaryid>"&id&" order by diaryid asc"
end if
Rss.Open SQL,Conn,1,1
If not Rss.EOF Then
response.write("document.write(""<area shape=rect coords='"&request("a")&","&request("b")&","&request("c")&","&request("d")&"' href='../w/riji"&rss("diaryid")&".htm'>"")")
else
end If

Case "blankpre"
if session("username")="" or session("userid")="" then
Sql="select top 1 * from diary where userid="&userid&" and diaryid<"&id&" and display=1 order by diaryid desc"
else
Sql="select top 1 * from diary where userid="&userid&" and diaryid<"&id&" order by diaryid desc"
end if
Rss.Open SQL,Conn,1,1
If not Rss.EOF Then
response.write("document.write(""<a href='../w/riji"&rss("diaryid")&".htm'><FONT color=#aaa><img style='cursor:hand' onClick='openboxb();' src='../diary/blank.gif' border='0' align='middle' width='62' height='31'></FONT></a>"")")
else
end If
Case "blanknext"
if session("username")="" or session("userid")="" then
Sql="select top 1 * from diary where userid="&userid&" and diaryid>"&id&" and display=1 order by diaryid asc"
else
Sql="select top 1 * from diary where userid="&userid&" and diaryid>"&id&" order by diaryid asc"
end if
Rss.Open SQL,Conn,1,1
If not Rss.EOF Then
response.write("document.write(""<a href='../w/riji"&rss("diaryid")&".htm'><FONT color=#aaa><img style='cursor:hand' onClick='openboxb();' src='../diary/blank.gif' border='0' align='middle' width='62' height='31'></FONT></a>"")")
else
end if
End Select
Rss.Close
SET Rss=Nothing
%>
