<!-- #include file="include/set.asp" -->
<!-- #include file="../include/jk_pagecute.asp" --> 
<!-- #include file="../include/jk_page_cute.asp" --> 
<!-- #include file="../include/jk_keyes.asp" --> 

<%
'****************************************************
' HSCMS 1.2      Power by 2332.cn
' Email: 116116089@qq.com
' Web: http://www.2332.cn
' Copyright (C) 2004 2332.com All Rights Reserved.
'****************************************************
dim sql_order,strTag
iframe=true
	 dim intK,intJ,intH
'最小标签象素
Const cc_tag_small = 12
'最大标签象素
Const cc_tag_large = 36

dim nummer,nums,rssum,page,viewpage,thepages,pageurl,keyword22,id,zhuangtai,urlimg,action11,aaa,imagezt,bbb,yinsi,num_col,pnum,w_num,vvt,vvs,nid,nname,nemoney,tr_ture,vhead,c_name,gall_pic
tit_fir="博客"
url_fir="blog.asp"
tit1="TAG标签中心"
url1="tags.asp"
select case action
case "search"
iframe=true
nummer=dim_num(0)
nums=nummer
page=1
keyword22=code_search(request.querystring("keyword"))
if keyword22="" then 
Response.Write vbCrLf & joekoe_cms.js_put("alert(""搜索关键字不能为空！"");history.back(1);", 1)
end if
index_url="tags"
tit="日志TAG搜索"
case "seapic"
urlimg=Request.ServerVariables("HTTP_REFERER")
col_num=4
num_col=3
pnum=100\col_num
w_num=10
tr_ture=true
nummer=num_col*col_num
nums=nummer
sql_add=""
keyword=code_search(request.querystring("keyword"))
if keyword="" then 
Response.Write vbCrLf & joekoe_cms.js_put("alert(""搜索关键字不能为空！"");history.back(1);", 1)
end if
index_url="tags"
url1="tags.asp?action=photo"
  vvt=1
  vvs=0
  n_sort="gall"
  types="paste"
  tit="图片TAG搜索"

case "photo"
tit="图片TAGS"
case else
url1="tags.asp?action=photo"
 tit="日志TAGS"
end select

call web_head(0,0,0,0,0)
'----------------------------左边 开始----------------------------
'---------------------------左边1 开始----------------------------
call hscms_blog_login("用户登陆",user_login())
'---------------------------左边1 结束----------------------------
call web_center(0)
'---------------------------中间1 开始----------------------------
call hsblog_top()
'---------------------------中间1 结束----------------------------
response.write web_right
response.write web_left(0)
'----------------------------左边2 开始----------------------------
call left_tags()
'----------------------------左边2 结束----------------------------
call web_center(0)
'----------------------------中间2 开始----------------------------
select case action
case "search"
  call tags_search()
case "seapic"
  call tags_seapic()
case "photo"
   call tags_photo()
case else
 call tags_article()
end select
response.write ukong
'----------------------------中间2 结束----------------------------
call web_end(0,0)

sub left_user_login()
%>
<TABLE  cellSpacing=1 cellPadding=4 class=table>
<tr><td class=td>用户登陆</td></tr>
<tr class=tr><td align=center><%=user_login()%></td> </tr>
 </table>
  <%
end sub
sub left_tags()
%>
<TABLE cellSpacing=1 cellPadding=4 class=table>
<tr><td class=td>热门TAGS</td></tr>
<tr class=tr><td>
<TABLE cellSpacing=1 cellPadding=8 width=100%>
<tr><td align=center><a href='tags.asp?action=article'>热门日志TAGS</a></td> </tr> 
<tr><td align=center><a href='tags.asp?action=photo'>热门图片TAGS</a></td> </tr> 
  </table>
</td> </tr> 
  </table>
  <%
 end sub

sub tags_article()
%>
<TABLE class=table cellSpacing=1 cellPadding=4><TBODY>
<tr><td class=td>热门日志TAGS</td></tr>
<tr class=tr><td>
<table  cellSpacing=1 cellPadding=4>
	<%
   sql="select Tags,sum(Num)as Num2,Max(Num)as Max2 from blog_tags where type='article' group by Tags having sum(Num)>0"
   set rs = joekoe_cms.exec(sql,1)
   if not rs.Eof then
   intJ=RS("max2")
   intH = intJ\(cc_tag_large-cc_tag_small)
   '	Response.Write("<tr valign='top'><td class='tags'>")
     while not rs.Eof
     Select Case intH
				Case 0,1
					intK = CInt(RS("Num2") + cc_tag_small)
				Case Else
					intK = CInt(RS("Num2")*cc_tag_large/intH)
			End Select
			If intK < cc_tag_small Then
				intK = cc_tag_small
			End If
			If intK > cc_tag_large Then
				intK = cc_tag_large
			End If
      	strTag= "<span style=""font-size:"&intK&"px;margin:10px;;line-height:160%;""><a href=""?action=search&keyword=" &  Server.URLEncode(RS("tags")) & """ title=""搜索相关日志"">" & Server.HTMLEncode(RS("tags")) & "</a></span>"&vbCrLf      
      Response.Write strTag      
      rs.MoveNext
     wend
    'Response.Write("</td></tr>")
   end if
   rs.close
   %>	
</table>
</td></tr></table>
<%

end sub

sub tags_photo()
%>
<TABLE class=table cellSpacing=1 cellPadding=4><TBODY>
<tr><td class=td>热门图片TAGS</td></tr>
<tr class=tr><td>
<table  cellSpacing=1 cellPadding=4>
	<%
   sql="select Tags,sum(Num)as Num2,Max(Num)as Max2 from blog_tags where type='photo' group by Tags having sum(Num)>0"
 set rs = joekoe_cms.exec(sql,1)
   if not rs.Eof then
   intJ=RS("max2")
   intH = intJ\(cc_tag_large-cc_tag_small)
   '	Response.Write("<tr valign='top'><td class='tags'>")
     while not rs.Eof
     Select Case intH
				Case 0,1
					intK = CInt(RS("Num2") + cc_tag_small)
				Case Else
					intK = CInt(RS("Num2")*cc_tag_large/intH)
			End Select
			If intK < cc_tag_small Then
				intK = cc_tag_small
			End If
			If intK > cc_tag_large Then
				intK = cc_tag_large
			End If
      	strTag= "<span style=""font-size:"&intK&"px;margin:10px;;line-height:160%;""><a href=""?action=seapic&keyword=" &  Server.URLEncode(RS("tags")) & """ title=""搜索相关图片"">" & Server.HTMLEncode(RS("tags")) & "</a></span>"&vbCrLf      
      Response.Write strTag      
      rs.MoveNext
     wend
    'Response.Write("</td></tr>")
   end if
   rs.close
   %>	
</table>
</td></tr></table>
<%

end sub

sub tags_search()

 sea_type="tags"
  sea_term=trim(request.querystring("sea_term"))
 if sea_term<>"only" then sea_term="all"
  sql_tmp=sql_key(keyword22,sea_type,2,sea_term)
  if sql_tmp<>"" then
    sqladd=sql_tmp
     sql_tmp=""
     end if

%>
<TABLE class=table cellSpacing=1 cellPadding=4><TBODY>
<tr >
<td class=td >搜索Tags:&nbsp;&nbsp;<strong><%=keyword22%></strong></td></tr>
<form name="frmTagsSearch" method="get" action="tags.asp" >
<tr class=tr><td>
<strong>Tag搜索：</strong><input type=hidden name=action value=search><input name="keyword" type="text" style="font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 12px" value="在这里输入Tag关键字" size="40" onClick="if (this.value==this.defaultValue) this.value=''">&nbsp;&nbsp;<input type=submit value='TAG搜索' >

	</td></tr>
				</form>
<tr class=tr><td>
<table class=table cellSpacing=1 cellPadding=4 >
<%
sql="select count(id) from  blog_data where type='article' and hidden=1  and "&sqladd
set rs=joekoe_cms.exec(sql,1)
rssum=rs(0)
rs.close
call format_pagecute()
sql="select top "&nummer*viewpage&" id,username,topic,word,tags,tim from blog_data where type='article' and hidden=1  and "&sqladd&"  order by id desc"
call joekoe_cms.exec(sql,-1)
rs.open sql,conn,1,1
if int(viewpage)>1 then rs.move (viewpage-1)*nummer
if int(viewpage*nummer)>int(rssum) then nums=nummer-(viewpage*nummer-rssum)
for i=1 to nums
  response.write vbcrlf&user_action_type(rs("id"),rs("username"),rs("topic"),rs("word"),rs("tags"),rs("tim"))
  rs.movenext
next
rs.close
pageurl="?action=search&keyword=" &  Server.URLEncode(keyword22) & "&"
%>
</table></td></tr>
<tr><td class=trb >
&nbsp;共有&nbsp;<font class=red><%response.write rssum%></font>&nbsp;篇日志
&nbsp;页次：<font class=red><%response.write viewpage%></font>/<font class=red><%response.write thepages%></font>&nbsp;
&nbsp;分页：<%response.write jk_pagecute(nummer,thepages,viewpage,pageurl,5,"#ff0000")%>
</td></tr>
</table>

<%
end sub

function user_action_type(u_id,u_username,u_topic,u_word,u_keyes,u_tim)
  dim temp1,tag_keyss,key_url
   key_url="blog_view.asp?user="&u_username&"&id="&u_id
  temp1="<tr class=tr><td><span style=""font-size: 14px""><a href="&key_url&" target=""_blank""><strong>"&u_topic&"</strong></a></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>作者：</strong>&nbsp;"&format_user_name(u_username,0,"")&"</a>&nbsp;&nbsp;&nbsp;&nbsp;"&u_tim&" "& _
  	  	  	vbcrlf&"<br>"&left(u_word,150)&"<br><br></td></tr>"       
  user_action_type=temp1
end function

sub tags_seapic()

 sea_type="tags"
  sea_term=trim(request.querystring("sea_term"))
 if sea_term<>"only" then sea_term="all"
  sql_tmp=sql_key(keyword,sea_type,2,sea_term)
  if sql_tmp<>"" then
    sqladd=sql_tmp
     sql_tmp=""
    pageurl="?action=seapic&keyword="&server.urlencode(keyword)&"&"
     end if

%>
<table cellspacing=1 cellpadding=4 class=table>
<tr class=tr><td class=td>图片Tag搜索：<%=keyword%></td></tr>
<form name="frmTagsSearch" method="get" action="tags.asp" >
<tr class=tr><td>
<strong>图片Tag搜索：</strong><input type=hidden name=action value=seapic><input name="keyword" type="text" style="font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 12px" value="<%response.write keyword%>" size="40" >&nbsp;&nbsp;<input type=submit value='图片TAG搜索' >
			
	</td>	
	</tr></form>
<tr class=tr><td>
<table cellspacing=1 cellpadding=4 width=100%>

<%
sql="select count(id) from blog_data where type='photo' and hidden=1   and "&sqladd
set rs=joekoe_cms.exec(sql,1)
rssum=rs(0)
rs.close

call format_pagecute()
sql="select top "&nummer*viewpage&" id,topic,pic,username,count from blog_data where type='photo' and  hidden=1  and "&sqladd&" order by id desc"
call joekoe_cms.exec("",-1)
rs.open sql,conn,1,1
if int(viewpage)>1 then rs.move (viewpage-1)*nummer
if int(viewpage*nummer)>int(rssum) then nums=nummer-(viewpage*nummer-rssum)
for i=1 to nums
  nid=rs("id")
  nname=rs("topic")
  gall_pic=rs("pic")
  if (i-1) mod col_num=0 then
%>
<tr><td>
  <table border=0 cellspacing=0 cellpadding=0 width='100%'>
  <tr align=center>
<%
    tr_ture=false
  end if
%>
  <td width='<%response.write pnum%>%'>
    <table border=0 cellspacing=0 cellpadding=2>
    <tr><td align=center><%response.write pic_fk(gall_pic,1,"photo_view.asp?user="&rs("username")&"&id="&nid)%></td></tr>
    <tr><td align=center><b><a href='photo_view.asp?user=<%=rs("username")%>&id=<%response.write nid%>' alt='<%response.write joekoe_cms.code_html(nname,1,0)%>'><%response.write joekoe_cms.code_html(nname,1,w_num)%></a></b></td></tr>
<tr><td align=center>
<%if vvt>0 then%>
<font class=red><%response.write rs("username")%></font>
    人气：<font class=red><%response.write rs("count")%></font></td></tr>
<%
end if
%>
    </table>
  </td>
<%
  if i mod col_num=0 then
    tr_ture=true
%>
  </tr>
  </table>
</td></tr>
<%
  end if
  rs.movenext
next
rs.close
if not tr_ture then
%>
  </tr>
  </table>
</td></tr>
<%
end if
%>
</table>
</td></tr>
<tr class=trb><td height=30>
共有 <font class=red><%response.write rssum%></font> 张图片，
页次：<font class=red><%response.write viewpage%></font>/<font class=red><%response.write thepages%></font>&nbsp;
&nbsp;分页：<%response.write jk_pagecute(nummer,thepages,viewpage,pageurl,5,"#ff0000")%>
</td></tr>
</table>
<%
end sub
'****************************************************
' HSCMS 1.2      Power by 2332.cn
' Email: 116116089@qq.com
' Web: http://www.2332.cn
' Copyright (C) 2004 2332.com All Rights Reserved.
'****************************************************
%>