⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fywen_posts.asp

📁 好用的贴吧源代码
💻 ASP
字号:
<%
'├========================================┤
'‖             www.fywen.com              ‖
'‖       ╔━═━═━═━═━═━╗       ‖
'‖       ┃   枫叶在线版权所有   ┃       ‖
'‖       ╚━═━═━═━═━═━╝       ‖
'‖         论坛:www.fywen.com/bbs        ‖
'├========================================┤

'----------------------------------------------------------

'‖=======================================================‖
'‖贴吧搜索调用
'‖过程名:Posts_search
'‖参数:
'‖      Postnu--------每页帖子条数
'‖      PostsFont--------标题文字长度 默认30
'‖      Postid--------贴子ID
'‖=======================================================‖
    Sub Posts_search(Postnu,PostsFont,Postid)
	Dim idpsot,idclass
	Postpage = request.QueryString("Postpage")
    If Postpage ="" Then
    Postpage=1
    Else 
    Postpage=Postpage+1
    Postpage=Postpage-1
    End If
	If ReplaceBadWord(Request.Form("searchname"))="" Then
    searchname=ReplaceBadWord(Request.QueryString("searchname"))
    Else
    searchname=ReplaceBadWord(Request.Form("searchname"))
	End If
	response.write "<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"" >"
	    If Postpage=1 Then
          sql1="select * from [title] where [id]="&Postid&" ORDER by id DESC"
	      set rs1=server.createobject("adodb.recordset")
	      rs1.open sql1,conn,1
	       title=rs1("title")
           If len(title)>PostsFont Then
	       title=left(title,PostsFont)&"..."
	       End if
		   idpsot = idpsot + 1 
	       if idpsot mod 2 = 0 then 
           idclass = "class=""line_2_2""" 
           else
           idclass = "class=""line_2_1""" 
	       end if
		   img = Rs1("img")
		If img="0" then
	      Response.Write"<tr><td height=""30"" class=""table_7""><strong>"&idpsot&"."&title&"</strong></td></tr>"
		  Response.Write"<tr><td "&idclass&"><table width=""98%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0""><tr><td height=""8"" colspan=""5""></td></tr>"
          Response.Write"<tr><td height=""55"" colspan=""5"" valign=""top"" style=""word-break:break-all"" class=""table_size"">"&Rs1("body")&"</td></tr>"
		  call pop_edit(Rs1("id"))
          Response.Write"<tr >"
          Response.Write"<td width=""18%"" class=""table_5"" height=""25"">作者:"
		  call user_ip(Rs1("username"),Ipnum)'通过IP函数处理IP
		  response.Write "</td>"
          Response.Write"<td width=""17%"" class=""index_titlesize_2"">"&Rs1("time")&"</td>"
          Response.Write"<td width=""20%""><a href=""#Post"" class=""index_titlesize_1"">回复此发言</a></td><td width=""26%"">"
          Call Vippost_User(searchname,rs1("id"),rs1("hottitle"),rs1("toptitle"))'判断相关操作函数
	      Response.Write"</td><td width=""19%""><div align=""right""><a href=""#top""><img src=""image/top1.gif"" border=""0""></a></div></td></tr></table></td></tr>"
		Else
	      Response.Write"<tr><td height=""30"" class=""table_7""><strong>"&idpsot&"."&title&"</strong></td></tr>"
		  Response.Write"<tr><td "&idclass&"><table width=""98%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0""><tr><td height=""8"" colspan=""5""></td></tr>"
          Response.Write"<tr><td height=""55"" colspan=""5"" valign=""top"" style=""word-break:break-all"" class=""table_size"">"&Rs1("body")&"<br/>帖子相关图片:<br/><img src="""&Rs1("img")&""" onload='javascript:if(this.width>720)this.width=720;'/></td></tr>"
		  call pop_edit(Rs1("id"))
          Response.Write"<tr >"
          Response.Write"<td width=""18%"" class=""table_5"" height=""25"">作者:"
		  call user_ip(Rs1("username"),Ipnum)'通过IP函数处理IP
		  response.Write "</td>"
          Response.Write"<td width=""17%"" class=""index_titlesize_2"" >"&Rs1("time")&"</td>"
          Response.Write"<td width=""20%""><a href=""#Post"" class=""index_titlesize_1"">回复此发言</a></td><td width=""33%"">"
          Call Vippost_User(searchname,rs1("id"),rs1("hottitle"),rs1("toptitle"))'判断相关操作函数
	      Response.Write"</td><td width=""12%""><div align=""right""><a href=""#top""><img src=""image/top1.gif"" border=""0""></a></div></td></tr></table></td></tr>"
		End If
		Else
		  sql1="select * from [title] where [id]="&Postid&" ORDER by id DESC"
	      set rs1=server.createobject("adodb.recordset")
	      rs1.open sql1,conn,1
	   End If
        sql="select * from [retitle] where [postid]="&Postid&" ORDER by id ASC"
	    set rs=server.createobject("adodb.recordset")
	    rs.cursortype=adopenstatic
        rs.pagesize = Postnu
	    rs.open sql,conn,1
	if rs.Eof then 
	    response.Write "<tr><td colspan='6'><div align='center'></div></td></tr></table>"
	else
		rs.absolutepage = cint(Postpage)
    do while not rs.eof and a < rs.pagesize
	 idpsot = idpsot + 1 
	 if idpsot mod 2 = 0 then 
     idclass = "class=""line_2_2""" 
     else
     idclass = "class=""line_2_1""" 
	 end if
    a=a+1
	if postpage<>1 then
	id_psot=postnu*(Postpage-1)+idpsot+1
	else
	id_psot=idpsot
	end if
	title=rs("title")
	If len(title)>PostsFont Then
	title=left(title,PostsFont)&"..."
	End If
	If rs("img")= "0" Then
	   Response.Write"<tr><td "&idclass&" >"
	   Response.Write"<table width=""98%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"">"
	   Response.Write"<tr><td height=""8"" colspan=""5""></td></tr>"
	   Response.Write"<tr><td colspan=""5"" height=""20"">"&id_psot&"."&title&"</td></tr><tr>"
	   Response.Write"<td height=""55"" colspan=""5"" valign=""top"" class=""table_6 table_size"" style=""word-break:break-all"">"&Rs("body")&"</td></tr>"
	   call pops_edit(Rs("id"))
       Response.Write"<td width=""18%"" class=""table_5"" height=""25"">作者:"
	   call user_ip(Rs("username"),Ipnum)'通过IP函数处理IP
	   response.Write "</td>"
       Response.Write"<td width=""17%"" class=""index_titlesize_2"">"&Rs("time")&"</td>"
       Response.Write"<td width=""20%""><a href=""#Post"" class=""index_titlesize_1"">回复此发言</a></td><td width=""26%"">"
       Call Vipposts_User(searchname,rs("id"),rs1("id"))'判断相关操作函数
	   Response.Write"</td><td width=""19%""><div align=""right""><a href=""#top""><img src=""image/top1.gif"" border=""0""></a></div></td></tr></table></td></tr>"
	Else
	   Response.Write"<tr><td "&idclass&" >"
	   Response.Write"<table width=""98%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"">"
	   Response.Write"<tr><td height=""8"" colspan=""5""></td></tr>"
	   Response.Write"<tr><td colspan=""5"" height=""20"">"&id_psot&"."&title&"</td></tr><tr>"
	   Response.Write"<td height=""55"" colspan=""5"" valign=""top"" class=""table_6 table_size"" style=""word-break:break-all"">"&Rs("body")&"<br/><br/>帖子相关图片:<br/><img src="""&Rs("img")&""" onload='javascript:if(this.width>720)this.width=720;'/></td></tr>"
	   call pops_edit(Rs("id"))
       Response.Write"<td width=""18%"" class=""table_5"" height=""25"">作者:"
	   call user_ip(Rs("username"),Ipnum)'通过IP函数处理IP
	   response.Write "</td>"
       Response.Write"<td width=""18%"" class=""index_titlesize_2"">"&Rs("time")&"</td>"
       Response.Write"<td width=""20%""><a href=""#Post"" class=""index_titlesize_1"">回复此发言</a></td><td width=""26%"">"
       Call Vipposts_User(searchname,rs("id"),rs1("id"))'判断相关操作函数
	   Response.Write"</td><td width=""19%""><div align=""right""><a href=""#top""><img src=""image/top1.gif"" border=""0""></a></div></td></tr></table></td></tr>"
    End If
	rs.movenext
loop
if rs.eof and rs.bof then
      response.Write"<tr><td height=""16""></td></tr>"
else
response.Write"<tr><td height=""20"">"
Response.Write "<div class='news_fywen2'>&nbsp;&nbsp;&nbsp;&nbsp;"&Postnu&"条/页 当前页次:"&Postpage&"/"&rs.pagecount&"&nbsp;"
if Postpage <> 1 then
Response.Write "<!--<img src='images/first.gif' alt='首页' border='0' />--><a href='Fywen_posts.Asp?Postid="&Postid&"&Postpage=1&searchname="&Server.URLEncode(searchname)&"'><font color='#000000'>首页</font></a>"
else
Response.Write "<!--<img src='images/first.gif' alt='首页' border='0' />-->首页"
end if
response.Write"&nbsp;"
if Postpage > 1 then
Response.Write "<!--<img src='images/sy.gif' alt='上一页' border='0' />--><a href='Fywen_posts.Asp?Postid="&Postid&"&Postpage="&Postpage-1&"&searchname="&Server.URLEncode(searchname)&"'><font color='#000000'>上一页</font></a>"
else
Response.Write "<!--<img src='images/sy.gif' alt='上一页' border='0' />-->上一页"
end if
response.Write"&nbsp;"
if Postpage <= rs.pagecount-1 then

Response.Write "<a href='Fywen_posts.Asp?Postid="&Postid&"&Postpage="&Postpage+1&"&searchname="&Server.URLEncode(searchname)&"'><font color='#000000'>下一页</font></a><!--<img src='images/xw.gif' alt='下一页' border='0' />-->"
else
Response.Write "下一页<!--<img src='images/xw.gif' alt='下一页' border='0' />-->"
end if
response.Write"&nbsp;"
if Postpage <= rs.pagecount-1 then
Response.Write "<a href='Fywen_posts.Asp?Postid="&Postid&"&Postpage="&rs.pagecount&"&searchname="&Server.URLEncode(searchname)&"'><font color='#000000'>尾页</font></a><!--<img src='images/last.gif' alt='尾页' border='0' />-->"
else
Response.Write "尾页<!--<img src='images/last.gif' alt='尾页' border='0' />-->"
end if
response.Write"<td></tr></table>"
end if
end if
end sub
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -