📄 user_article.asp
字号:
urs("popedom")=popedom
urs("jifen")=jifen
urs("money")=money
urs("showpage")=showpage
urs.Update
urs.close
set urs=nothing
if fabupass=0 and action<>lcase("maosin_savemdf") then
conn.execute("update ms_user set user_money=user_money+"&fabuPointNum&" where user_id="&cint(userinfo(0))&" and user_name='"&userinfo(1)&"'")
userinfo=session("userinfo")
userinfo(3)=userinfo(3)+fabuPointNum
session("userinfo")=userinfo
end if
if action=lcase("maosin_savemdf") then
showmsg "<li>恭喜恭喜,您已成功修改完成一篇文章</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回文章管理页......</b><meta http-equiv=refresh content=3;url=user_publish.asp?channel=article&action=articleList><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>","操作成功信息"
else
showmsg "<li>恭喜您,已成功添加一篇文章</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回文章管理页......</b><meta http-equiv=refresh content=3;url=user_publish.asp?channel=article&action=articleList><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>","操作成功信息"
end if
exit sub
End Sub
sub articleList()
dim mytitle
if Request("list")="1" then
sql="select * from ms_art where post_member='"&userinfo(1)&"' order by art_date desc"
mytitle="我的全部文章"
elseif Request("list")="2" then
sql="select * from ms_art where pass=true and post_member='"&userinfo(1)&"' order by art_date desc"
mytitle="通过审核的文章"
elseif Request("list")="3" then
sql="select * from ms_art where pass=false and post_member='"&userinfo(1)&"' order by art_date desc"
mytitle="没有通过审核的文章"
else
sql="select * from ms_art where post_member='"&userinfo(1)&"'"
end if
%>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="tableBC">
<tr>
<td height="22" colspan="3" valign="middle" class="tdT"> 我的全部文章</td>
</tr>
<tr class="tdBC">
<td width="420" height="25" valign="middle">标 题</td>
<td width="80" align="center" valign="middle">状 态</td>
<td width="80" align="center" valign="middle">管 理 操 作</td>
</tr>
<%
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,connstr,1,1
dim artList(7),tempStr:tempStr=""
dim n:n=20
url="user_publish.asp?channel=article&action=articleList&list=1&"
nextpage=pagetitle(rs,n,url,"篇文章")
dim lineNo:lineNo=1
if not rs.eof and not rs.bof then
do while not rs.eof and lineNo<=rs.pagesize
artList(0)=rs("id")
artlist(4)="文章标题:"&rs("art_title")&" 发表日期:"&rs("art_date")&" 录入会员:"&rs("post_member")&" 阅读次数:"&rs("art_clicks")
artList(1)="<a href=""showart.asp?id="&artList(0)&""" title="""&artList(4)&"""><font color="""&rs("titlecolor")&""">"&rs("art_title")&"</font></a>"
if rs("pass")=true then
artList(2)="核(<font color=""#ff0000"">√</font>)"
artList(5)="<font color=""#707070"">修改</font> "
artList(6)="<font color=""#707070"">删除</font>"
else
artList(5)="<a href=""user_publish.asp?channel=article&action=maosin_mdfArticle&id="&artList(0)&""">修改</a> "
artList(6)="<a href=""user_publish.asp?channel=article&action=maosin_delArticle&id="&artList(0)&""">删除</a>"
artList(2)="核(<font color=""#ff0000"">×</font>)"
end if
if rs("art_good")=true then
artList(2)=artList(2)&" 荐(<font color=""#ff0000"">√</font>)"
else
artList(2)=artList(2)&" 荐(<font color=""#ff0000"">×</font>)"
end if
artList(3)=rs("art_date")
tempStr=tempStr&"<tr class=""tdBC""><td height=""22"" valign=""middle""> "&artList(1)&"</td><td valign=""middle"" align=""center""> "&artList(2)&"</td><td valign=""middle"" align=""center"">"&artList(5)&artList(6)&"</td></tr>"
rs.movenext
lineNo=lineNo+1
loop
response.write tempStr
else
response.write "<tr><td height=""30"" colspan=""3"" valign=""middle"" align=""center"" class=""tdBC""> 您在此类暂时还没有文章</td></tr>"
end if
if rs.RecordCount>n then%>
<tr>
<td height="22" colspan="3" valign="middle" class="tdBC"><%=nextpage%></td>
</tr>
<%end if%>
</table>
<%
rs.close
set rs=nothing
End Sub
Sub deleteArticle()
dim id,sql,modNum
id=Request.QueryString("id")
sql="delete from ms_art where pass=false and post_member='"&replace(trim(userinfo(1)),"'","")&"' and id="&id
conn.execute sql,modNum
if cint(modNum)=0 then
showmsg "<font color=""#ff0000"">系统返回如下信息:</font><br><li>此篇文章已通过审核了,您没有删除的权限,如有什么问题请联系管理员!</li>","操作错误信息"
else
showmsg "<li>已成功删除一篇文章</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回......</b><meta http-equiv=refresh content=3;url=user_publish.asp?channel=article&action=articleList><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>","操作成功信息"
end if
End Sub
Sub modifyArticle()
sql="Select * from ms_art where id="&Request.QueryString("id")
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open sql,connstr,1,1
dim editpath:editpath="editor/"
%>
<script language="javascript">
function mych(){
submits();
if(document.form.artclass.options[document.form.artclass.selectedIndex].value==""){
alert("请选择所属分类");
return false;
document.form.classes.focus();
}
if(document.form.authors.value==""){
alert("文章作者不能为空!");
document.form.authors.focus();
return false;}
if(document.form.keyword.value==""){
alert("文章关键词不能为空!");
document.form.keyword.focus();
return false;
}
if(document.form.title.value==""){
alert("文章标题不能为空");
document.form.title.focus();
return false;}
if(document.form.content.value==""){
alert("文章内容不能为空");
IframeID.document.body.focus();
return false;}
return true;}
var editorpath="editor/";
</Script>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="tableBC" style="margin-top:3px;">
<tr>
<td height="25" colspan="2" valign="middle" class="tdT"> 编辑文章</td>
</tr>
<form action="user_publish.asp?channel=article&action=maosin_savemdf" name="form" Method="post" onSubmit="return mych()">
<tr class="tdBC">
<td width="70" height="25" align="right" valign="middle">文章标题:</td>
<td width="*" valign="middle">
<input name="id" type="hidden" value=<%=rs("id")%>>
<input name="title" type="text" value='<%=rs("art_title")%>' class="wenbenkang" id="title" size="40" ondrop="document.form.keyword.value=document.form.title.value;" onpaste="document.form.keyword.value=document.form.title.value;" onKeyUp="document.form.keyword.value=document.form.title.value;">
标题颜色:<input name="titlecolor" type="text" class="wenbenkang" value="<%=rs("titlecolor")%>" id="titlecolor" size="7">
<select name="colorrs" onChange="titlecolor.value=this.value;">
<option value="#000000">选择颜色</option>
<%
colorStr=split(colorRS,",")
for i=0 to ubound(colorStr)
Response.Write ("<option style=""background-color:"& colorStr(i) &";color: "& colorStr(i) &""" value="""&colorStr(i)&""">"&colorStr(i)&"</option>")
next
%>
</select>
</td>
</tr>
<tr class="tdBC">
<td height="25" align="right" valign="middle">关 键 词:</td>
<td valign="middle"><input name="keyword" type="text" class="wenbenkang" id="keyword" value="<%=rs("art_keyword")%>" size="40"> <font color="#3d3d3d">*多个关键词请用“|”分隔</font></td>
</tr>
<tr class="tdBC">
<td height="25" align="right" valign="middle">文章作者:</td>
<td valign="middle"><input name="authors" type="text" class="wenbenkang" value="<%=rs("art_authors")%>" id="authors">
<select name="name1" onChange="authors.value=this.value;">
<option value="">选择作者</option>
<option value="佚名">佚名</option>
<option value="不详">不详</option>
<option value="网络">网络</option>
<option value="<%=webname%>"><%=webname%></option>
<option value="<%=userinfo(1)%>"><%=userinfo(1)%></option>
</select></td>
</tr>
<tr class="tdBC">
<td height="25" align="right" valign="middle">文章来源:</td>
<td valign="middle"><input name="artfrom" type="text" class="wenbenkang" value="<%=rs("art_from")%>" id="artfrom">
<select name="from1" onChange="artfrom.value=this.value;">
<option value="">选择作者</option>
<option value="转载">转载</option>
<option value="不详">不详</option>
<option value="网络">网络</option>
<option value="原创">原创</option>
<option value="整理">整理</option>
<option value="<%=webname%>"><%=webname%></option>
<option value="<%=userinfo(1)%>"><%=userinfo(1)%></option>
</select></td>
</tr>
<tr class="tdBC">
<td height="25" align="right" valign="middle">文章分类:</td>
<td valign="middle">
<select name="artclass" id="artclass">
<%sql="select * from ms_art_cat"
Set rs1=Server.CreateObject("ADODB.RecordSet")
rs1.Open sql,connstr,1,1
If Not rs1.Bof And Not rs1.Eof Then
Do While Not rs1.Eof
sql="select * from ms_art_class where catID="&rs1("catID")
Set rs2=Server.CreateObject("ADODB.RecordSet")
rs2.Open sql,connstr,1,1
If Not rs2.Eof And Not rs2.Bof Then%>
<option style="color:#ff0000;font-weight:bold;">----<%=rs1("catName")%>----</option>
<%Do While Not rs2.Eof
if rs("classID")=rs2("classID") then%>
<option value="<%=rs1("catId")&","&rs2("classID")%>" selected><%=rs2("class")%></option>
<%else%>
<option value="<%=rs1("catId")&","&rs2("classID")%>"><%=rs2("class")%></option>
<%end if
rs2.MoveNext
Loop
rs2.close
Set rs2=Nothing
Else%>
<option>请添加子分类</option>
<%rs2.close
Set rs2=Nothing
End If
rs1.MoveNext
Loop
rs1.close
Set rs1=Nothing
Else%>
<option style="color:#ff0000;font-weight:bold;">----请添加大分类----</option>
<%rs1.close
Set rs1=Nothing
End If
%>
</select></td>
</tr>
<%if cint(userinfo(2))=3 then%>
<tr class="tdBC">
<td height="25" align="right" valign="middle">查看权限:</td>
<td valign="middle">
<%if Cint(rs("popedom"))=0 then%>
<input type="radio" name="popedom" id="pop0" value=0 checked><label style="cursor:hand;" for="pop0">游客</label>
<input type="radio" name="popedom" id="pop1" value=1><label style="cursor:hand;" for="pop1">普通会员</label>
<input type="radio" name="popedom" id="pop2" value=2><label style="cursor:hand;" for="pop2">VIP会员</label>
<%elseif Cint(rs("popedom"))=1 then%>
<input type="radio" name="popedom" id="pop0" value=0><label style="cursor:hand;" for="pop0">游客</label>
<input type="radio" name="popedom" id="pop1" value=1 checked><label style="cursor:hand;" for="pop1">普通会员</label>
<input type="radio" name="popedom" id="pop2" value=2><label style="cursor:hand;" for="pop2">VIP会员</label>
<%elseif Cint(rs("popedom"))=2 then%>
<input type="radio" name="popedom" id="pop0" value=0><label style="cursor:hand;" for="pop0">游客</label>
<input type="radio" name="popedom" id="pop1" value=1><label style="cursor:hand;" for="pop1">普通会员</label>
<input type="radio" name="popedom" id="pop2" value=2 checked><label style="cursor:hand;" for="pop2">VIP会员</label>
<%else%>
<input type="radio" name="popedom" id="pop0" value=0 checked><label style="cursor:hand;" for="pop0">游客</label>
<input type="radio" name="popedom" id="pop1" value=1><label style="cursor:hand;" for="pop1">普通会员</label>
<input type="radio" name="popedom" id="pop2" value=2><label style="cursor:hand;" for="pop2">VIP会员</label>
<%end if%>
<span style="color:#3D3D3D;">[需要<%=pointName%><input name="jifen" type="text" class="wenbenkang" value="<%=rs("jifen")%>" size="4">以上 | 消费<%=moneyName%>:<input name="money" type="text" class="wenbenkang" value="<%=rs("money")%>" size="4">] *游客请保持为 0</span> </td>
</tr>
<%end if%>
<tr class="tdBC">
<td height="25" align="right" valign="middle">文章属性:</td>
<td valign="middle">
<%if cint(userinfo(2))=3 then%>
<input type="checkbox" name="isgood" id="isgood" value="true" <%if rs("art_good")=true then response.write("checked") end if%>><label style="cursor:hand;" for="isgood">设为推荐</label>
<input type="checkbox" name="istop" id="istop" value="true" <%if rs("art_istop")=true then response.write("checked") end if%>><label style="cursor:hand;" for="istop">置顶文章</label>
<%end if%>
<input type="checkbox" name="allowPl" id="allowPl" value="true" <%if rs("allow_pl")=true then response.write("checked") end if%>><label for="allowPl" style="cursor:hand;">允许评论</label> <input type="checkbox" name="picart" id="picart" value="1" <%if cint(rs("picart"))=1 then response.write("checked") end if%>><label for="picart" style="cursor:hand;">图片文章</label> <br><span style="color:#3D3D3D;">[说明:选中为有效,如果选定为图片文章,请填上图片地址。]</span></td>
</tr>
<tr class="tdBC">
<td height="25" align="right" valign="middle">图片上传:</td>
<td valign="middle"><iframe height="25" width="100%" scrolling="no" frameborder="0" marginheight="0" marginwidth="0" src="upload.asp?uptype=img&urlname=form.imgurl&content=oblog_Composition" name="upimg"></iframe></td>
</tr>
<tr class="tdBC">
<td height="25" align="right" valign="middle">图片地址:</td>
<td valign="middle"><input name="imgurl" type="text" class="wenbenkang" id="imgurl" value="<%=rs("art_imgurl")%>" size=40></td>
</tr>
<tr class="tdBC">
<td align="right" valign="top">文章内容:</td>
<td valign="top"><input type="hidden" name="content" id="edit" value="<%=server.HTMLENCode(rs("art_content"))%>"><!--#include file="editor/edit.asp"-->
<div style="margin-top:4px;color:#3D3D3D;">换行请按Shift+Enter,直接按Enter为起一段</div></td>
</tr>
<tr class="tdBC">
<td height="25" align="right" valign="middle">分页方式:</td>
<td valign="top">
<%if rs("showpage")=0 then%>
<input type="radio" name="showpage" id="sp0" value=0 checked><label for="">不分页</label>
<input type="radio" name="showpage" id="sp1" value=1><label for="sp1">自动分页</label>
<input type="radio" name="showpage" id="sp2" value=2><label for="sp2">手动分页</label>
<%elseif rs("showpage")=1 then%>
<input type="radio" name="showpage" id="sp0" value=0><label for="sp0">不分页</label>
<input type="radio" name="showpage" id="sp1" value=1 checked><label for="sp1">自动分页</label>
<input type="radio" name="showpage" id="sp2" value=2><label for="sp2">手动分页</label>
<%else%>
<input type="radio" name="showpage" id="sp0" value=0><label for="sp0">不分页</label>
<input type="radio" name="showpage" id="sp1" value=1><label for="sp1">自动分页</label>
<input type="radio" name="showpage" id="sp2" value=2 checked><label for="sp2">手动分页</label>
<%end if%>
注意:手动方式要在分页处输入:[NextPage] 字符</td>
</tr>
<tr valign="middle">
<td height="25" colspan="2" align="center" class="tdT">
<input type="checkbox" name="pass" id="pass1" value="true" <%if cint(userinfo(2))=3 then:if rs("pass")=true then: response.write("checked"):end if:else:response.write("disabled")end if%>><label for="pass1" style="cursor:hand;">通过审核</label>
<input name="modifyart" type="submit" id="modifyart" value="保存修改" class="but1" onMouseOver="this.className='but2'" onMouseOut="this.className='but1'">
</td>
</tr>
</form>
</table>
<%
rs.close
set rs=nothing
End Sub
'========================================================
'MaoSin CMS 1.1 Power by maosin.com
'Email: maosin@163.com , maosin@maosin.com
'Web: http://www.maosin.com http://www.maosin.net
'Copyright (C) 2006 maosin.com All Rights Reserved.
'========================================================
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -