<!-- #include file="include/config.asp" -->
<!-- #include file="../blog/include/skins.asp" -->
<!-- #include file="../include/jk_review.asp" -->
<!-- #include file="../include/jk_val_code.asp" -->
<!-- #include file="../include/jk_page_cute.asp" -->
<!-- #include file="../include/jk_pagecute.asp" -->
<!-- #include file="../include/jk_frm.asp" -->
<!-- #include file="../include/jk_upload.asp" -->
<!--#include file = "../common/HtmlEdit/Include/DeCode.asp"-->
<!-- #include file="../include/jk_put.asp" -->
<!-- #include file="../include/jk_code.asp" -->
<% 
'****************************************************
' HSCMS 1.2      Power by eebaa.com
' Email: yz_xiaojun@163.com
' Web: http://www.eebaa.com
' Copyright (C) 2004 eebaa.com All Rights Reserved.
'****************************************************
dim nummer,nums,rssum,page,viewpage,thepages,pageurl
nummer=12
nums=nummer

index_url="blog"
Dim b_user,b_id,b_name,b_content,b_open,b_hits,b_skin,b_password
select case action
case "write1"
  tit="签写日志"
case "edit1"
  tit="编缉日志"
case "write2"
  tit="添加照片"
case "edit2"
  tit="编缉照片"
case "sort"
  tit="编缉分类"
case "adn1"
  tit="管理日志"
case "adn2"
  tit="管理相册"
case "handle"
  tit="管理"
case "adn"
  tit="信息修改" 
case "manage"
  tit="博客管理"
case "del_tags"
  tit="删除TAGS"
case "article_tags"
  tit="日志TAGS"
case "photo_tags"
  tit="图片TAGS"
case "noblog"
  tit="没有注册"
case else
  tit="管理首页"
end select
call web_head(2,0,0,0,0)
if action<>"noblog" then call blog_first()

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

call user_left(4)
'----------------------------中间 开始----------------------------
call web_center(0)
call user_top()
response.write joekoe_cms.js_put("../style/magic.js",0)
select case action
case "write1"
  call article_write()
case "edit1"
  call article_edit()
case "write2"
  call photo_write()
case "edit2"
  call photo_edit()
case "del_tags"
  call del_tags()
case "photo_tags"
  call tags_photo()
case "article_tags"
  call tags_article()
case "adn"
  call blogedit()
case "manage"
  call blog_manage
case "noblog"
  call noblog()
case "adn1"
  call adn1()
case "adn2"
  call adn2()
case "handle"
  call chk_handle()
case else
  call index_blog()
end select


'----------------------------中间 结束----------------------------
Call Web_End(0,0)
%>
<%
Sub index_blog()
%>
<table cellspacing=1 cellpadding=4 class=table align='center'>
<tr><td class=td>&nbsp;登陆信息→欢迎进入博客管理</td></tr>
<tr class=tr><td  height=60>
欢迎进入您的博客管理<br>
使用各项功能前请仔细阅读相关页面的说明，最后操作完成后记得退出管理，祝您使用愉快。 
</td></tr>
<tr class=tr><td  height=60>
使用小帖士 <br>
请随时关注您的个人博客，检查其中网友发表内容是否合法  <br>
文章、相册均可进行预设分类操作，添加信息时将相关的信息归入对应的分类中  <br>
预设部分常用的关键字及其链接，在显示的文章中碰到对应的关键字会自动为其添加超级链接  <br>
当你不想不想让别人访问你的博客时你可以关闭它 <br>
</td></tr>
<tr class=tr><td  height=60>
系统说明 <br>
请注意文明、坦诚、平等交流，对事不对人，尊重别人看法，哪怕有不全面的地方 <br>
</td></tr>
</table>
<%
End Sub
Sub user_top()
%>

<table width="100%"  border="0" cellspacing="1" cellpadding="4" class=table>
<script language="javascript" type="text/javascript" src="../blog/images/blog.js"></script>
  <tr>
  <td colspan="7" class=td>&nbsp;管理菜单</td>
  </tr><tr class=tr><td>
  <table width=400  border="0" cellspacing="1" cellpadding="4" >
  <tr>
    <td><a href=?action=write1><img src="../blog/images/user/ico_5.gif" border=0></img></a></td>
    <td><a href=?action=write2><img src="../blog/images/user/ico_7.gif" border=0></img></a></td>
    <td><a href=?action=manage><img src="../blog/images/user/ico_4.gif" border=0></img></a></td>
    <td><img src="../blog/images/user/ico_3.gif" border=0></img></td>
    <td><img src="../blog/images/user/ico_2.gif" border=0></img></td>
    <td><img src="../blog/images/user/ico_1.gif" border=0></img></td>
    <td><a href='../'><img src="../blog/images/user/ico_6.gif" border=0></img></a></td>
	  </tr>
</table>
</td>
  </tr>
</table>
<%
response.write ukong
 end sub
 
 Sub blog_manage()
%>
<table cellspacing=1 cellpadding=4 class=table align='center'>
<tr><td class=td>&nbsp;博客管理</td></tr>
<tr class=tr><td  height=60>
&nbsp;&nbsp;<a href=?action=adn>博客设置</a>
</td></tr>
<tr class=tr><td  height=60>
&nbsp;&nbsp;<a href=?action=adn1>日志管理</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=?action=write1>添加日志</a>

</td></tr>
<tr class=tr><td  height=60>
&nbsp;&nbsp;<a href=?action=adn2>相册管理</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=?action=write2>添加相片</a>
</td></tr>
<tr class=tr><td  height=60>
&nbsp;&nbsp;<a href="?action=article_tags">日志Tags管理</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="?action=photo_tags">图片Tags管理</a>
</td></tr>
</table>
<%
End Sub

sub article_write()

  dim found_err,druser,c_id,drauthor,drtopic,dricon,drword,drhidden,drweather,drtim,drtags,drcod
  if joekoe_cms.chk() then
    druser=login_id
    drauthor=trim(request.form("author"))
	c_id=trim(request.form("c_id"))
	drtags=trim(request.form("wrtags"))
    drtags=key_tags2(drtags)
    drweather=trim(request.form("weather"))
    dricon=trim(request.form("icon"))
    drtopic=trim(request.form("wrtopic"))
    drtopic=joekoe_cms.code_form(drtopic)
    drword=request.form("wrword")
    drhidden=trim(request.form("wrhidden"))
    dyear=trim(request.form("a_year"))
	dmonth=trim(request.form("a_month"))
	dday=trim(request.form("a_day"))
    drtim=trim(request("a_year"))&"-"&trim(request("a_month"))&"-"&trim(request("a_day"))
	drcod=cod_type()

'-------保存日志--------------------------------------
    found_err=""
    if drtopic="" or isnull(drtopic) then
      found_err=found_err & "+日志的 <font class=red>主题</font> 是必需要的！请输入。<br>"
    end if
    if drword="" or isnull(drword) then
      found_err=found_err & "+日志的 <font class=red>内容</font> 是必需要的！请输入。<br>"
    end if
	 if not isdate(drtim) then
      found_err=found_err & "+日志的 <font class=red>日期</font> 格式有误！请重输。<br>"
    end if
    if found_err<>"" then
      response.write "<table class=table><tr><td class=td>&nbsp;错误信息</td></tr><tr><td align=center class=tr height=150>"&found_error(found_err,260)&"</td></tr></table>"
      exit sub
    end if
    sql="select * from blog_data where (id is null)"
    call joekoe_cms.exec("",-1)
    rs.open sql,conn,1,3
    rs.addnew
	rs("cid")=0
	rs("count")=0
	rs("type")="article"
    rs("username")=druser
	rs("tags")=drtags
    rs("weather")=drweather
    rs("icon")=dricon
    rs("topic")=drtopic
    rs("word")=drword
    rs("author")=drauthor
	rs("year")=dyear
	rs("month")=dmonth
	rs("day")=dday
	rs("tim")=drtim
    if drhidden="yes" then
      rs("hidden")=true
    else
      rs("hidden")=false
    end if
	rs("cod")=drcod
    rs.update
    rs.close
	call key_tags(drtags,"blog_tags","article")  
%>
<table cellpadding="4" cellspacing="1" class=table>
<tr><td class=td>&nbsp;→日志发表成功</td></tr>
<tr class=tr><td align=center height=150>
<font class=red>你的日志已经成功保存</font><br><br>
<a href='blog.asp?action=adn1'>返回我的博客</a><br><br>
（系统将在<font class=red><%=dim_num(21)%></font>秒钟后自动返回）
<meta http-equiv='refresh' content='<%=dim_num(21)%>; url=?action=adn1'>
</td></tr></table>
<%
    call val_chk_end(index_url)
    exit sub
end if
%>

 <table cellpadding="4" cellspacing="1" width=100%  class=table>
 <form name=write_frm action='blog.asp?action=write1' method=post onsubmit="frm_submitonce(this)">
<input type=hidden name=chk value='yes'>
<%response.write val_code_num(index_url,1)%>
 <tr >
<td height=23 class=td colspan=2>签写日志</td>
</tr>
<tr height=30 class=tr>
<td width=100>日志主题：</td>
<td><input type=text name=wrtopic value=''size=60 maxlength=50></td>
</tr>
<!--
<tr height=30 class=tr>
<td width=100 class=reply_t2>日志分类：</td>
<td><%call chk_class("blog_sort",0)%></td>
</tr>
-->
<tr height=30 class=tr>
<td>Tags： </td>
<td><input type=text name=wrtags value=''size=30 maxlength=100>
&nbsp;请用空格隔开，如：计算所 CMS  
	<span style="cursor:pointer;" onclick="if(document.getElementById('ulTag').style.display=='none'){document.getElementById('ulTag').style.display='block';}else{document.getElementById('ulTag').style.display='none'};"><font color=#0000FF></font><font color=#0000FF>&lt;已用Tags&gt;</font></span>
	
	<%Response.Write("<ul id=""ulTag"" style=""display:none;"">")

sqltag="select Tags from blog_tags where Username='"&login_username&"' and type='article' group by Tags "
   set rstag=joekoe_cms.exec(sqltag,1)
    
     while not rstag.Eof
     
      	Response.Write "<span style='cursor:pointer;' onclick='AddKey("""&RStag("tags")&""")' />"&RStag("tags")&"&nbsp;&nbsp;</span>" 
          rstag.MoveNext
     wend
     Response.Write "</ul>"
   rstag.close
   %>	</td>
</tr>
<tr height=30 class=tr>
<td>表情图标： </td>
<td><%response.write jk_icon(0)%></td>
</tr>
<tr height=25 class=tr>
<td>日志作者：</td>
<td><input type=text name=author value='<%response.write login_username%>' size=20 maxlength=20  >
&nbsp;&nbsp;是否公开：<input type=radio name=wrhidden value='yes' class=tr checked >公开<input type=radio name=wrhidden value='no' class=tr>私人
</td>
</tr>
<tr height=25 class=tr>
<td>书写日期：</td>            <td valign="middle"><select name="a_year" onChange="checkdate()">
                <% for i=2002 to 2050 %>
                <option value="<%= i %>" <% if i=year(now) then%>selected<% end if %>><%= i %></option>
                <% next %>
              </select>
              年 
              <select name="a_month" onChange="checkdate()">
                <% for i=1 to 12 %>
                <option value="<%= i %>" <% if i=month(now) then%>selected<% end if %>><%= i %></option>
                <% next %>
              </select>
              月 
              <select name="a_day" id="select2" onChange="checkdate()">
                <% for i=1 to 31 %>
                <option value="<%= i %>" <% if i=day(now) then%>selected<% end if %>><%= i %></option>
                <% next %>
              </select>
              日              </td>
</tr>
<tr height=30 class=tr>
<td>今日天气：</td>
<td>
<%
dim i
for i=1 to 5
response.write "<img src=../blog/images/image/"&i&".gif border=0><input type=radio name=weather value="&i&""
if i=3 then
response.write " checked"
end if 
response.write ">&nbsp;"
next
%>
</td>
</tr>
<tr class=tr>
<td><%call frm_ubb_type("")%></td><td>
<%call frm_ubb("write_frm","wrword","&nbsp;&nbsp;",0)
     ' call html_edit(1,"write_frm","wrword","class=tr") %>
	</td>
</tr>

<tr height=25 class=tr>
<td class=reply_t2>日志内容：</td><td>

<textarea   rows=12 name=wrword cols=65 maxlength=1000 title='按 Ctrl+Enter 可直接发送' onkeydown="javascript:frm_quicksubmit();"></textarea>

</td></tr>
<tr class=tr>
<td>魔法表情：</td>
<td oncontextmenu=self.event.returnValue=false>&nbsp;<%'response.write jk_em("write_frm","wrword")%></td>
</tr>
<tr class=tr>
<td>巧嘴娃娃：</td>
<td oncontextmenu=self.event.returnValue=false>&nbsp;<%'response.write jk_wawa("write_frm","wrword")%></td>
</tr>

<tr height=30 class=trb><td colspan=3 align=center ><input type=submit class=btn name=wsubmit value=' 确认提交 '>　　<input type=reset class=btn value=' 重新再来 ' onclick="return reset()"></td></tr>
</td><td width=1></td></tr>
</form></table>
<%

end sub

sub article_edit()
  
  dim found_err,drname,drtopic,dricon,drword,drhidden,drweather,drtim,addtime,drsampname,user,id,author,drtags,drcod
  id=trim(request.querystring("id"))
  if not(isnumeric(id)) then
    call format_redirect("./")
  end if 
  sql="select top 1 * from blog_data where type='article' and username='"&login_id&"' and id="&id
  call joekoe_cms.exec(sql,-1)
  rs.open sql,conn,1,3
  if rs.eof then
    rs.close
      response.write "<table class=table><tr><td align=center class=td >&nbsp;错误信息</td></tr><tr><td align=center class=tr height=150>日志不存在！</td></tr></table>"
    exit sub
  end if
  if joekoe_cms.chk() then
    author=trim(request.form("author"))
    drweather=trim(request.form("weather"))
    dricon=trim(request.form("icon"))
    drtopic=trim(request.form("wrtopic"))
    drtopic=joekoe_cms.code_form(drtopic)
    drword=request.form("wrword")
    drhidden=trim(request.form("wrhidden"))
    c_id=trim(request.form("c_id"))
    drtags=trim(request.form("wrtags"))
    drtags=key_tags2(drtags)
    drcod=cod_type()
	

    found_err=""
    if drtopic="" or isnull(drtopic) then
      found_err=found_err & "+日志的 <font class=red>主题</font> 是必需要的！请输入。<br>"
    end if
    if drword="" or isnull(drword) then
      found_err=found_err & "+日志的 <font class=red>内容</font> 是必需要的！请输入。<br>"
    end if
    if found_err<>"" then
      response.write "<table class=table><tr><td class=td>&nbsp;错误信息</td></tr><tr><td align=center class=tr height=300>"&found_error(found_err,260)&"</td></tr></table>"

      exit sub
    end if
    rs("weather")=drweather
    rs("icon")=dricon
    rs("topic")=drtopic
    rs("word")=drword
    rs("author")=author
	'rs("cid")=c_id
	rs("tags")=drtags
    if drhidden="yes" then
      rs("hidden")=true
    else
      rs("hidden")=false
    end if
	rs("cod")=drcod
    rs.update
    rs.close
	call key_tags(drtags,"blog_tags","article")  
%>
<table class=table>
<tr><td class=td>&nbsp;→日志编辑成功</td></tr>
<tr class=tr><td align=center height=150>
！！<font class=red>你的日志已经成功保存</font>！！！<br><br>
<a href='blog.asp?action=adn1'>返回我的日志本</a><br><br>
（系统将在<font class=red><%=dim_num(21)%></font>秒钟后自动返回）
<meta http-equiv='refresh' content='<%=dim_num(21)%>; url=?action=adn1'>
</td></tr></table>
<%
    call val_chk_end(index_url)
    exit sub
  end if
%>

 <table cellpadding="4" cellspacing="1"   class=table>
 
<form name=write_frm action='blog.asp?action=edit1&id=<%response.write rs("id")%>' method=post onsubmit="frm_submitonce(this)">
<input type=hidden name=chk value='yes'>
<%response.write val_code_num(index_url,1)%>
 <tr >
<td height=30 class=td   colspan=2>修改日志</td>
</tr>
<tr height=30 class=tr>
<td width=100  >日志主题：</td>
<td><input type=text name=wrtopic value="<%response.write rs("topic")%>" size=65 maxlength=50></td>
</tr>
<!--
<tr height=30 class=tr>
<td width=100 class=reply_t2>日志分类：</td>
<td><%call chk_class("blog_sort",rs("cid"))%></td>
</tr>
-->
<tr height=30 class=tr>
<td>Tags： </td>
<td><input type=text name=wrtags value='<%=rs("tags")%>'size=30 maxlength=100>&nbsp;请用空格隔开，如：计算所 CMS  
	<span style="cursor:pointer;" onclick="if(document.getElementById('ulTag').style.display=='none'){document.getElementById('ulTag').style.display='block';}else{document.getElementById('ulTag').style.display='none'};"><font color=#0000FF></font><font color=#0000FF>&lt;已用Tags&gt;</font></span>
	
	<%Response.Write("<ul id=""ulTag"" style=""display:none;"">")

sqltag="select Tags from blog_tags where Username='"&login_id&"' and type='article' group by Tags "
   set rstag=joekoe_cms.exec(sqltag,1)
    
     while not rstag.Eof
     
      	Response.Write "<span style='cursor:pointer;' onclick='AddKey("""&RStag("tags")&""")' />"&RStag("tags")&"&nbsp;&nbsp;</span>" 
          rstag.MoveNext
     wend
     Response.Write "</ul>"
   rstag.close
   %>	</td>
</tr>
<tr height=30 class=tr>
<td>表情图标： </td>
<td><%response.write jk_icon(rs("icon"))%></td>
</tr>
<tr height=25 class=tr>
<td class=reply_t2>日志作者：</td>
<td ><input type=text name=author value='<%response.write rs("author")%>' size=20 maxlength=20>
&nbsp;&nbsp;是否公开：<input type=radio name=wrhidden value='yes' class=tr <%if rs("hidden")=true then response.write "checked"%> >公开<input type=radio name=wrhidden value='no' class=tr <%if rs("hidden")=false then response.write "checked"%>>私人
</td>
</tr>
<tr height=25 class=tr>
<td >书写日期：</td><td><%response.write joekoe_cms.time_type(rs("tim"),5)%></td>
</tr>
<tr height=30 class=tr>
<td >今日天气：</td>
<td>
<img src=../blog/images/image/1.gif border=0><input type=radio name=weather value=1 <%if rs("weather")=1 then%>checked<%end if%>>&nbsp;
<img src=../blog/images/image/2.gif border=0><input type=radio name=weather value=2 <%if rs("weather")=2 then%>checked<%end if%>>&nbsp;
<img src=../blog/images/image/3.gif border=0><input type=radio name=weather value=3 <%if rs("weather")=3 then%>checked<%end if%>>&nbsp;
<img src=../blog/images/image/4.gif border=0><input type=radio name=weather value=4 <%if rs("weather")=4 then%>checked<%end if%>>&nbsp;
<img src=../blog/images/image/5.gif border=0><input type=radio name=weather value=5 <%if rs("weather")=5 then%>checked<%end if%>>&nbsp;
</td>
</tr>

<tr class=tr>
<td><%call frm_ubb_type("")%></td><td>
<%call frm_ubb("write_frm","wrword","&nbsp;&nbsp;",0)
     ' call html_edit(1,"write_frm","wrword","class=tr") %>
	</td>
</tr>

<tr height=25 class=tr>
<td class=reply_t2>日志内容：</td><td>

<textarea   rows=12 name=wrword cols=65 maxlength=1000 title='按 Ctrl+Enter 可直接发送' onkeydown="javascript:frm_quicksubmit();"><%=server.HTMLEncode(rs("word"))%></textarea>

</td></tr>
<tr class=tr>
<td>魔法表情：</td>
<td oncontextmenu=self.event.returnValue=false>&nbsp;<%response.write jk_em("write_frm","wrword")%></td>
</tr>
<tr class=tr>
<td>巧嘴娃娃：</td>
<td oncontextmenu=self.event.returnValue=false>&nbsp;<%response.write jk_wawa("write_frm","wrword")%></td>
</tr>

<tr height=30 class=trb><td colspan=3 align=center ><input type=submit class=btn name=wsubmit value=' 确认提交 '>　　<input type=reset class=btn value=' 重新再来 ' onclick="return reset()"></td></tr>
</td><td width=1 ></td></tr>
</form> </table>
<%
end sub

sub photo_write()

ispic=joekoe_cms.rand_file("photo")
  dim found_err,drpic,drname,drtopic,drword,drhidden,drtim,addtime,drsampname,author,drtags
  if joekoe_cms.chk() then
    drname=login_id
	drtags=trim(request.form("wrtags"))
    drtags=key_tags2(drtags)
    author=trim(request.form("author"))
    drsampname=trim(request.form("sampname"))
    drtopic=trim(request.form("wrtopic"))
    drtopic=joekoe_cms.code_form(drtopic)
	drpic=request.form("photo_pic")
    drword=request.form("phword")
    drhidden=trim(request.form("wrhidden"))
    drtim=now
'-------保存--------------------------------------
            found_err=""
            if drtopic="" or isnull(drtopic) then
              found_err=found_err & "+照片的 <font class=red>主题</font> 是必需要的！<br>"
            end if
			if drpic="" or isnull(drpic) then
              found_err=found_err & "+照片的 <font class=red>地址</font> 是必需要的！<br>"
            end if
            if drword="" or isnull(drword) then
              found_err=found_err & "+照片的 <font class=red>内容</font> 是必需要的！<br>"
            end if
            if found_err<>"" then
              response.write "<table class=table><tr><td class=td>&nbsp;错误信息</td></tr><tr><td align=center class=tr height=150>"&found_error(found_err,260)&"</td></tr></table>"
              exit sub
            end if
            sql="select * from blog_data where (id is null)"
            call joekoe_cms.exec("",-1)
            rs.open sql,conn,1,3
            rs.addnew
		    rs("cid")=0
	        rs("count")=0
			rs("type")="photo"
			rs("tags")=drtags
            rs("username")=drname
			rs("author")=author
            rs("topic")=drtopic
			rs("pic")=drpic
            rs("word")=drword
            rs("tim")=drtim
            if drhidden="yes" then
               rs("hidden")=1
            else
               rs("hidden")=0
            end if
            rs.update
            rs.close
            call upload_note("photo",first_id("blog_data","id"))
			call key_tags(drtags,"blog_tags","photo")  
            
%>
<table cellpadding="4" cellspacing="1" class=table>
<tr><td class=td>&nbsp;→照片发表成功</td></tr>
<tr class=tr><td align=center height=150>
添加照片已经成功保存<br><br>
<a href='blog.asp?action=adn2'>返回我的网络相册</a><br><br>
（系统将在<font class=red><%=dim_num(21)%></font>秒钟后自动返回）
<meta http-equiv='refresh' content='<%=dim_num(21)%>; url=?action=adn2'>
</td></tr>
</table>
<%
            call val_chk_end(index_url)
            exit sub
'-------保存--------------------------------------
end if
%>
 <table cellpadding="4" cellspacing="1" width=100%  class=table>
<tr><td class=td height=23 colspan="2"><%response.write tit2%></td></tr>
<form name=write_photo   action='blog.asp?action=write2' method=post>
<input type=hidden name=chk value='yes'>
<input type=hidden name=upid value=''>
<%response.write val_code_num(index_url,1)%>
<tr height=25 class=tr>
<td width=100>图片主题：</td>
<td><input type=text name=wrtopic size=50 maxlength=40></td>
</tr>
<tr height=25 class=tr>
<td>发 布 人：</td>
<td><input type=text name=author value='<%response.write login_username%>' size=20 maxlength=20 readonly></td>
</tr>
<tr height=30 class=tr>
<td>Tags： </td>
<td><input type=text name=wrtags value=''size=30 maxlength=100>&nbsp;请用空格隔开，如：计算所 CMS 
	<span style="cursor:pointer;" onclick="if(document.getElementById('ulTag').style.display=='none'){document.getElementById('ulTag').style.display='block';}else{document.getElementById('ulTag').style.display='none'};"><font color=#0000FF></font><font color=#0000FF>&lt;已用Tags&gt;</font></span>
	
	<%Response.Write("<ul id=""ulTag"" style=""display:none;"">")

sqltag="select Tags from blog_tags where Username='"&login_username&"' and type='photo' group by Tags "
   set rstag=joekoe_cms.exec(sqltag,1)
    
     while not rstag.Eof
     
      	Response.Write "<span style='cursor:pointer;' onclick='AddKey("""&RStag("tags")&""")' />"&RStag("tags")&"&nbsp;&nbsp;</span>" 
          rstag.MoveNext
     wend
     Response.Write "</ul>"
   rstag.close
   %>	 </td>
</tr>
<tr height=25 class=tr>
<td>发布日期：</td><td><input type=text name=tim value='' size=30 maxlength=20 >&nbsp;<input type=button class=btn name=st_btn value="选择" onclick="javascript:select_time(tim);return false;"></td>
</tr>
<tr height=30 class=tr>
<td>是否公开：</td>
<td><input type=radio name=wrhidden value='yes' checked>公开<input type=radio name=wrhidden value='no' >私人 选择公开后，此图片所有人可见，否则不可见。</td>
</tr>
<tr class=tr height=25>
<td>图片地址：</td>
<td><input type=text name=photo_pic value='' size=50 maxlength=100>&nbsp;&nbsp;<a href='../common/upload.asp?uppath=photo&upname=<%response.write ispic%>&uptext=photo_pic' target=upload_frame>上传图片</a></td></tr>
<tr class=tr height=25>
<td>上传文件：</td>
<td><iframe frameborder=0 name=upload_frame width='98%' height=30 scrolling=no src='../common/upload.asp?uppath=photo&upname=<%response.write ispic%>&uptext=photo_pic'></iframe></td>
</tr>
<tr class=tr>
<td><%call frm_ubb_type("")%></td>
<td><%call frm_ubb("write_photo","phword","",0)%></td>
</tr>
<tr height=100 class=tr>
<td valign=top><br>内容简介：<br>500字以内<br></td>
<td><textarea rows=10 name=phword cols=65 maxlength=500 title='按 Ctrl+Enter 可直接发送' onkeydown="javascript:frm_quicksubmit();"></textarea></td>
</tr>
<tr height=30 class=trb><td colspan=3 align=center><input class=btn type=submit name=wsubmit value=' 确认提交 '>　　<input  class=btn  type=reset value=' 重新再来 ' onclick="return reset()"></td></tr>
</form>
</table>
<%
end sub

sub photo_edit()

ispic=joekoe_cms.rand_file("photo")
  dim found_err,drname,drtopic,drword,drhidden,drtim,addtime,drsampname,author,id,drtags
   id=trim(request.querystring("id"))
  if not(isnumeric(id)) then
    call format_redirect("./")
  end if 
  sql="select top 1 * from blog_data where type='photo' and username='"&login_id&"' and id="&id
  call joekoe_cms.exec(sql,-1)
  rs.open sql,conn,1,3
  if rs.eof then
    rs.close
      response.write "<table class=table><tr><td align=center class=td >&nbsp;错误信息</td></tr><tr><td align=center class=tr height=150>照片不存在！</td></tr></table>"
    exit sub
  end if
  if joekoe_cms.chk() then
  	drtags=trim(request.form("wrtags"))
    drtags=key_tags2(drtags)
    author=trim(request.form("author"))
    drtopic=trim(request.form("wrtopic"))
    drtopic=joekoe_cms.code_form(drtopic)
    drword=request.form("phword")
	drpic=request.form("photo_pic")
    drhidden=trim(request.form("wrhidden"))

    found_err=""
    if drtopic="" or isnull(drtopic) then
      found_err=found_err & "+照片的 <font class=red>主题</font> 是必需要的！请输入。<br>"
    end if
	if drpic="" or isnull(drpic) then
      found_err=found_err & "+照片的 <font class=red>地址</font> 是必需要的！<br>"
    end if
    if drword="" or isnull(drword) then
      found_err=found_err & "+照片的 <font class=red>内容</font> 是必需要的！请输入。<br>"
    end if
    if found_err<>"" then
      response.write "<table class=table><tr><td class=td>&nbsp;错误信息</td></tr><tr><td align=center class=tr height=150>"&found_error(found_err,260)&"</td></tr></table>"
      exit sub
    end if
    rs("topic")=drtopic
	rs("tags")=drtags
    rs("word")=drword
    rs("author")=author
	rs("pic")=drpic
    if drhidden="yes" then
      rs("hidden")=1
    else
      rs("hidden")=0
    end if
    rs.update
    rs.close
    call upload_note("photo",first_id("blog_data","id"))
	call key_tags(drtags,"blog_tags","photo")  

%>
<table class=table>
<tr><td class=td>&nbsp;→编辑照片成功</td></tr>
<tr class=tr><td align=center height=150>
<font class=red>编辑照片已经成功保存</font> <br><br>
<a href='blog.asp?action=adn2'>返回我的网络相册</a><br><br>
（系统将在<font class=red><%=dim_num(21)%></font>秒钟后自动返回）
<meta http-equiv='refresh' content='<%=dim_num(21)%>; url=?action=adn2'>
</td></tr></table>
<%
  call val_chk_end(index_url)
  exit sub
'-------保存--------------------------------------
  end if
%>
 <table cellpadding="4" cellspacing="1" width=100%  class=table>
<tr><td class=td height=25 colspan="2"><%response.write tit2%></td></tr>
<form name=write_photo action='?action=edit2&id=<%response.write rs("id")%>' method=post>
<input type=hidden name=chk value='yes'>
<input type=hidden name=upid value=''>
<%response.write val_code_num(index_url,1)%>
<tr height=30 class=tr>
<td width=100>照片主题：</td>
<td><input type=text name=wrtopic value="<%response.write joekoe_cms.code_html(rs("topic"),1,0)%>" size=50 maxlength=50></td>
</tr>
<tr height=25 class=tr> 
<td>发 布 人：</td>
<td><input type=text name=author value='<%response.write rs("author")%>' size=20 maxlength=20 readonly></td>
</tr>
<tr height=30 class=tr>
<td>Tags： </td>
<td><input type=text name=wrtags value='<%=rs("tags")%>'size=30 maxlength=100>&nbsp;请用空格隔开，如：计算所 CMS 
	<span style="cursor:pointer;" onclick="if(document.getElementById('ulTag').style.display=='none'){document.getElementById('ulTag').style.display='block';}else{document.getElementById('ulTag').style.display='none'};"><font color=#0000FF></font><font color=#0000FF>&lt;已用Tags&gt;</font></span>
	
	<%Response.Write("<ul id=""ulTag"" style=""display:none;"">")

sqltag="select Tags from blog_tags where Username='"&login_id&"' and type='photo' group by Tags "
   set rstag=joekoe_cms.exec(sqltag,1)
    
     while not rstag.Eof
     
      	Response.Write "<span style='cursor:pointer;' onclick='AddKey("""&RStag("tags")&""")' />"&RStag("tags")&"&nbsp;&nbsp;</span>" 
          rstag.MoveNext
     wend
     Response.Write "</ul>"
   rstag.close
   %>	 </td>
</tr>
<tr height=25 class=tr>
<td>发布日期：</td><td><%response.write joekoe_cms.time_type(rs("tim"),5)%></td>
</tr>
<tr height=30 class=tr>
<td>是否公开：</td>
<td><input type=radio name=wrhidden <%if rs("hidden")=true then%>checked<%end if%> value='yes'>公开<input type=radio name=wrhidden value='no' <%if rs("hidden")=false then%>checked<%end if%>>私人 选择公开后，此照片所有人可见，否则不可见。</td>
</tr>
<tr class=tr height=25>
<td>图片地址：</td>
<td><input type=text name=photo_pic value='<%=rs("pic")%>' size=50 maxlength=100>&nbsp;&nbsp;<a href='../common/upload.asp?uppath=photo&upname=<%response.write ispic%>&uptext=photo_pic' target=upload_frame>上传图片</a></td></tr>
<tr class=tr height=25>
<td>上传文件：</td>
<td><iframe frameborder=0 name=upload_frame width='98%' height=30 scrolling=no src='../common/upload.asp?uppath=photo&upname=<%response.write ispic%>&uptext=photo_pic'></iframe></td>
</tr>
<tr class=tr>
<td><%call frm_ubb_type("class=tr")%></td>
<td><%call frm_ubb("write_photo","phword","",0)%></td>
</tr>
<tr height=100 class=tr>
<td valign=top><br>内容简介：<br>500字以内<br></td>
<td><textarea rows=11 name=phword cols=65 maxlength=500 title='按 Ctrl+Enter 可直接发送' onkeydown="javascript:frm_quicksubmit();"><%response.write joekoe_cms.code_word(rs("word"))%></textarea></td>
</tr>
<tr height=30 class=trb><td colspan=3 align=center><input  class=btn  type=submit name=wsubmit value=' 确认提交 '>　　<input  class=btn  type=reset value=' 重新再来 ' onclick="return reset()"></td></tr>
</form>
<%
end sub


sub blogedit()
  dim found_err,drname,drsex,drqq,dremail,drurl,drwhe,drtopic,dricon,drface,drword,drremark,drhidden,valcode,datagl 
  if joekoe_cms.chk() then
    drname=trim(request.form("wrname"))
	druser=trim(request.form("wruser"))
    drword=request.form("wrword")
    drhidden=trim(request.form("wrhidden"))
	drskin=trim(request.form("skin"))
    found_err=""
    if drname="" or isnull(drname) then
      found_err=found_err & "+请输入您的 <font class=red>博客名</font>（长度不能大于20）<br>"
    end if
    if drword="" or isnull(drword) then
      found_err=found_err & "+博客的 <font class=red>简介内容</font> 是必需要的！请输入。<br>"
    end if
    if val_chk(index_url)=false then
      found_err=found_err&"+您输入的 <font class=red>验 证 码</font> 为空或有错误，请勿非法提交！<br>"
    end if
    if found_err<>"" then
      response.write "<table class=table><tr><td class=td>&nbsp;错误信息</td></tr><tr class=tr><td align=center height=150 colspan=3>"&found_error(found_err,260)&"</td></tr></table>"
      exit sub
    end if
    
	Dim SQL3,rs3,skinmain,skinshowlog
	sql3="select * from oblog_userskin where id="&drskin&" "
    set rs3=joekoe_cms.exec(sql3,1)
    if not rs3.eof then 
	    skinmain=rs3("skinmain")
		skinshowlog=rs3("skinshowlog")
		rs3.close
		set rs3=nothing
	Else
	    found_err=found_err&"+您选择的 模板 为空或有错误，请勿非法提交！<br>"
	    response.write "<table class=table><tr><td class=td>&nbsp;错误信息</td></tr><tr class=tr><td align=center height=150 colspan=3>"&found_error(found_err,260)&"</td></tr></table>"
       	rs3.close
		set rs3=nothing
	    exit sub
	End if
	
    sql="select * from blog where username='"&login_id&"'"
    call joekoe_cms.exec("",-1)
    rs.open sql,conn,1,3
	if not rs.eof then 
		rs("blogname")=drname
		rs("content")=drword
		rs("skin")=drskin
		if drhidden="yes" then
		  rs("isopen")=true
		else
		  rs("isopen")=false
		end if
		rs("user_skin_main")=skinmain
		rs("user_skin_showlog")=skinshowlog
		rs.update
    else
		found_err=found_err&"+你的博客信息 为空或有错误，请勿非法提交！<br>"
	    response.write "<table class=table><tr><td class=td>&nbsp;错误信息</td></tr><tr class=tr><td align=center height=150 colspan=3>"&found_error(found_err,260)&"</td></tr></table>"
	    Exit sub
	End if
    rs.close
%>
<table cellspacing=1 cellpadding=4 class=table align='center'>
<tr><td class=td>&nbsp;成功修改信息</td></tr>
<tr class=tr><td align=center height=150 colspan=2>
<font class=red>恭喜！成功修改了您的博客了!</font><br><br>
<a href='blog.asp?action=my'>返回我的日志本</a><br><br>
（系统将在<font class=red><%=dim_num(21)%></font>秒钟后自动返回）
<meta http-equiv='refresh' content='<%=dim_num(21)%>; url=blog.asp?action=manage'>
</td></tr></table>
<%
    call val_chk_end(index_url)
    exit sub
  end if
  
sql="select * from blog where id="&b_id
set rs=joekoe_cms.exec(sql,1)
%>
<table cellspacing=1 cellpadding=4 class=table align='center'>
<form name=write_frm action='blog.asp?action=adn' method=post >
<input type=hidden name=chk value='yes'>
<%response.write val_code_num(index_url,1)%>
<tr>
<td class=td colspan=2>博客信息修改</td></tr>
<tr class=trb><td align=center height=30 colspan=3><font class=red><b>注意：</b></font>以下星号（<%response.write redx%>）标出的项目必需填写</td></tr>
<tr class=tr>
<td width='18%' height=25>博客名字：</td>
<td width='*'><input type=text name=wrname value="<%=replace(rs("blogname"),"""","'")%>" size=27 maxlength=20><%response.write redx%></td>
</tr>
<tr class=tr>
<td width='18%' height=25>博客站长：</td>
<td width='*'><input type=text name=wruser value='<%=idtoname(rs("username"))%>' size=27 maxlength=20 readonly></td>
</tr>
<tr class=tr>
<td valign=top><br>博客简介：<br><br><%response.write web_frm_word%></td>
<td ><textarea rows=7 name=wrword cols=65 maxlength=1000 title='按 Ctrl+Enter 可直接发送' onkeydown="javascript:frm_quicksubmit();"><%=rs("content")%></textarea></td>
</tr>
<tr class=tr>
<td>博客开关：</td>
<td colspan=2><input class=tr type=radio name=wrhidden value='yes' <%if rs("isopen")=true then response.write "checked"%>  >正常<input class=tr type=radio name=wrhidden value='no' <%if rs("isopen")=false then response.write "checked"%> >隐藏<%response.write redx%>选择隐藏后，别人无法访问你的博客。</td>
</tr>
<tr class=tr>
<td>博客样式：</td>
<td colspan=2>
<%call user_skin_input(b_skin,"blog.asp")%></td></tr>
<tr height=40 class=trb><td colspan=3 align=center><input type=submit class=btn name=wsubmit value=' 确定修改 ' >　　<input type=reset class=btn value=' 重新再来 ' ></td></tr>
</form>
</table>
<%
rs.close()
end sub



sub chk_class(n_sort,cid)
  dim sql3,rs3
  response.write "<select name=c_id size=1>"
  sql3="select id,sort from "&n_sort&"  where username='"&login_username&"' order by orders"
  set rs3=joekoe_cms.exec(sql3,1)
  do while not rs3.eof
    n_id=int(rs3(0))
    response.write vbcrlf&"<option value='"&n_id&"' class=bg_2"
    if cid=n_id then response.write " selected"
    response.write ">"&rs3(1)&"</option>"
    rs3.movenext
  loop
  rs3.close
  set rs3=nothing
  response.write "</select><input type=hidden name=csnd value='"&csnd&"'>"&redx&"请选择一个分类"
end sub



sub adn1
dim nname,topic,hidden,tim,weather
nummer=15
nums=nummer
sql="select count(id) from blog_data where type='article' and username='"&login_id&"'"
set rs=joekoe_cms.exec(sql,1)
rssum=rs(0)
  rs.close
  if int(rssum)<1 then
     response.write "<table cellpadding='4' cellspacing='1' class=table><tr><td class=td>没有日志</td></tr><tr class=tr height=150><td align=center >没有日志</td></tr></table>"
  exit sub
  end if
  call format_pagecute()
  
  sql="select top "&nummer*viewpage&" *  from blog_data where type='article' and username='"&login_id&"' 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)
  
   response.write joekoe_cms.js_put("../style/hscms_select.js",0)
%>

<table cellpadding="4" cellspacing="1" class=table>
<form name=sel_form action='?action=handle' method=post>
<tr align=center>
<td class=td>No.</td>
<td class=td>主题</td>
<td class=td>作者</td>
<td class=td>时间</td>
<td class=td>天气</td>
<td class=td>公开</td>
<td class=td colspan=2>操作</td></tr>
<%
  for i=1 to nums
    id=rs("id")
    topic=rs("topic")
    tim=rs("tim")
    weather=rs("weather")
dim d_name
if rs("author")<>"" then
d_name=rs("author")
else
d_name=rs("username")
end if	
%>
<tr class=tr align=center><td><%response.write rssum-(i+(viewpage-1)*nummer)+1%></td>
<td align=left><a href=../blog/blog_view.asp?userid=<%=login_id%>&id=<%response.write id%>><font alt='<%response.write joekoe_cms.code_html(topic,1,0)%>'><%response.write joekoe_cms.code_html(topic,1,35)%></font></a></td>
<td><%response.write d_name%></td>
<td><%response.write tim%></td>
<td><img src=../blog/images/image/<%response.write weather%>.gif border=0></td>
<td><%if rs("hidden")=true then%><font color=blue><b alt=公开>√</b></font><%else%><font color=red><b alt=不公开>×</b></font><%end if%></td>
<td><a href=?action=edit1&id=<%response.write id%> title=编缉此日志><img src=../admin/images/edit.gif border=0></a></td><td><input type=checkbox name=sel_id value=<%response.write id%>></td>
</tr>
<%
    rs.movenext
  next
  rs.close
%>
<tr class=trb height=26><td colspan=4>&nbsp;共有<font class=red><%response.write rssum%></font>条日志&nbsp;页次：<font class=red><%response.write viewpage&"</font>/<font class=red>"&thepages%></font>&nbsp;分页：<% response.write jk_pagecute(nummer,thepages,viewpage,"blog.asp?userid="&login_id&"&action=adn1&",5,"#ff0000") %></td>
<td colspan=3 align=center>

执行
<select name=sel_type size=1>
<option value='公开'>公开日志</option>
<option value='取消公开'>取消公开</option>
<option value='删除'>删除日志</option>
</select>
<input type=submit class=btn value='操作' onclick="return sel_click(this.form);">
</td><td align=center><input type=checkbox name=sel_all value='yes' onclick="javascript:select_all(this.form);"></td>
</tr></form></table>
<br><br>
<%
end sub

sub adn2
dim nname,topic,hidden,tim,weather
nummer=15
nums=nummer
sql="select count(id) from blog_data where type='photo' and username='"&login_id&"'"
set rs=joekoe_cms.exec(sql,1)
rssum=rs(0)
  rs.close
  if int(rssum)<1 then
    response.write "<table cellpadding='4' cellspacing='1' class=table><tr><td class=td>没有相片</td></tr><tr class=tr height=150 ><td align=center >没有相片</td></tr></table>"
    exit sub
  end if
  call format_pagecute()

  sql="select top "&nummer*viewpage&" * from blog_data where type='photo' and username='"&login_id&"' 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)
  
   response.write joekoe_cms.js_put("../style/hscms_select.js",0)
