<!--#include file="connshi.asp"-->

<%Call head()
	dim rs,sql,i,id,PageCount,Page,PageOut,PageIn,PageSize,content,classid,Repcount,name

dim sy,sid
sy=request.QueryString("sy")
sid=request.QueryString("sid")
if sy="" then sy="saytk"
	PageSize=500

	id=Request.QueryString("id")
	if id="" then id=0
	if not isnumeric(id) then id=0
	id=clng(id)

    	Page = Request("page")      '当前页数
    	If Page = "" Then Page = 1
   	If Not IsNumeric(Page) Then Page = 1
    	Page = CLng(Page)
    	If Page < 1 Then Page = 1

	connshici.execute("update shici set tj=tj+1 where id="&id)

	Set Rs = Server.CreateObject("Adodb.Recordset")

	Sql = "select * from [shici] where id="&id
	Rs.Open Sql,connshici,1,1
	if not (rs.bof and rs.eof)  Then
	if rs("tj")="" or Isnumeric(rs("tj"))=False Then
	connshici.execute("update shici set tj=1 where id="&id) 
	End if
	



	Repcount=rs("Repcount")
	classid=rs("id")
	name=rs("name")
	content=rs("content")
	''''''''''''''''''智能分页''''''''''''''''''''''
        Dim  n
        I = 1
        Do
            n = n + 1
            If n = page Then
                PageIn = I
            End If
            If InStr(I, content, "[page]") - I < PageSize + PageSize / 4 * 3 And InStr(I, content, "[page]") <> 0 Then
                I = InStr(I, content, "[page]") + 6
            Else
                I = I + PageSize
            End If
            If n = page Then
                PageOut = I
            End If

        Loop While I < Len(content)
        PageCount = n
	if page>PageCount then page=PageCount

	if Pagein="" then Pagein=(PageCount-1)*PageSize+1
	if Pageout="" then Pageout=Len(content)-(PageCount-1)*PageSize+Pagein

	if len(content)>0 then content=replace(mid(content,Pagein,Pageout-Pagein),"[page]","")


Call saycarda("查看短信")



		if xy="Null" then
		%><%
		else
		xywap.info
		end if


		%>
		标题:<%=rs("name")%>(<%=rs("tj")%>)<br/>
		
		--------------<br/>
		<%=content%><br/>
		--------------<br/>

		
		
		<%
if myid<>0 then
mz="[url=/bbs/uinfo.asp?id="&myid&"&amp;saytk=[saytk]&amp;sid=[sid]]"&myni&"[/url]"
else
mz="游客"&Replace(time(),":","")&""
end if
conn.execute("insert into sqdt(shijian,dz)values('"&now&"','"&mz&"阅读了诗词(url=/qtwap/shi/view.asp?id="&id&"&amp;saytk=[saytk]&amp;sid=[sid])"&rs("name")&"(/url)')")

    		'分页
    		If Page < PageCount Then
    		    Response.Write("<a href='view.asp?id="&id&"&amp;page=" & Page + 1 & "&amp;sid="&sid&"&amp;saytk="&saytk&"&amp;sy="&sy&"'>下一页</a>")
    		End If
       
    		If Page > 1 And Page < PageCount Then
    		    Response.Write("|")
    		End If
        
    		If Page > 1 Then
    		    Response.Write("<a href='view.asp?id="&id&"&amp;page=" & Page - 1 & "&amp;sid="&sid&"&amp;saytk="&saytk&"&amp;sy="&sy&"'>上一页</a><br/>")
    		Elseif PageCount >1 then
    		    Response.Write("<br/>")
    		End If
            
    		Randomize()
    
    		If PageCount > 2 Then
    		    Response.Write("<input name='Page' format='*N' size='5' maxlength='5'/>")
    		    Response.Write("<a href='view.asp?id="&id&"&amp;page=$(Page:n)&amp;sid="&sid&"&amp;saytk="&saytk&"&amp;sy="&sy&"'>跳页</a><br/>")
   		End If
                                                                
 

    		Response.Write("(第" & Page & "/总" & PageCount & "页/"&len(rs("content"))&"字)<br/>")


	
%>
		<%If rs("pinglun")<>"" Then%><%=rs("pinglun")%><br/><%End if%>
		<%If rs("comment")<>"" Then%><%=rs("comment")%><br/><%End if%>
		<%If rs("sub_tt")<>"" Then%><%=rs("sub_tt")%><br/><%End if%>
		<%If rs("tiji")<>"" Then%><%=rs("tiji")%><br/><%End if%>
<a href='ext:sms/<%=ubb1(rs("content"))%>'>UCWEB点击发送</a>
<input name="11" size="6" type="text" value="<%=ubb1(rs("content"))%>"/><br/><%
		
 	end if
	
	Rs.close

	Sql = "select top 1 id,[name] from [shici] where id<"&id&"  order by id desc"

	Rs.Open Sql,connshici,1,1
	if not (rs.bof and rs.eof)  then
			%>< <a href="view.asp?id=<%=rs(0)%>&amp;sid=<%=sid%>&amp;saytk=<%=saytk%>&amp;sy=<%=sy%>"><%=rs("name")%></a><br/><%
	end if
	Rs.close	



	Sql = "select top 1 id,[name] from [shici] where id>"&id&"  order by id asc"

	Rs.Open Sql,connshici,1,1
	if not (rs.bof and rs.eof)  then
			%>> <a href="view.asp?id=<%=rs(0)%>&amp;sid=<%=sid%>&amp;saytk=<%=saytk%>&amp;sy=<%=sy%>"><%=rs("name")%></a><br/><%
	end if
	Rs.close	
	set rs=Nothing





  		    Response.Write("<a href='list.asp?listid="&classid&"&amp;sid="&sid&"&amp;saytk="&saytk&"&amp;sy="&sy&"'>返回列表</a><br/>")

    		Response.Write("<a href='index.asp?sid="&sid&"&amp;saytk="&saytk&"&amp;sy="&sy&"'>诗词首页</a>|<a href='/index.asp?sid="&sid&"&amp;saytk="&saytk&"'>首页</a><br/>")

Call headsay()
%>

