📄 diary.asp
字号:
<!-- #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,"<","<")
a=replace(a,">",">")
a=replace(a,"'"," ")
a=replace(a,"""",""")
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> <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> <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> 1、点击“选择日期”选择相应的日期开始写日记。<br> 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> <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 "> "
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> <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,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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -