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

📄 news_view.asp

📁 Art2008 CMS是一款具有强大的功能的基于ASP语言的网站管理软件
💻 ASP
📖 第 1 页 / 共 2 页
字号:
  nr=replace(nr,"$$图片来源$$",piczz)
  nr=replace(nr,"$$编辑$$",rs("adduser"))  '豪-2006-9-16-增加一个编辑
  nr=replace(nr,"$$评论$$",ppll)
  nr=replace(nr,"$$打印$$",pp)
  nr=replace(nr,"$$工具栏$$",pp)
  nr=replace(nr,"$$NEWSID$$",newsid)  '2。5版新增的标签。
  nr=replace(nr,"$$网站名$$",setting("sitename"))
  nr=replace(nr,"$$网站描述$$",ClassDescription)
  nr=replace(nr,"$$关键字$$",ClassKeywords)
  nr=replace(nr,"$$版权信息$$",setting("sitecr"))
  '2006-10-23日增加一个$$网站目录$$标签。
  root_path=finddir(request.servervariables("URL"))   '取出系统程序的工作目录.
  nr=replace(nr,"$$网站目录$$",root_path)  '豪-2006-10-23-增加一个网站目录,代替绝对路径。方便网站的转移时,不必再修改模板

 if Instr(nr,"$$上下条$$")>0 then 
        uuu="<script language=""javascript"" src="""&root_path&"js_news_updown.asp?news_id="&newsid&"&lm_id="&lmid&"""></script>"
   
	   nr=replace(nr,"$$上下条$$",uuu)
 end if
 
   Dim xgnews
   Set xgrs = Server.CreateObject("ADODB.RecordSet")
   xgrs.Open "select top 10 * from [news] where ( title like '%"&webxgnews&"%' or xgnews like '%"&webxgnews&"%' ) and id<>"&chkhtm(trim(Request("newsid")))&" order by id desc",conn,1,1
   if xgrs.recordcount=0 then 
   xgnews="没有相关信息"
   else
   xgnews="<b>相关新闻:</b><br><br>"
   while not xgrs.eof
     xgnews=xgnews + "·<a href="&fun_html_url(xgrs("id"))&" title='"&xgrs("title")&"'>"&xgrs("title")&"</a><BR>"
     xgrs.movenext
     wend
   end if
    xgrs.close:set xgrs=nothing
  
   nr=replace(nr,"$$相关$$",xgnews)
  
  response.write nr

else
  response.write "<center><BR><BR><BR>模版设置不正确。"
end if 
rs3.close
set rs3=nothing
else
  Response.Write "<center><BR><BR><BR>此栏目模版设置不正确"
  mbid=1
end if

rs2.close
set rs2=nothing

conn.close
set conn=nothing



sub select_page_Css()
     
	  if right(content,len(nextpage_string))=nextpage_string then content=left(content,len(content)-len(nextpage_string))  '去掉最后一个分页符.防止一个人无意在最后加一个分页符.导至下面数组出错

         if content<>"" then
            array_content=split(content,nextpage_string)
         else
            array_content=split(content&"&nbsp;",nextpage_string)
         end if

        max_page_numbers=ubound(array_content) '取出本文章有多少页

        if page>max_page_numbers then page=max_page_numbers  '容错,如果返回的页数大于原有页数,则

        content=array_content(page)  '取出当前页的内容,又赋给content,懒得改后面的content名称.


'分页的状态: 
'page_Css="1"--第一种样式: 共N页, 第1页,第2页,第3页..最后一页
'page_Css="2"--第二种样式: ,第[N]页,上一页,下一页,共N页
'page_Css="3"--第三种样式: 上一页[1][2][3][4]下一页
'page_Css="4"--第四种样式: < <<[1][2][3][4]  >> >

if max_page_numbers>0 then  '只有一页时,不显示分页状态条.
    content=content&"<Div class=Pagetype>"
   select case page_Css
     case "1"
         content=content&"<DIV class=Pagetype1><TABLE><tr><td>"
		  content=content&"共["&max_page_numbers+1&"]页:"
          for p=0 to max_page_numbers
              content=content&"&nbsp;<a href='"&fun_html_url(newsid)&"&page="&p&"'>[第"&p+1&"页]</a>&nbsp;"
          next
		   content=content&"</td></tr></TABLE></Div>"
	 case "2"
         content=content&"<DIV class=Pagetype2><TABLE><tr><td>"
		  content=content&"第<font color='red'>["&page+1&"]</font>页&nbsp;"
		      if page=0 then content=content&"&nbsp;<a href='"&fun_html_url(newsid)&"&page="&page+1&"'>[下一页]>></a>&nbsp;"

              if page<>0 and page<>max_page_numbers  then
			     content=content&"&nbsp;<a href='"&fun_html_url(newsid)&"&page="&page-1&"'>上一页</a>&nbsp;"
				 content=content&"&nbsp;<a href='"&fun_html_url(newsid)&"&page="&page+1&"'>下一页</a>&nbsp;"
			  end if

			  if page=max_page_numbers then content=content&"&nbsp;<a href='"&fun_html_url(newsid)&"&page="&page-1&"'><<[上一页]</a>&nbsp;"

             content=content&"共["&max_page_numbers+1&"]页"
		   content=content&"</td></tr></TABLE></Div>"
     
	  case "3"	 
             content=content&"<DIV class=Pagetype3><TABLE><tr><td>"
	   		  If Page=0 Then
			     Content=Content& "<SPAN class=""s3"">上一页</SPAN>"
				ElseIf Page=1 Then
			     Content=Content& "<a href="""&fun_html_url(newsid)&""" title=""上一页"" class=s1>上一页</a>"
				Else
				
				 Content=Content& "<a href="""&fun_html_url(newsid)&"&Page="&  Page - 1 &""" title=""上一页"" class=s1>上一页</a>"
			End If
			
				dim startpage,n
				 startpage=0:n=0				
				if (Page>=10) then startpage=(Page\10-1)*10+Page mod 10+2
				
				 For J=startpage To max_page_numbers
				    If J= Page Then
				     Content=Content&  " <a href=""#"" class=s2 >" & cstr(J+1) &"</a>"
				    Else
					 if J=0 then
				     content=content&"<a href="""&fun_html_url(newsid)&""">" & (J+1) & "</a>"
				     else
				     Content=Content&"<a href="""&fun_html_url(newsid)&"&Page=" & J&""">" & (J+1) & "</a>"
				     end if
					End If
					n=n+1
					if n>10 Then Exit For
				 Next
				 If Page=max_page_numbers Then
				  Content=Content&  " <SPAN class=""s3"">下一页</SPAN> "
				 Else
				  Content=Content&  " <a href="""&fun_html_url(newsid)&"&Page=" & Page + 1 & """ title=""下一页"" class=s1>下一页</a> "
				 End If	
	       
		   content=content&"</td></tr></TABLE></Div>"

	 case "4"
	        content=content&"<DIV class=Pagetype4><TABLE><tr><td>"
			 If Page=0 Then
			     Content=Content& "<font face=webdings>9</font> <font face=webdings>7</font>"
				ElseIf Page=2 Then
			     Content=Content& "<a href="""&fun_html_url(newsid)&""" title=""首页""><font face=webdings>9</font></a> <a href="""&fun_html_url(newsid)&""" title=""上一页""><font face=webdings>7</font></a>"
				Else
				  Content=Content& "<a href="""&fun_html_url(newsid)&""" title=""首页""><font face=webdings>9</font></a> <a href="""&fun_html_url(newsid)&"&Page="&  Page - 1 &""" title=""上一页""><font face=webdings>7</font></a> "

				End If
				 
				  startpage=0:n=0
				 if (Page>=10) then startpage=(Page\10-1)*10+Page mod 10+2
				
				 For J=startpage To max_page_numbers
				    If J= Page Then
				     Content=Content&  " <a href=""#""><font color=red>" & cstr(J+1) &"</font></a>"
				    Else
					 if J=0 then
				     content=content&" <a href="""&fun_html_url(newsid)&""">" & (J+1) & "</a>"
				     else
				     Content=Content&" <a href="""&fun_html_url(newsid)&"&Page=" & J&""">" & (J+1) & "</a>"
				     end if
					
					
					End If
					n=n+1
					if n>=10 then exit for
				 Next
				 If Page=max_page_numbers Then
				  Content=Content&  " <font face=webdings>8</font> <font face=webdings>:</font>"
				 Else
				  Content=Content&  " <a href="""&fun_html_url(newsid)&"&Page=" & Page + 1 & """ title=""下一页""><font face=webdings>8</font></a> <a href="""&fun_html_url(newsid)&"&Page=" & max_page_numbers& """><font face=webdings>:</font></a> "
				 End If	 
		   content=content&"</td></tr></TABLE></Div>"
			
		  
		   
			  
		'case "5"	
			  ' content=content&"第<font color='red'>["&page+1&"]</font>页&nbsp;"
			  ' If Page = 1 And Page <> max_page_numbers Then
			  
				'content=content&  "首页  上一页 <a href="""&fun_html_url(newsid)&"&Page=" & Page + 1 & """>下一页</a>  <a href= """&fun_html_url(newsid)&"&Page=" & max_page_numbers & """>尾页</a>"
			  ' ElseIf Page = 1 And Page = max_page_numbers Then
				'content=content& "首页  上一页 下一页 尾页"
			  ' ElseIf Page = max_page_numbers And Page <> 2 Then  '对于最后一页刚好是第二页的要做特殊处理
				 'content=content& "<a href="""&fun_html_url(newsid)&""">首页</a>  <a href="""&fun_html_url(newsid)&"&Page=" & Page - 1 & """>上一页</a> 下一页  尾页"
			  ' ElseIf Page = max_page_numbers And Page = 2 Then
				 'content=content& "<a href="""&fun_html_url(newsid)&""">首页</a>  <a href="""&fun_html_url(newsid)&""">上一页</a> 下一页  尾页"
			  ' ElseIf Page = 2 Then
				'content=content& "<a href="""&fun_html_url(newsid)&""">首页</a>  <a href="""&fun_html_url(newsid)&""">上一页</a> <a href="""&fun_html_url(newsid)&"&Page=" & Page + 1 & """>下一页</a>  <a href= """&fun_html_url(newsid)&"&Page=" &max_page_numbers & """>尾页</a>"
			  'Else
				'content=content& "<a href="""&fun_html_url(newsid)&""">首页</a>  <a href="""&fun_html_url(newsid)&"&Page=" & Page - 1 & """>上一页</a> <a href="""&fun_html_url(newsid)&"&Page=" & Page + 1 & """>下一页</a>  <a href= """&fun_html_url(newsid)&"&Page=" & max_page_numbers & """>尾页</a>"
			   'End If 
	           'content=content&"&nbsp;共["&max_page_numbers+1&"]页"
	  
    end select
     content=content&"</Div>"
    end if  
  '结束:只有一页时,不显示分页状态条.
 end sub

%>

⌨️ 快捷键说明

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