<!--#include file="../inc/conn.asp"-->
<%
'============================================================
'插件名称：Tags
'Website：http://www.sdcms.cn
'Author：sdcms.cn
'Date：2009-2-10
'============================================================
id=request.QueryString()
set sdcms=new sdcms_Power
set sdcms_f=new sdcms_function
'id=sdcms_f.HTMLEncode(id)
if id="" then loadtemp="sdcms_tag.htm" else loadtemp="sdcms_tag_list.htm"
show=sdcms_f.LoadFile(""&Load_temp_dir&loadtemp)
if left(id,1)<>"/" then id="/"&id
if right(id,1)<>"/" then id=id&"/"
id=split(id,"/")
show_tagname=URLDecode(trim(id(1)))
sdcms.sdcms_power(id)
response.Write show

set sdcms_f=nothing
set sdcms=nothing
 
Sub showtagslist(t0)
show_tagname=id(1)
	page=request.querystring("page")
	if page="" or not isnumeric(page) then
	page=1
	end if
	pages =t0
	set rs=server.CreateObject("adodb.recordset")
	sql="select id,title,jj,classid,htmlname,tags from sd_info where tags like '%"&sdcms_f.HTMLEncode(URLDecode(trim(id(1))))&"%' order by id desc"
	rs.open sql,conn,1,1	
	if rs.eof then
	show_tagslist=show_tagslist&"没有资料"
	else
	rs.pagesize = pages
	maxpagecount=rs.pagecount
	rs.absolutepage = page 
	rcount1=0
	pagestart=page-5
	pageend=page+5
	if pagestart<1 then
	pagestart=1
	end if
	if pageend>maxpagecount then
	pageend=maxpagecount
	end if
	rcount=rs.RecordCount
	do while not rs.eof and rcount1 <rs.pagesize
	show_tagslist=show_tagslist&"<li><h1><a href="&sdcms_root&sdcms_htmdir&sdcms_f.LoadRecord("classdir","sd_class",rs(3))&rs(4)&sdcms_filetxt&" target=""_blank"">"&rs(1)&"</a></h1></li>"
	show_tagslist=show_tagslist&"<li><span>"&sdcms_f.gottopic(rs(2),200)&"</span><br>标签："&get_tags(rs(5))&"<hr></li>"
	rs.movenext
	rcount1=rcount1+1
	loop
	show_tagslist=show_tagslist&"总计："&rcount
	end if 
	conn.execute("update sd_tags set hits=hits+1 where title='"&id(1)&"'")
End Sub
%>