📄 write.asp
字号:
<%@ Language=VBScript %>
<% option explicit %>
<!-- #include file="conn_forum.asp" -->
<!-- #include file="conn_member.asp" -->
<!-- #include file="inc_session.asp" -->
<%
dim uid
uid=GetSession()
dim iArea
dim iId
iArea=clng(Request("Area"))
iId =clng(Request("ParentId"))
dim sAreaName
dim sThemeTitle
dim bLock
dim rs
set rs=Server.CreateObject ("ADODB.Recordset")
rs.Open "SELECT areaName FROM tIndex WHERE areaID=" & iArea,connf,1 ,1
sAreaName=rs("areaName")
rs.Close
if iId<>-1 then
rs.Open "SELECT Theme,Lock FROM tcontent WHERE ThemeID=" & iId,connf,1 ,1
if rs.BOF and rs.EOF then
Response.Write "The theme has been deleted!"
Response.End
end if
sThemeTitle=rs("Theme")
bLock=rs("Lock")
rs.Close
else
bLock=0
end if
dim iLevel
iLevel=0
if uid<>"" then
rs.Open "SELECT * FROM tmember WHERE uid='" & uid & "'",connm,1 ,1
if not(rs.BOF and rs.EOF) then
iLevel=rs("level")
end if
rs.Close
end if
set rs=nothing
call closeconnf
call closeconnm
dim strDis
if iId=-1 then
strDis="写新文章"
else
strDis="回复主题"
end if
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>
<%
if iId=-1 then
Response.Write strDis & " - " & sAreaName
else
Response.Write strDis & " - " & sThemeTitle
end if
%>
</title>
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body bgcolor="#FFFFFF">
<SCRIPT language="JavaScript" src="../include/header.inc" type="text/javascript"></SCRIPT>
<center>
<table border="0" width="760" cellspacing="0">
<tr>
<td width="43%"><a href="index.asp"><img border="0" src="images/logo_forum.gif" alt="论坛首页"></a></td>
<td width="57%" align="left" valign="top">
<img src="images/f_root.gif" border="0" align="top"><a href="index.asp">论坛首页</a><br>
<img src="images/f_theme.gif" border="0" align="top"><a href="listtheme.asp?area=<%=iArea%>"><%=sAreaName%></a><br>
<% if iId<>-1 then %>
<img src="images/f_content.gif" border="0" align="top"><a href="viewtheme.asp?area=<%=iArea%>&id=<%=iId%>"><%=sThemeTitle%></a>
<% end if %>
</td>
</tr>
<tr>
<td width="43%"></td>
<td width="57%"> </td>
</tr>
</table>
<form method="POST" action="save.asp" name="frmWrite">
<table border="0" width="760" cellspacing="1" bgcolor="#F3F3F3">
<tr>
<td width="21%" bgcolor="#E0E0E0" height="25" align="right"><b><font COLOR="#000000"></font></b></td>
<td width="79%" bgcolor="#E0E0E0" height="25">
<b><font COLOR="#000000">
<%
if iId=-1 then
Response.Write "发表新主题在讨论区: " & sAreaName
else
Response.Write "回复主题:" & sThemeTitle
end if
%>
</font></b>
</td>
</tr>
<tr>
<td width="21%" bgcolor="#EAEAEA" height="25" align="right">用户名:</td>
<td width="79%" bgcolor="#FFFFFF" height="25">
<%
if uid="" then
Response.Write "<img src='images/question.gif'>"
else
Response.Write uid
end if
%>
<input type="hidden" name="Area" value="<%=iArea%>"> <input type="hidden" name="ParentId" value="<%=iId%>">
</td>
</tr>
<% if iId=-1 then %>
<tr>
<td width="21%" bgcolor="#EAEAEA" height="25" align="right">文章主题:</td>
<td width="79%" bgcolor="#FFFFFF" height="25"><input type="text" name="Title" size="67" style="border: 1 solid #000000"></td>
</tr>
<tr>
<td width="21%" bgcolor="#EAEAEA" height="25" align="right">标题符号:</td>
<td width="79%" bgcolor="#FFFFFF" height="25">
<table border="0" width="480" cellspacing="0" cellpadding="0">
<tr>
<td width="25%"><input type="radio" name="face" value="0" checked>(无)</td>
<td width="25%"><input type="radio" name="face" value="1"><img border="0" src="images/titleicon/f001.gif"></td>
<td width="25%"><input type="radio" name="face" value="2"><img border="0" src="images/titleicon/f002.gif"></td>
<td width="25%"><input type="radio" name="face" value="3"><img border="0" src="images/titleicon/f003.gif"></td>
</tr>
<tr>
<td width="25%"><input type="radio" name="face" value="4"><img border="0" src="images/titleicon/f004.gif"></td>
<td width="25%"><input type="radio" name="face" value="5"><img border="0" src="images/titleicon/f005.gif"></td>
<td width="25%"><input type="radio" name="face" value="6"><img border="0" src="images/titleicon/f006.gif"></td>
<td width="25%"><input type="radio" name="face" value="7"><img border="0" src="images/titleicon/f007.gif"></td>
</tr>
<tr>
<td width="25%"><input type="radio" name="face" value="8"><img border="0" src="images/titleicon/f008.gif"></td>
<td width="25%"><input type="radio" name="face" value="9"><img border="0" src="images/titleicon/f009.gif"></td>
<td width="25%"><input type="radio" name="face" value="10"><img border="0" src="images/titleicon/f010.gif"></td>
<td width="25%"><input type="radio" name="face" value="11"><img border="0" src="images/titleicon/f011.gif"></td>
</tr>
<tr>
<td width="25%"><input type="radio" name="face" value="12"><img border="0" src="images/titleicon/f012.gif"></td>
<td width="25%"><input type="radio" name="face" value="13"><img border="0" src="images/titleicon/f013.gif"></td>
<td width="25%"><input type="radio" name="face" value="14"><img border="0" src="images/titleicon/f014.gif"></td>
<td width="25%"><input type="radio" name="face" value="15"><img border="0" src="images/titleicon/f015.gif"></td>
</tr>
</table>
</td>
</tr>
<% end if %>
<tr>
<td width="21%" bgcolor="#EAEAEA" height="25" align="right">内容:</td>
<td width="79%" bgcolor="#FFFFFF" height="25">
<textarea rows="14" name="content" cols="66" style="border: 1 solid #000000"></textarea>
</td>
</tr>
<tr>
<td width="21%" bgcolor="#EAEAEA" height="85" align="right">插入表情符号:</td>
<td width="79%" bgcolor="#FFFFFF" height="85" valign="bottom">
<table border="0" width="490" bgcolor="#E0E0E0" cellspacing="1">
<%
dim x
dim y
dim iNum
iNum=0
for x=1 to 2
Response.Write "<tr>"
for y=1 to 16
iNum=iNum+1
%>
<td bgcolor="#FFFFFF"><a href="javascript:void(0);" onclick="InsertFace('<%=iNum%>')"> <img border="0" src="images/face/<%=iNum%>.gif" alt="<%=iNum%>" width="26" height="26"></a></td>
<%
Response.Write vbcrlf
next
Response.Write "</tr>" & vbcrlf
next
%>
</table>
</td>
</tr>
<tr>
<td width="21%" bgcolor="#EAEAEA" height="35" align="right">功能:</td>
<td width="79%" bgcolor="#FFFFFF" height="35">
<a href="javascript:void(0);" onclick="Insert('请输入链接的完整URL:','[LINK]','[/LINK]');">插入链接</a>
<% if iLevel>1 then %>
| <a href="javascript:void(0);" onclick="Insert('请输入图片的完整URL:','[IMG]','[/IMG]');">贴图片</a> |
<a href="javascript:void(0);" onclick="Insert('请输入媒体文件的完整URL:','[EMB]','[/EMB]');">插入媒体文件</a>
<% else %>
| <font color="#CCCCCC">贴图片</font> | <font color="#CCCCCC">插入媒体文件</font>
<% end if %>
<%
'if iLevel>5 then
' Response.Write "<a href='../upload/upload.asp' target='_blank'>上传图片</a>"
' else
' Response.Write "<font color='#CCCCCC'>上传图片</font>"
' end if
%>
</td>
</tr>
</table>
<p align="center">
<%
if bLock=1 then
Response.Write "<img src='images/notice.gif'> "
Response.Write "该主题不能回复。"
else
if uid="" then
Response.Write "<img src='images/notice.gif'> "
Response.Write "请先<a href='login.asp'>登录</a>或<a href='../reg/index.asp'>注册</a>成为新会员。 "
else
Response.Write "<input type='submit' value='发表咯!' name='CmdSubmit'>"
end if
end if
%>
<a href="#" onclick="history.back()">返 回</a>
</p>
</form>
</center>
<p>
</p>
<SCRIPT language="JavaScript" src="../include/buttom.inc" type="text/javascript"></SCRIPT>
</body>
</html>
<script language="javascript">
function Insert(sPrompt,sPrefix,sPostfix)
{
var sURL = prompt(sPrompt, "");
if (sURL)
{
var sTmp;
sTmp=sPrefix + sURL + sPostfix;
document.frmWrite.content.value+=sTmp;
document.frmWrite.content.focus();
}
return;
}
function InsertFace(inum)
{
var sTmp;
sTmp='[FACE]' + inum + '[/FACE]';
document.frmWrite.content.value+=sTmp;
document.frmWrite.content.focus();
return;
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -