user_post.asp

来自「是个不错的文件代码,希望大家好好用,」· ASP 代码 · 共 765 行 · 第 1/2 页

ASP
765
字号


function taghelp(){
	var str='<div style="height:200px;overflow:auto">一、什么是标签(TAG)?<br />  简单的说,标签就是一篇文章的"关键词"。您可以将日志文章或者照片,选择一个或多个词语(标签)来标记,这样一来,凡是我们博客网站上使用该词语的文章自动成为一个列表显示。<br />二、使用标签的好处:<br />  1、您添加标签的文章就会被直链接到网站相应标签的页面,这样浏览者在访问相关标签时,就有可能访问到您的文章,增加了您的文章被访问的机会。<br />  2、您可以很方便地查找到与您使用了同样标签的文章,延伸您文章的视野;可以方便地查找到与您使用了同样标签的作者,作为志同道合的朋友,您可以将他们加为好友或友情博客,扩大您的朋友圈。 <br />  3、增加标签的方式完全由您自主决定,不受任何的限制,不用受网站系统分类和自己原有日志分类的限制,便于信息的整理、记忆和查找。<br />三、如何使用标签?<br />  例如:您写了一篇到北京旅游的文章,按照文章提到的内容,您可以给这篇文章加上:<br />  北京旅游,天安门,长城,故宫<br />  等几个标签,当浏览者想搜索关于长城的文章时,浏览者会点击标签:长城,从而看到所有关于长城的文章,方便了浏览者查找日志,同时您也可用此方法找到和您同样喜欢的人,以便一起相互交流等等。<br />四.如何添加“好”的Tag? <br />  1. Tag应该要能够体现出自己的特色,并且是大家经常采用的熟悉的词语。<br />  2.用词尽量简单精炼,词语字数不要太长,两三个字的词语就可以了,尽量是有意义的词汇,不要使用一些只作为装饰的符号,如{}等。<br />  3.不要使用一些语义比较弱的词汇,如“我的家”,“图片”等。<br /></div>'
	var oDialog = new dialog("<%=blogurl%>");
	oDialog.init();
	oDialog.event(str,'');
	oDialog.button('dialogOk',"");	
	document.getElementById("ob_boxface").style.display="none";

}
function setSort(s1,s2)
{
param=s1.selectedIndex-1;
if(param>=0)
	{
	s2.options.length=0;						
		for(i=0;i<p_array[param].length;i++)
		{
			s2.options.length++;
			s2.options[i].text=p_array[param][i];
			s2.options[i].value=p_array_id[param][i];
		}

	}else
	{
	s2.options.length=0;
	s2.options.length++;
	s2.options[0].text="我的专题";
	s2.options[0].value="0";
	}
}
setInterval(autosetdraft,60000);
</script>

<form action="user_post.asp?action=savelog&t=<%=t%>" method="post" name="oblogform" id="oblogform"> 	

<div id="user_post_title">
<span class="user_post_inputtxt">标题:</span><input name="topic" type=text id="topic" size="40" maxlength="50" value="<%=topic%>"> 
    <select name="classid" id="classid">
    <%=oblog.show_Postclass(classid)%>
    </select>
    <select name="subjectid" id="subjectid">
    <option value="0">我的分类</option>
<%
Set rs = oblog.Execute("select subjectid,subjectname from oblog_subject where userid=" & userid & " And subjectType=" & t)
While Not rs.EOF
    If rs(0) = subjectid Then
        response.Write ("<option value=" & rs(0) & " selected>" & oblog.filt_html(rs(1)) & "</option>")
    Else
        response.Write ("<option value=" & rs(0) & " >" & oblog.filt_html(rs(1)) & "</option>")
    End If
    rs.movenext
Wend
%>
    </select>
</div>
<div id="user_post_tag">
	<span class="user_post_inputtxt">标签:</span><input name="logtags" type="text" size="40" maxlength="255" value="<%=tags%>"/>
        以<%
        Select Case P_TAGS_SPLIT
            Case " "
                response.Write "空格"
            Case ","
                response.Write "逗号"
            Case Else
                response.Write P_TAGS_SPLIT
        End Select
        %>分隔(<a href="#" onclick="taghelp();">什么是标签?</a>)
</div>
<div id="user_post_Editor">

<div id="user_post_Edit">
	<%
	Dim EditorHeight
	if oblog.l_Group(31,0)=1 then
		EditorHeight=260
	Else
		EditorHeight=280
	End If
		%>
  	<textarea id="edit" name="edit" style="width:100%;height:<%=EditorHeight%>px; display:none"><%=Server.HtmlEncode(logtext)%></textarea >
