<!-- #include file="include/con_help.asp" -->
<!-- #include file="include/jk_ubb.asp" -->
<!-- #include file="include/jk_val_code.asp" -->
<!-- #include file="include/jk_page_cute.asp" -->
<!-- #include file="include/jk_pagecute.asp" -->
<script language="JavaScript" src="style/joekoe_select.js"></script>
<script language="JavaScript" src="images/diary/diary_mainjs.js"></script>
<script language="VBScript" src="images/diary/diary_mainvbs.js"></script>
<script language="JavaScript" type="text/JavaScript">
function set_showsamp(){
if(document.all["issamp"].checked=true)
{
document.all["samp"].background="";
}
}

function setsamp(w){
document.all["samp"].background="images/diary/image/back/"+w+".gif";
}
</script>
<script language="VBScript" type="text/VBScript">
Function checkdate()
y=year(Now)
m=month(Now)
d=day(Now)
theDate=document.all("a_year").value&"-"&document.all("a_month").value&"-"&document.all("a_day").value
if DateDiff("d", Now, theDate)>0 then
alert("那天还没有到呢！")
document.all("a_year").value=y
document.all("a_month").value=m
document.all("a_day").value=d
end if
End Function
</script>
<%
function clasky_string(a)
a=replace(a,"<","&lt;")
a=replace(a,">","&gt;")
a=replace(a,"'"," ")
a=replace(a,"""","&quot;")
clasky_string=a
end function
%>
<% 
dim nummer,nums,rssum,page,viewpage,thepages,pageurl
pageurl="?"
nummer=31
nums=nummer
index_url="diary"
select case action
case "write"
  tit_fir="宠物征婚"
  tit="发布征婚"
case "mydiary"
  tit_fir="宠物征婚"
  tit="我的宠物"
case "show"
  tit_fir="宠物征婚"
  tit="查看内容"
case "edit"
  tit_fir="宠物征婚"
  tit="编缉内容"
case else
  tit_fir="宠物征婚"
  tit="公开征婚"
end select
if action="write" then
  call web_head(0,1,0,0,0)
else
  call web_head(0,0,0,0,0)
end if 

'----------------------------左边 开始----------------------------
call diary_date()
response.write vbcrlf&"<table cellspacing=1 cellpadding=1 class=table>"
response.write vbcrlf&"<tr><td colspan=2 class=td>&nbsp;&nbsp;<script language=javascript>document.write(img_skin('m_'));</script>网站日记</td></tr>"
%>
<tr class=bg_td><td align=center>
  <table border=0 cellspacing=1 cellpadding=4 width='100%'>
  <tr><td align=center><script language=javascript>document.write(img_skin('m_'));</script><a href='?action=write' class=blue><b>我要发布宠物征婚</b></a></td></tr>
  <tr><td align=center><script language=javascript>document.write(img_skin('m_'));</script><a href='?action=mydiary' class=blue><b>查看我的宠物征婚</b></a></td></tr>
  <tr><td align=center><script language=javascript>document.write(img_skin('m_'));</script><a href='diary.asp' class=blue><b>查看宠物征婚</b></a></td></tr>
  <tr><td>只有注册并登陆后才可以发布宠物征婚。</td></tr>
  </table>
</td></tr>
<%
	response.write vbcrlf&"</table>"
	response.write vbcrlf&"<table border=0><tr><td height=6></td></tr></table>"

call left_action()

'----------------------------左边 结束----------------------------

call web_center(0)

'----------------------------中间 开始----------------------------
response.write vbcrlf&"<table cellspacing=1 cellpadding=1 class=table>"

select case action
case "write"
  call diary_write()
case "mydiary"
  call diary_mydiary()
case "show"
  call diary_show()
case "edit"
  call diary_edit()
case "handle"
  call huzhu_chk_handle()
case else
  call diary_main()
end select
	response.write vbcrlf&"</table>"
	response.write vbcrlf&"<table border=0><tr><td height=6></td></tr></table>"
'----------------------------中间 结束----------------------------

call web_end(0,0)

sub diary_date()
response.write vbcrlf&"<table cellspacing=1 cellpadding=1 class=table>"
response.write vbcrlf&"<tr><td colspan=2 class=td>&nbsp;&nbsp;<script language=javascript>document.write(img_skin('m_'));</script>我的宠物征婚</td></tr>"
%>
<tr class=bg_tds><td>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td colspan="2" style="cursor:hand" onclick="writemonth(clasky_c-1)" title="上个月"><div align="center"><div align="center"><font face="Webdings"><b>3</b></font></div></td>
    <td colspan="3"><b><div align="center" id="nowmonth"><a href=?action=write><font class=red title="选择日期开始写征婚内容">选择日期</font></a></div></b></td>
    <td colspan="2" style="cursor:hand" onclick="writemonth(clasky_c+1)" title="下个月"><div align="center"><div align="center"><font face="Webdings"><b>4</b></font></div></td>
  </tr></table>
</td></tr>
<tr class=bg_td><td><div id="monthdate"><font class=blue>说明：</font><br>&nbsp;&nbsp;&nbsp;&nbsp;1、点击“选择日期”选择相应的日期开始写内容。<br>&nbsp;&nbsp;&nbsp;&nbsp;2、“私人”只有自己可见，“公开”所有人可见。</div></td></tr>
<%
	response.write vbcrlf&"</table>"
	response.write vbcrlf&"<table border=0><tr><td height=6></td></tr></table>"
end sub

sub diary_write()
  if login_mode="" then call my_login()   '未登陆不可申请
%>
<tr><td class=td>&nbsp;&nbsp;<script language=javascript>document.write(img_skin('m_'));</script><%response.write tit%></td></tr>
<tr><td class=bg_tds>
<%
  dim found_err,drname,drtopic,dricon,drword,drhidden,drweather,drtim,addtime,drsampname,diaryname
  if joekoe_cms.chk() then
    drname=login_username
    diaryname=trim(request.form("diaryname"))
    drweather=trim(request.form("weather"))
    dricon=trim(request.form("icon"))
    drsampname=trim(request.form("sampname"))
    drtopic=trim(request.form("wrtopic"))
    drtopic=joekoe_cms.code_form(drtopic)
    drword=request.form("wrword")
    drhidden=trim(request.form("wrhidden"))
    drtim=trim(request.form("a_year"))&"-"&trim(request.form("a_month"))&"-"&trim(request.form("a_day"))&" "&time()
    addtime=clasky_string(request("a_year"))&"-"&clasky_string(request("a_month"))&"-"&clasky_string(request("a_day"))

if datediff("d",addtime,now)>=0 then
	dim rs_t,sql_t
       sql_t="select * from diary where nname='"&login_username&"' and tim like '%"&addtime&"%'"
  	set rs_t=joekoe_cms.exec(sql_t,1)
	if rs_t.eof then
'-------保存日记--------------------------------------
 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 align=center class=bg_td height=300>"&found_error(found_err,260)&"</td></tr></table>"
      exit sub
    end if
    sql="select * from diary where (id is null)"
    call joekoe_cms.exec("",-1)
    rs.open sql,conn,1,3
    rs.addnew
    rs("nname")=drname
    rs("weather")=drweather
    rs("icon")=dricon
    rs("topic")=drtopic
    rs("word")=drword
    rs("tim")=drtim
    rs("sampname")=drsampname
    rs("diaryname")=diaryname
    if drhidden="yes" then
      rs("hidden")=true
    else
      rs("hidden")=false
    end if
    rs.update
    rs.close
%>
<table class=table><tr class=bg_td><td align=center height=300>
！！<font class=red>你的征婚内容已经成功保存</font>！！！<br><br>
<a href='diary.asp?action=mydiary'>返回我的内容</a><br><br>
（系统将在<font class=red><%=dim_num(21)%></font>秒钟后自动返回）
<meta http-equiv='refresh' content='<%=dim_num(21)%>; url=diary.asp?action=mydiary'>
</td></tr></table>
</table>
<%
    call val_chk_end(index_url)
    exit sub
'-------保存日记--------------------------------------
	else
    	Response.Write "<script>"
		Response.Write "alert('这天的内容你已经写过了，请到个人内容里面查看！');"
	Response.Write "</script>"
	end if
	rs_t.close
else
    	Response.Write "<script>"
	Response.Write "alert('你写的是以后的内容，呵呵，不可以哦！');"
	Response.Write "</script>"
end if

  end if
%>
<table border=0 width='100%' cellspacing=0 cellpadding=0>
<tr><td height=1 class=bg_frame colspan=3></td></tr>
<tr><td width=1 class=bg_frame></td><td>
<table border=0 cellspacing=1 cellpadding=2 width='100%' id=samp background=images/diary/image/back/7.gif>
<form name=write_frm action='?action=write' method=post onsubmit="frm_submitonce(this)">
<input type=hidden name=chk value='yes'>
<%response.write val_code_num(index_url,1)%>
<tr height=30>
<td>今日天气：</td>
<td>
<%
dim i
for i=1 to 5
response.write "<img src=images/diary/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 height=30>
<td>征婚主题：</td>
<td><input type=text name=wrtopic size=65 maxlength=50></td>
</tr>
<tr height=30>
<td>表情图标： </td>
<td colspan=2><%response.write jk_icon(0)%></td>
</tr>
<tr height=100>
<td valign=top><br>征婚内容：<br><br></td>
<td><textarea rows=6 name=wrword cols=65 maxlength=1000 title='按 Ctrl+Enter 可直接发送' onkeydown="javascript:frm_quicksubmit();"></textarea></td>
</tr>
<tr height=25>
<td>宠物主人：</td>
<td><input type=text name=diaryname value='<%response.write login_username%>' size=20 maxlength=20></td>
</tr>
<tr height=25>
<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>
<td>内容背景：</td><td>
<input name="issamp" type="radio" id="issamp" onclick="set_showsamp()" value="1">零
<input name="sampname" type="radio" onclick="setsamp(this.value)" value="1" checked>一
<input name="sampname" type="radio" value="2" onclick="setsamp(this.value)">二
<input name="sampname" type="radio" value="3" onclick="setsamp(this.value)">三
<input name="sampname" type="radio" value="4" onclick="setsamp(this.value)">四
<input name="sampname" type="radio" value="5" onclick="setsamp(this.value)">五
<input name="sampname" type="radio" value="6" onclick="setsamp(this.value)">六
<input name="sampname" type="radio" value="7" onclick="setsamp(this.value)">七
<input name="sampname" type="radio" value="8" onclick="setsamp(this.value)">八
</td></tr>
<tr height=30>
<td>是否公开：</td>
<td><input type=radio name=wrhidden value='no' checked class=bg_td>私人<input type=radio name=wrhidden value='yes' class=bg_td>公开<script language=javascript>document.write(redx);</script>选择公开后，此内容所有人可见，否则不可见。</td>
</tr>
<tr height=30><td colspan=3 align=center><input type=submit name=wsubmit value=' 可 以 发 送 啦 '>　　<input type=reset value=' 重 新 再 来 ' onclick="return reset()"></td></tr>
</table>
</td><td width=1 class=bg_frame></td></tr>
<tr><td height=1 class=bg_frame colspan=3></td></tr>
</table>
</td></tr>
</form>
<%
'--------取得日期---------------------------------------
dim a_id,a_y,a_m,a_d
	a_id=clasky_string(request("a_id"))
	if a_id<>"" then
a_id=dateadd("d",a_id,"2003-1-1")
a_y=datepart("yyyy",a_id)
a_m=datepart("m",a_id)
a_d=datepart("d",a_id)
Response.Write("<script>")
Response.Write("document.all[""a_year""].value="&a_y&";")
Response.Write("document.all[""a_month""].value="&a_m&";")
Response.Write("document.all[""a_day""].value="&a_d&";")
Response.Write("</script>")
	end if
'--------取得日期---------------------------------------
call dowrite()
end sub

sub diary_edit()
%>
<tr><td class=td>&nbsp;&nbsp;&nbsp;<script language=javascript>document.write(img_skin('m_'));</script>&nbsp;<%response.write tit%></td></tr>
<tr><td class=bg_tds>
<%
  dim found_err,drname,drtopic,dricon,drword,drhidden,drweather,drtim,addtime,drsampname,diaryname,id
  id=trim(request.querystring("id"))
  if not(isnumeric(id)) then
    call format_redirect("diary.asp")
  end if 
  sql="select top 1 * from diary where 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=bg_td height=300>"&tit_fir&"ID（"&id&"）不存在！</td></tr></table>"
    exit sub
  end if
  if joekoe_cms.chk() then
    diaryname=trim(request.form("diaryname"))
    drweather=trim(request.form("weather"))
    dricon=trim(request.form("icon"))
    drsampname=trim(request.form("sampname"))
    drtopic=trim(request.form("wrtopic"))
    drtopic=joekoe_cms.code_form(drtopic)
    drword=request.form("wrword")
    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 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 align=center class=bg_td 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("sampname")=drsampname
    rs("diaryname")=diaryname
    if drhidden="yes" then
      rs("hidden")=true
    else
      rs("hidden")=false
    end if
    rs.update
    rs.close
%>
<table class=table><tr class=bg_td><td align=center height=300>
！！<font class=red>你的内容已经成功保存</font>！！！<br><br>
<a href='diary.asp?action=mydiary'>返回我的日记本</a><br><br>
（系统将在<font class=red><%=dim_num(21)%></font>秒钟后自动返回）
<meta http-equiv='refresh' content='<%=dim_num(21)%>; url=diary.asp?action=mydiary'>
</td></tr></table>
</table>
<%
    call val_chk_end(index_url)
    exit sub
'-------保存日记--------------------------------------
  end if
%>
<table border=0 width='100%' cellspacing=0 cellpadding=0>
<tr><td height=1 class=bg_frame colspan=3></td></tr>
<tr><td width=1 class=bg_frame></td><td>
<table border=0 cellspacing=1 cellpadding=2 width='100%' id=samp background=images/diary/image/back/<%response.write rs("sampname")%>.gif>
<form name=write_frm action='?action=edit&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 height=30>
<td>今日天气：</td>
<td>
<img src=images/diary/image/1.gif border=0><input type=radio name=weather value=1 <%if rs("weather")=1 then%>checked<%end if%>>&nbsp;
<img src=images/diary/image/2.gif border=0><input type=radio name=weather value=2 <%if rs("weather")=2 then%>checked<%end if%>>&nbsp;
<img src=images/diary/image/3.gif border=0><input type=radio name=weather value=3 <%if rs("weather")=3 then%>checked<%end if%>>&nbsp;
<img src=images/diary/image/4.gif border=0><input type=radio name=weather value=4 <%if rs("weather")=4 then%>checked<%end if%>>&nbsp;
<img src=images/diary/image/5.gif border=0><input type=radio name=weather value=5 <%if rs("weather")=5 then%>checked<%end if%>>&nbsp;
</td>
</tr>
<tr height=30>
<td>征婚主题：</td>
<td><input type=text name=wrtopic value="<%response.write rs("topic")%>" size=65 maxlength=50></td>
</tr>
<tr height=30>
<td>表情图标： </td>
<td colspan=2><%response.write jk_icon(rs("icon"))%></td>
</tr>
<tr height=100>
<td valign=top><br>征婚内容：<br><br></td>
<td><textarea rows=6 name=wrword cols=65 maxlength=1000 title='按 Ctrl+Enter 可直接发送' onkeydown="javascript:frm_quicksubmit();"><%response.write rs("word")%></textarea></td>
</tr>
<tr height=25>
<td>宠物主人：</td>
<td><input type=text name=diaryname value='<%response.write rs("diaryname")%>' size=20 maxlength=20></td>
</tr>
<tr height=25>
<td>签写日期：</td><td><%response.write joekoe_cms.time_type(rs("tim"),5)%></td>
</tr>
<tr height=30>
<td>内容背景：</td><td>
<input name="issamp" type="radio" id="issamp" onclick="set_showsamp()" value="1">零
<input name="sampname" type="radio" onclick="setsamp(this.value)" value="1" <%if rs("sampname")=1 then%>checked<%end if%>>一
<input name="sampname" type="radio" value="2" onclick="setsamp(this.value)" <%if rs("sampname")=2 then%>checked<%end if%>>二
<input name="sampname" type="radio" value="3" onclick="setsamp(this.value)" <%if rs("sampname")=3 then%>checked<%end if%>>三
<input name="sampname" type="radio" value="4" onclick="setsamp(this.value)" <%if rs("sampname")=4 then%>checked<%end if%>>四
<input name="sampname" type="radio" value="5" onclick="setsamp(this.value)" <%if rs("sampname")=5 then%>checked<%end if%>>五
<input name="sampname" type="radio" value="6" onclick="setsamp(this.value)" <%if rs("sampname")=6 then%>checked<%end if%>>六
<input name="sampname" type="radio" value="7" onclick="setsamp(this.value)" <%if rs("sampname")=7 then%>checked<%end if%>>七
<input name="sampname" type="radio" value="8" onclick="setsamp(this.value)" <%if rs("sampname")=8 then%>checked<%end if%>>八
</td></tr>
<tr height=30>
<td>是否公开：</td>
<td><input type=radio name=wrhidden value='no' <%if rs("hidden")=false then%>checked<%end if%> class=bg_td>私人<input type=radio name=wrhidden <%if rs("hidden")=true then%>checked<%end if%> value='yes' class=bg_td>公开<script language=javascript>document.write(redx);</script>选择公开后，此内容所有人可见，否则不可见。</td>
</tr>
<tr height=30><td colspan=3 align=center><input type=submit name=wsubmit value=' 可 以 发 送 啦 '>　　<input type=reset value=' 重 新 再 来 ' onclick="return reset()"></td></tr>
</table>
</td><td width=1 class=bg_frame></td></tr>
<tr><td height=1 class=bg_frame colspan=3></td></tr>
</table>
</td></tr>
</form>
<%
end sub

sub diary_mydiary()
  if login_mode="" then call my_login()   '未登陆不可申请
  dim id,nname,topic,hidden,tim,weather
  sql="select count(id) from diary where nname='"&login_username&"'"
  set rs=joekoe_cms.exec(sql,1)
  rssum=rs(0)
  rs.close
  if int(rssum)<1 then
    call diary_write()
    exit sub
  end if
  call format_pagecute()
  sql="select top "&nummer*viewpage&" * from diary where nname='"&login_username&"' 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)
%>
<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("diaryname")<>"" then
d_name=rs("diaryname")
else
d_name=rs("nname")
end if	
%>
<tr class=bg_td align=center><td><%response.write rssum-(i+(viewpage-1)*nummer)+1%></td>
<td align=left><a href=?action=show&id=<%response.write id%>><font alt='<%response.write joekoe_cms.code_html(topic,1,0)%>'><%response.write joekoe_cms.code_html(topic,1,8)%></font></a></td>
<td><%response.write d_name%></td>
<td><%response.write tim%></td>
<td><img src=images/diary/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=edit&id=<%response.write id%> title=编缉此内容><img src=images/admin/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=bg_tds height=30><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=mydiary&",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 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>
<%
call dowrite()
end sub


sub diary_main()
  dim id,nname,topic,hidden,tim,weather
  sql="select count(id) from diary where hidden=1"
  set rs=joekoe_cms.exec(sql,1)
  rssum=rs(0)
  rs.close
  if int(rssum)<1 then
    call diary_write()
    exit sub
  end if
  call format_pagecute()
  sql="select top "&nummer*viewpage&" * from diary where hidden=1 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)
%>
<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></tr>
<%
  for i=1 to nums
    id=rs("id")
    topic=rs("topic")
    tim=rs("tim")
    weather=rs("weather")
dim d_name
if rs("diaryname")<>"" then
d_name=rs("diaryname")
else
d_name=rs("nname")
end if		
%>
<tr class=bg_td align=center><td><%response.write rssum-(i+(viewpage-1)*nummer)+1%></td>
<td align=left><a href=?action=show&id=<%response.write id%>><font alt='<%response.write joekoe_cms.code_html(topic,1,0)%>'><%response.write joekoe_cms.code_html(topic,1,12)%></font></a></td>
<td><%response.write d_name%></td>
<td><%response.write tim%></td>
<td><%response.write rs("count")%></td>
<td><img src=images/diary/image/<%response.write weather%>.gif border=0></td></tr>
<%
    rs.movenext
  next
  rs.close
%>
<tr class=bg_tds height=30><td colspan=6>&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,pageurl,5,"#ff0000") %></td></tr>
<%
end sub

sub diary_show()

dim e_id,a_id
e_id=clasky_string(request("e_id"))
if e_id<>"" then e_id=dateadd("d",e_id,"2003-1-1")
a_id=clasky_string(request("id"))
if a_id="" then 
  sql="select * from diary where tim like '%"&e_id&"%' and  nname='"&login_username&"'"
else
  sql="select * from diary where id="&a_id&""
end if		
  call joekoe_cms.exec("",-1)
  rs.open sql,conn,1,1
	if rs.eof then
%>
<tr><td class=td>&nbsp;出错了！</td></tr>
<tr class=bg_tds><td align=center height=50><br><br>对不起，内容不存在！<br><br><a href=<%response.write trim(request.servervariables("http_referer"))%>>返回</a><br><br></td></tr>
<%
	else
    call joekoe_cms.exec("update diary set count=count+1 where id="&rs("id")&"",0)
dim d_name
if rs("diaryname")<>"" then
d_name=rs("diaryname")
else
d_name=rs("nname")
end if
%>
<tr><td class=td>&nbsp;&nbsp;&nbsp;<img border=0 src=images/small/m_.gif align=absmiddle>&nbsp;<%response.write tit%></td></tr>
<tr><td class=bg_tds>
<table border=0 width='100%' cellspacing=0 cellpadding=0>
<tr><td height=1 class=bg_frame colspan=3></td></tr>
<tr><td width=1 class=bg_frame></td><td>
<table border=0 valign=top cellspacing=1 cellpadding=2 width='100%' height=330 background=images/diary/image/back/<%response.write rs("sampname")%>.gif>
<tr height=30><td>&nbsp;&nbsp;<%= doweather(rs("weather")) %>&nbsp;&nbsp;<font color=#222222><%=joekoe_cms.time_type(rs("tim"),5)%>&nbsp;&nbsp;星期<%= weeks(datepart("w",rs("tim"))) %></font><td></tr>
<tr height=30><td>&nbsp;&nbsp;<img src=images/icon/<%=rs("icon")%>.gif border=0>&nbsp;&nbsp;<b><%response.write rs("topic")%></b><td></tr>
<tr><td valign=top><hr height=1 width='90%' align=left><%response.write code_jk(rs("word"))%></td></tr>
<tr><td height=30><hr align=left height=1 width='90%'>&nbsp;&nbsp;作者：<%response.write d_name%>&nbsp;&nbsp;浏览：<%response.write rs("count")%></td></tr>
</table>
</td><td width=1 class=bg_frame></td>
<tr><td height=1 class=bg_frame colspan=3></td></tr></table>
</td></tr>
<tr><td align=right class=td>
<a class=h_td href='javascript:history.back(1)'>返回上页</a>
<a class=h_td href=?>日记首页</a>&nbsp;</td></tr>
<%
      end if
  rs.close
if login_mode<>"" then call dowrite()
end sub

sub dowrite()
'--------是否写过日记---------------------------------------
dim mydiary
mydiary=","
  sql="select id,tim from diary where nname='"&login_username&"'"			
  call joekoe_cms.exec("",-1)
  rs.open sql,conn,1,1
	if rs.eof then
	else
	do while not rs.eof 
	mydiary=mydiary&datediff("d","2003-1-1",rs("tim"))&","
	rs.movenext
	loop
end if
rs.close
Response.Write("<script language=""VBScript"">")
Response.Write("dodiary("""&mydiary&""")")
Response.Write("</script>")
'--------是否写过日记---------------------------------------
end sub

function weeks(w)
select case w
	case 1 weeks="日"
	case 2 weeks="一"
	case 3 weeks="二"
	case 4 weeks="三"
	case 5 weeks="四"
	case 6 weeks="五"
	case 7 weeks="六"
end select

end function

function doweather(w)
select case w
	case "1" doweather="<img src=images/diary/image/1.gif border=0>&nbsp;多云"
	case "2" doweather="<img src=images/diary/image/2.gif border=0>&nbsp;阴天"
	case "3" doweather="<img src=images/diary/image/3.gif border=0>&nbsp;晴天"
	case "4" doweather="<img src=images/diary/image/4.gif border=0>&nbsp;雾"
	case "5" doweather="<img src=images/diary/image/5.gif border=0>&nbsp;雪"
end select
end function

sub huzhu_chk_handle()
  dim sel_type,seltype
  sel_type=trim(request.form("sel_type"))
  select case sel_type
  case "公开内容"
    seltype="gkdiary"
  case "取消公开"
    seltype="qxdiary"
  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 diary where id="&id&"",0)
      case "gkdiary"
        sql="update diary set hidden=1 where id="&id
        conn.execute(sql)
      case "qxdiary"
        sql="update diary set hidden=0 where id="&id
        conn.execute(sql)
      case else

      end select
    end if
  next
  erase hdim
Response.Write ("<tr><td align=left class=td>&nbsp;&nbsp;成功信息</td></tr>")
Response.Write ("<tr><td align=center class=bg_td 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>")
end sub
%>