%>

<table cellpadding="4" cellspacing="1" class=table>
<form name=sel_form action='blog.asp?userid=<%=b_user%>&action=handle' method=post>
<tr align=center>
<td class=td>序号</td>
<td class=td>主题</td>
<td class=td>作者</td>
<td class=td>时间</td>
<td class=td>公开</td>
<td class=td colspan=2>操作</td></tr>
<%
  for i=1 to rssum
    id=rs("id")
    topic=rs("topic")
    tim=rs("tim")
    if rs("author")<>"" then
     d_name=rs("author")
    else
     d_name=rs("username")
    end if	
%>
<tr class=tr align=center><td ><%response.write rssum-(i+(viewpage-1)*nummer)%></td>
<td align=left>&nbsp;&nbsp;<a href=../blog/photo_view.asp?userid=<%=login_id%>&id=<%response.write id%>><font alt='<%response.write joekoe_cms.code_html(topic,1,0)%>'><%response.write joekoe_cms.code_html(topic,1,35)%></font></a></td>
<td><%response.write d_name%></td>
<td><%response.write joekoe_cms.time_type(tim,4)%></td>
<td><%if rs("hidden")=true then%><font color=blue><b alt=公开>√</b></font><%else%><font color=red><b alt=不公开>×</b></font><%end if%></td>
<td><a href=?action=edit2&id=<%response.write id%> title=编缉照片><img src=../admin/images/edit.gif border=0></a></td>
<td><input type=checkbox name=sel_id value=<%response.write id%>></td>
</tr>
<%
  rs.movenext
  next
  rs.close
%>
<tr class=trb height=26><td colspan=4>&nbsp;共有<font class=red><%response.write rssum%></font>个照片&nbsp;页次：<font class=red><%response.write viewpage&"</font>/<font class=red>"&thepages%></font>&nbsp;分页：<% response.write jk_pagecute(nummer,thepages,viewpage,"?action=adn2&",5,"#ff0000") %></td>
<td colspan=2 align=center>
执行
<select name=sel_type size=1>
<option value='公开'>公开照片</option>
<option value='取消公开'>取消公开</option>
<option value='删除'>删除照片</option>
</select>
<input type=submit class=btn value='操作' onclick="return sel_click(this.form);">
</td><td align=center><input type=checkbox name=sel_all value='yes' onclick="javascript:select_all(this.form);"></td>
</tr></form></table>
<br><br>
<%
end sub


sub chk_handle()
  dim sel_type,seltype
  sel_type=trim(request.form("sel_type"))
  select case sel_type
  case "公开"
    seltype="gk"
  case "取消公开"
    seltype="qxgk"
  case "删除"
    seltype="delete"
  case else
    sel_type=""
    seltype=""
  end select
  if sel_type="" or seltype="" then
    	Response.Write "<script>"
	Response.Write "alert('您在提交用户操作时出现非法的数据');"
	Response.Write "</script>"
    exit sub
  end if
  dim sel_id,hdim,hnum,id
  sel_id=trim(request.form("sel_id"))
  sel_id=replace(sel_id," ","")
  hdim=split(sel_id,",")
  hnum=ubound(hdim)
  for i=0 to hnum
    id=hdim(i)
    if isnumeric(id) then
      select case seltype
      case "delete"
  	 call joekoe_cms.exec("delete from blog_data where username='"&login_id&"' and id="&id&"",0)
      case "gk"
        sql="update blog_data  set hidden=1 where username='"&login_id&"' and id="&id
        conn.execute(sql)
      case "qxgk"
        sql="update blog_data  set hidden=0 where username='"&login_id&"' and id="&id
        conn.execute(sql)
      case else

      end select
    end if
  next
  erase hdim
Response.Write ("<table cellpadding='4' cellspacing='1' class=table><tr><td align=left class=td>&nbsp;成功信息</td></tr>")
Response.Write ("<tr class=tr><td align=center  height=180>")
Response.Write ("已成功（"&sel_type&"）操作了"&(hnum+1)&"条"&tit_fir&"记录！<br><br>")
Response.Write ("<a href='"&trim(request.servervariables("http_referer"))&"'>返回上一页</a>")
Response.Write ("&nbsp;&nbsp;&nbsp;&nbsp;<a href=?>博客管理首页</a></td></tr></table>")
end sub

sub tags_article()
%>
<TABLE class=table cellSpacing=1 cellPadding=4><TBODY>
	 <tr><td class=td colspan=2>Tags管理</td></tr>
	 <tr class=tr>
  <td ><a href='?action=article_tags'>日志tag管理</a></td>
  <td ><a href='?action=photo_tags'>图片tag管理</a></td>
</tr>
</TBODY></table>
<%=ukong%>
<TABLE class=table cellSpacing=1 cellPadding=4><TBODY>
	 <tr><td class=td colspan=2>日志Tags管理</td></tr>

	<tr class=tr><td>
	<%
   sql="select Tags,sum(Num)as Num2 from blog_tags where type='article' and Username='"&login_username&"' group by Tags "
   set rs = joekoe_cms.exec(sql,1)
   if not rs.Eof then
     while not rs.Eof
       	strTag= "<span class='tags'><a href=""../blog/tags.asp?action=search&keyword=" &  Server.URLEncode(RS("tags")) & """ title=""共有日志"&rs("Num2")&"篇"" target='_blank'>" & Server.HTMLEncode(RS("tags")) & "</a></span><span class='other'>(<a href='?action=del_tags&tag="&rs("Tags")&"&type=article_tags' onclick=""return (confirm('真的要删除“"&rs("Tags")&"”标签吗？'))"">删除</a>)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&vbCrLf      
      Response.Write strTag      
      rs.MoveNext
     wend
      end if
   rs.close
   %>	
</td></tr></table>
<%

end sub

sub tags_photo()
%>
<TABLE class=table cellSpacing=1 cellPadding=4><TBODY>
	 <tr><td class=td colspan=2>Tags管理</td></tr>
	 <tr class=tr>
  <td ><a href='?action=article_tags'>日志tag管理</a></td>
  <td ><a href='?action=photo_tags'>图片tag管理</a></td>
</tr>
</TBODY></table>
<%=ukong%>
<TABLE class=table cellSpacing=1 cellPadding=4><TBODY>
	 <tr><td class=td colspan=2>图片Tags管理</td></tr>
	<tr class=tr><td>
	<%
   sql="select Tags,sum(Num)as Num2,Max(Num)as Max2 from blog_tags where type='photo' and Username='"&login_username&"'  group by Tags "
 set rs = joekoe_cms.exec(sql,1)
   if not rs.Eof then
       while not rs.Eof
           	strTag= "<span class='tags'><a href=""../blog/tags.asp?action=seapic&keyword=" &  Server.URLEncode(RS("tags")) & """ title=""共有图片"&rs("Num2")&"张"" target='_blank'>" & Server.HTMLEncode(RS("tags")) & "</a></span><span class='other'>(<a href='?action=del_tags&tag="&rs("Tags")&"&type=photo_tags' onclick=""return (confirm('真的要删除“"&rs("Tags")&"”标签吗？'))"">删除</a>)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&vbCrLf 	
      Response.Write strTag      
      rs.MoveNext
     wend
    end if
   rs.close
   %>	
</td></tr>
</table>
<%

end sub

sub  del_tags()
dim del_tags,dtype
del_tags=replace(trim(request.querystring("tag")),"'","''")
dtype=replace(trim(request.querystring("type")),"'","''")
if dtype="article" then
sql="delete from blog_tags where Username='"&login_username&"' and tags='"&del_tags&"'"
call joekoe_cms.exec(sql,0)
else
sql="delete from blog_tags where Username='"&login_username&"' and  tags='"&del_tags&"'"
call joekoe_cms.exec(sql,0)
end if
Response.Redirect("?action="&dtype)
end sub


sub noblog()
%>
<table cellspacing=1 cellpadding=4 class=table align='center'>
<tr><td class=td>&nbsp;错误信息→你还没有申请博客</td></tr>
<tr class=tr><td  height=120>
<li>对不起，你还没有申请博客
<li>你必须拥有博客后才能进行管理操作
<li>只要您是本站用户，您就有资格申请博客
<li>欢迎您加入我们，成为我们博客的一员
<li>请点击 <a href="../blog/blogreg.asp"><font class=red>这里</font></a> 开始申请博客!</td></tr>
</table>
<%
end sub

    Sub key_tags(tags, data, ttype)
  Dim TagArray, TagCount, UserID, key_sql
  Do While InStr(tags, "  ") > 0
  tags = Replace(tags, "  ", " ")
Loop
  TagArray = Split(tags, " ", -1, 1)
        TagCount = UBound(TagArray, 1)
        For I = 0 To TagCount
             key_sql = "select * from " & data & " where Username='" & login_username & "' and Tags='" & TagArray(I) & "'"
            call joekoe_cms.exec(key_sql, -1)
    rs.open key_sql, conn, 1, 3
    If rs.EOF Then
            rs.AddNew
                rs("Username") = login_username
				rs("type") = ttype
                rs("Tags") = TagArray(I)
                rs("num") = 0
                rs.Update
            
            End If
                rs.Close
            '重新计算
        call joekoe_cms.exec("update " & data & " set Num=num+1 where Username='" & login_username & "' and Tags='" & TagArray(I) & "'", 0)
                            
        Next
   Erase TagArray
End Sub

Function key_tags2(tags)
    Do While InStr(tags, "  ") > 0
  tags = Replace(tags, "  ", " ")
  Loop
  key_tags2 = tags
   
End Function

sub blog_first()
sql="select * from blog where username='"&login_id&"'"
set rs=joekoe_cms.exec(sql,1)
if rs.eof then
   response.Redirect("blog.asp?action=noblog")
   response.End()
else
    b_id=rs("id")
    b_name=rs("blogname")
    b_skin=rs("skin")
    if var_null(b_skin)="" then b_skin=1
end if
rs.close 
end sub

'****************************************************
' HSCMS 1.2      Power by eebaa.com
' Email: yz_xiaojun@163.com
' Web: http://www.eebaa.com
' Copyright (C) 2004 eebaa.com All Rights Reserved.
'****************************************************
%>