<%if oblog.l_Group(31,0)=1 then%>
验证码:<input name="codestr" type="text" size="6" maxlength="4" /> <%=oblog.getcode%>(如果您撰写文章花费了较长的时间,请点击验证码图片重新刷新)
<%end if%>
</div>
<%
Dim sHidden
If oblog.l_Group(11,0) = 0 or 1=1 Then
	sHidden=""
Else
	sHidden="style=""display:none;"""
End If
%>
<div id="user_post_Edit_right" <%=sHidden%>>
<font >同时发布到<%=P_QQ_NAME%>...</font>
<%
Dim rst
Set rs=oblog.Execute("Select a.teamid,a.t_name From oblog_team a ,(Select  teamid From oblog_teamusers Where userid=" & oblog.l_Uid & " and state>=3) b Where a.teamid=b.teamid And a.istate=3")
If rs.Eof Then
	Response.Write "您还没有加入任何" &P_QQ_NAME
Else
	If logid>0 Then
		Set rst=oblog.Execute("Select teamid From oblog_teampost Where logid=" & logid & " And userid=" & oblog.l_uid)
		Do While Not rs.EOF
			rst.Filter="teamid=" & rs(0)
			If Not rst.Eof Then
				%>
			    <p><input type="checkbox" name="teamid" value="<%=rs(0)%>" checked> <a href="group.asp?gid=<%=rs(0)%>" target=_blank><%=rs(1)%></a></p>
				<%
			Else
				%>
				<p><input type="checkbox" name="teamid" value="<%=rs(0)%>"> <a href="group.asp?gid=<%=rs(0)%>" target=_blank><%=rs(1)%></a></p>
				<%
			End If
    		rs.movenext
		Loop
	Else
		Do While Not rs.EOF
			%>
				<p><input type="checkbox" name="teamid" value="<%=rs(0)%>"> <a href="group.asp?gid=<%=rs(0)%>" target=_blank><%=rs(1)%></a></p>
				<%
    		rs.movenext
		Loop
	End If
End If
Set rst=Nothing
%>

<input type="hidden" name="isdraft" id="isdraft" value="0" />
<input name="logid"  type="hidden" id="logid" value=<%=logid%> >
<input name="oldisdraft"  type="hidden" id="oldisdraft" value=<%=oldisdraft%> >
    </ul>

</div>
</div>

</div>
<ul id="user_post_input">
<input type="button" id="ob_submit"  value="发布日志" title="发布日志" onclick="savelog();" />
 <input type="button" id="ob_submit_d" value="保存为草稿" title="保存为草稿" onClick="setdraft();"/>
<!-- <input type="button" onClick="oblog_editors['edit'].setHTML(oblog_editors['edit'].getHTML()+'#此前在首页部分显示#');" value="部分显示标记" />
--></ul>
 <div style="margin:-29px 0 0 380px;padding:8px;position:absolute;z-index:50;">
 <span id="save_ing" style="padding:7px 6px 5px 6px;border:1px #CCCCCC solid; height:20px;background:#FFFFE0;display:none;"></span>
 </div>

<div id="swin1" style="display:none;position:absolute;top:41px;left:10px;z-index:100;">
	<table class='win_table' align='center' border='0' cellpadding='0' cellspacing='1'>
		<tr>
			<td colspan='2' align='center' class='win_table_top'>高级选项</td>
		</tr>
		<tr>
			<td class='win_table_td' width='200'>允许评论:</td>
			<td><input value='1' name='isencomment' id="isencomment" <%If isencomment=1 Or isencomment="" Then Response.Write " checked='checked'" End If%> type='radio'>是  <input value='0' name='isencomment' id="isencomment" type='radio' <%If isencomment=0 Then Response.Write " checked='checked'" End If%>> 否</td>
		</tr>
		<tr>
			<td class='win_table_td'>仅好友可见:</td>
			<td><input value='1' name='ishide' id="ishide" <%If ishide=1 Then Response.Write " checked='checked'" End If%> type='radio'>是  <input value='0' id="ishide" name='ishide' type='radio' <%If ishide=0 Or ishide="" Then Response.Write " checked='checked'" End If%>> 否</td>
		</tr>
		<tr>
			<td class='win_table_td'>首页固顶:</td>
			<td><input value='1' name='istop' id="istop" <%If istop=1 Then Response.Write " checked='checked'" End If%> type='radio'>是  <input value='0' name='istop' id="istop"  type='radio' <%If istop=0 Or istop="" Then Response.Write " checked='checked'" End If%>> 否</td>
		</tr>
		<tr>
			<td class='win_table_td'>日志密码:</td>
			<td><input name='ispassword' id='ispassword' size='30' value=''></td>
		</tr>
		<tr>
			<td class='win_table_td'>部分显示字数:</td>
			<td><input name="showword" id="showword" size='30'value="<%if showword<>"" then response.Write(showword) else response.Write(oblog.l_uShowlogWord)%>"></td>
		</tr>
		<tr>
			<td class='win_table_td'>文件名称:</td>
			<td><input name='filename' id='filename' size='30' value="<%=filename%>" onClick="chkfilename();"  onBlur="chkfilename();">.<%=f_ext%><br/> (只能为英文、数字及下划线,最长30个字符。)</td>
		</tr>
		<tr>
			<td class='win_table_td'>共同撰写:</td>
			<td><select name="blogteam" id="s1" onChange="setSort(this,this.form.s2);">
			<option value="<%=userid%>" >我的BLOG</option>
		<%
		set rs=oblog.execute("select oblog_blogteam.mainuserid,oblog_user.blogname,oblog_blogteam.id from oblog_blogteam,[oblog_user] where oblog_blogteam.otheruserid="&userid&" and oblog_blogteam.mainuserid=[oblog_user].userid")
		while not rs.eof
			if clng(rs(0))=clng(userid) then 
				response.Write "<option value="&rs(0)&" selected>"&oblog.filt_html(rs(1))&"</option>"
			else
				response.Write "<option value="&rs(0)&">"&oblog.filt_html(rs(1))&"</option>"
			end if
			rs.movenext
		wend
		%>
			</select>
			专题: 
			<select name="blogteamsubject" id="s2">
		<%
		if oblog.l_uid<>userid and userid>0 then
			set rs=oblog.execute("select subjectid,subjectname from oblog_subject where userid="&userid)
			response.Write("<option value=0>我的专题</option>")
			while not rs.eof
				if subjectid=rs(0) then
					response.Write("<option value="&rs(0)&" selected>"&rs(1)&"</option>")
				else
					response.Write("<option value="&rs(0)&" >"&rs(1)&"</option>")
				end if
				rs.movenext
			wend
		else
			response.Write("<option value=0 selected>我的专题</option>")
		end if
		set rs=nothing
		%>                
			</select> 
			</td>
		</tr>
		<tr>
			<td class='win_table_td'>发表时间:</td>
			<td><%show_selectdate(addtime)%></td>
		</tr>
		<tr>
			<td colspan='2' class="win_table_end"><input type="button" onClick="return doMenu('swin1');" value=" 确 定 " title=" 确 定 " />&nbsp;&nbsp;&nbsp;<input type="reset" onClick="return doMenu('swin1');" value=" 取 消 " title=" 取 消 " /></td>
		</tr>
	</table>
</div>

<div id="swin2" style="display:none;position:absolute;top:41px;left:104px;z-index:100;">
	<table class='win_table' align='center' border='0' cellpadding='0' cellspacing='1'>
		<tr>
			<td align='center' class='win_table_top'>引用通告</td>
		</tr>
		<tr>
			<td><p>引用通告(支持多个引用通告,每一行为一个):</p>
				<textarea name="tb" type="text" id="tb" rows=3 cols=60><%=oblog.filt_html(tburl)%></textarea></td>
		</tr>

		<tr>
			<td class="win_table_end"><input type="button" onClick="return doMenu('swin2');" value=" 确 定 " title=" 确 定 " />&nbsp;&nbsp;&nbsp;<input type="reset" onClick="return doMenu('swin2');" value=" 取 消 " title=" 取 消 " /></td>
		</tr>
	</table>
</div>
<div id="swin3" style="display:none;position:absolute;top:41px;left:197px;z-index:100;">
	<table class='win_table' align='center' border='0' cellpadding='0' cellspacing='1'>
		<tr>
			<td align='center' class='win_table_top'>上传文件</td>
		</tr>
		<tr>
			<td><iframe id='d_file' frameborder='0' src='upload.asp?tMode=<%=t%>&re=' width='100%' height='60' scrolling='no'></iframe></td>
		</tr>
		<tr>
			<td class="win_table_end"><input type="button" onClick="return doMenu('swin3');" value=" 确 定 " title=" 确 定 " /></td>
		</tr>
	</table>
</div>
<div id="swin4" style="display:none;position:absolute;top:41px;left:292px;z-index:100;">
	<table class='win_table' align='center' border='0' cellpadding='0' cellspacing='1'>
		<tr>
			<td align='center' class='win_table_top'>文章摘要</td>
		</tr>
		<tr>
			<td><p>文章摘要(请填写您文章的简要内容): </p>
				<p>内容摘要不支持Html格式,且应小于500字符</p>
			<textarea name="abstract" type="text" id="abstract" rows=6 cols=50><%=log_abstract%></textarea>
			</td>
		</tr>
		<tr>
			<td class="win_table_end"><input type="button" onClick="return doMenu('swin4');" value=" 确 定 " title=" 确 定 "/>&nbsp;&nbsp;&nbsp;<input type="reset" onClick="return doMenu('swin4');" value=" 取 消 " title=" 取 消 " /></td>
		</tr>
	</table>
</div>
</form>
<div id="swin5"></div>
<script language="javascript">
	document.oblogform.topic.focus();
</script>
<iframe id="DivShim" scrolling="no" frameborder="0" style="position:absolute;top:0px; left:0px;display:none"></iframe>
<%
End Sub

Function SendTrack(ByVal sTrackBacks, ByVal sTopics)
    Dim aTBs, i, sTB
    sTrackBacks = Trim("sTrackBacks")
    aTBs = Split(sTrackBacks, vbCrLf)
    For i = 0 To UBound(aTBs)
        sTB = aTBs(i)
        If sTB <> "" Then
            'Send TrackBack
        End If
    Next
End Function
Sub show_selectdate(addtime)
    Dim y, m, d, h, mi, s, ttime
    If addtime = "" Then ttime = ServerDate(Now()) Else ttime = addtime
    response.Write ("<select name=selecty id=selecty>")
    For y = 2000 To 2010
        If Year(ttime) = y Then
            response.Write "<option value="&y&" selected>"&y&"年</option>"
        Else
            response.Write "<option value="&y&">"&y&"年</option>"
        End If
    Next
    response.Write "</select><select name=selectm id=selectm >"
    For m = 1 To 12
        If Month(ttime) = m Then
            response.Write "<option value="&m&" selected>"&m&"月</option>"
        Else
            response.Write "<option value="&m&">"&m&"月</option>"
        End If
    Next
    response.Write ("</select><select name=selectd id=selectd >")
    For d = 1 To 31
        If Day(ttime) = d Then
            response.Write "<option value="&d&" selected>"&d&"日</option>"
        Else
            response.Write "<option value="&d&">"&d&"日</option>"
        End If
    Next
    response.Write ("</select><select name=selecth id=selecth>")
    For h = 0 To 23
        If Hour(ttime) = h Then
            response.Write "<option value="&h&" selected>"&h&"时</option>"
        Else
            response.Write "<option value="&h&">"&h&"时</option>"
        End If
    Next
    response.Write ("</select><select name=selectmi id=selectmi>")
    For mi = 0 To 59
        If Minute(ttime) = mi Then
            response.Write "<option value="&mi&" selected>"&mi&"分</option>"
        Else
            response.Write "<option value="&mi&">"&mi&"分</option>"
        End If
    Next
    response.Write ("</select>")
End Sub
sub getteam()
	dim s,i,s1,rs,rs1
	set rs=server.createobject("adodb.recordset")
	rs.open "select oblog_blogteam.mainuserid,[oblog_user].blogname from oblog_blogteam,[oblog_user] where oblog_blogteam.otheruserid="&oblog.l_uid&" and oblog_blogteam.mainuserid=[oblog_user].userid",conn,1,1
	if not rs.eof then
		response.write "<script language=""JavaScript"">"&vbcrlf
		s = "var p_array = new Array(" + cstr(rs.recordcount-1) + ");"&vbcrlf
		response.write s
		s = "var p_array_id = new Array(" + cstr(rs.recordcount-1) + ");"&vbcrlf
		response.write s
		i = 0
		while not rs.eof
			set rs1=server.createobject("adodb.recordset")
			rs1.open "select subjectid,subjectname from oblog_subject where userid="&rs("mainuserid"),conn,1,1
			s = "var p"+cstr(rs("mainuserid"))+"_array = Array("
			s1 = "var p"+cstr(rs("mainuserid"))+"_array_id = Array("
			if rs1.recordcount > 0 then
			while not rs1.eof
				if trim(rs1("subjectname"))<>"" then
					s = s + """" + oblog.filt_html(rs1("subjectname")) + """" 
					s1 = s1 + """" + cstr(rs1("subjectid")) + """"
					s = s + ","
					s1 = s1 + ","
				end if
				rs1.movenext
			wend
			s = s + """" + "不选择专题" + """" 
			s1 = s1 + """" + cstr(0) + """"
			else
				s = s + """" + "无可用专题" + """" 
				s1 = s1 + """" + cstr(0) + """"
			end if
			s = s+ ");"&vbcrlf
			s1 = s1+ ");"&vbcrlf
			response.write s
			response.write s1 
			response.write "p_array["+cstr(i)+"] = p"+cstr(rs("mainuserid"))+"_array;"&vbcrlf
			response.write "p_array_id["+cstr(i)+"] = p"+cstr(rs("mainuserid"))+"_array_id;"&vbcrlf
			i = i + 1
			rs.movenext
		wend
		response.write  "</script>"&vbcrlf
		rs.close
		set rs=nothing
		rs1.close
		set rs1=nothing
	end if
end sub
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?