softpost.asp
来自「小游戏网站演示www.4399.io 拥有4万条游戏数据」· ASP 代码 · 共 542 行 · 第 1/2 页
ASP
542 行
<!--#include file="config.asp"-->
<!--#include file="check.asp"-->
<!--#include file="head.inc"-->
<!--#include file="../inc/ubbcode.asp"-->
<!--#include file="../inc/cls_editor.asp"-->
<%
Call InnerLocation("发布软件")
If CInt(GroupSetting(11)) = 0 Then
ErrMsg = ErrMsg + "<li>对不起!您没有发布软件的权限,如需要该权限请联系管理员。</li>"
Founderr = True
End If
If CInt(Newasp.PostGrade) > CInt(Newasp.membergrade) Then
ErrMsg = ErrMsg & "<li>对不起!您没有发布软件的权限,如需要该权限请联系管理员。</li>"
FoundErr = True
End If
Dim Rs,SQL,i,softid
softid = Newasp.ChkNumeric(Request("softid"))
If ChannelID = 0 Then ChannelID = 2
Dim InstallDir_ChannelDir
InstallDir_ChannelDir = Trim(Newasp.InstallDir & Newasp.ChannelDir)
ubb.BasePath = InstallDir_ChannelDir
ubb.setUbbcode = Join(Newasp.setUserEditor,"|")
ubb.Keyword = Newasp.ContentKeyword
Dim Action:Action = LCase(Request("action"))
Select Case Trim(Action)
Case "save"
Call SaveNewSoft
Case "view"
Call SoftView
Case Else
Call showmain
End Select
If Founderr = True Then
Call Returnerr(ErrMsg)
End If
Sub showmain()
If Founderr = True Then Exit Sub
Dim Channel_Setting
Channel_Setting = Split(Newasp.Channel_Setting, "|||")
%>
<script language=JavaScript>
var _maxCount = '<%=CLng(GroupSetting(17))%>';
function ToRunsystem(addTitle) {
var revisedTitle;
var currentTitle;
currentTitle = document.myform.RunSystem.value;
revisedTitle = currentTitle+addTitle;
document.myform.RunSystem.value=revisedTitle;
document.myform.RunSystem.focus();
return;
}
function doSubmit(){
var form1 = document.myform;
if (form1.SoftName.value==""){
alert("软件名称不能为空!");
form1.SoftName.focus();
return false;
}
if (form1.ClassID.value==""){
alert("该一级分类已经有下属分类,请选择其下属分类!");
form1.ClassID.focus();
return false;
}
if (form1.ClassID.value=="0"){
alert("该分类是外部连接,不能添加内容!");
form1.ClassID.focus();
return false;
}
if (form1.RunSystem.value==""){
alert("软件运行环境不能为空!");
form1.RunSystem.focus();
return false;
}
if (form1.SoftType.value==""){
alert("软件类型不能为空!");
form1.SoftType.focus();
return false;
}
if (form1.SoftSize.value==""){
alert("软件大小还没有填写!");
form1.SoftSize.focus();
return false;
}
<%If CInt(GroupSetting(2)) = 1 Then%>
if (form1.codestr.value==""){
alert("请填写验证码!");
form1.codestr.focus();
return false;
}
<%End If%>
var strLen=0;
try{
strLen=GetContentLength();
}
catch(e){
strLen=form1.content.value.length;
}
if(strLen < 2){
alert("软件简介不能小于2个字符!");
return false;
}
if(strLen > _maxCount){
alert("软件简介不能超过"+_maxCount+"个字符!");
return false;
}
}
</script>
<div onkeydown="CtrlEnter()">
<table class="UserTableBorder" cellspacing="1" cellpadding="3" align="center" border="0">
<tr>
<th colspan="2">>>发布软件<<</th>
</tr>
<form action="softpost.asp" method="post" onsubmit="return doSubmit()" name="myform">
<input type="hidden" name="action" value="save"/>
<input type="hidden" name="ChannelID" value="<%=ChannelID%>"/>
<tr>
<td class="UserTableRow2" nowrap="nowrap" align="right" width="15%"><strong>所属分类</strong></td>
<td class="UserTableRow1" width="85%"><%
Dim sClassSelect
Response.Write "<select name=""ClassID"" id=""ClassID"">"
sClassSelect = Newasp.LoadSelectClass(ChannelID)
Response.Write sClassSelect
Response.Write "</select>"
%></td>
</tr>
<tr>
<td class="UserTableRow2" align="right"><strong>软件名称</strong></td>
<td class="UserTableRow1"><input id="SoftName" size="40" name="SoftName" type="text" /> <font color="#ff0000">*</font> <strong>软件版本</strong><input id="SoftVer" name="SoftVer" type="text" /></td>
</tr>
<tr>
<td class="UserTableRow2" align="right"><strong>相关软件</strong></td>
<td class="UserTableRow1"><input id="Related" size="60" name="Related" type="text" /> <font color="#ff0000">*</font></td>
</tr>
<tr>
<td class="UserTableRow2" align="right"><strong>运行环境</strong></td>
<td class="UserTableRow1"><input id="RunSystem" size="60" name="RunSystem" value="<%=Channel_Setting(1)%>" type="text" /><br />
<%
Dim RunSystem
RunSystem = Split(Channel_Setting(0), "|")
For i = 0 To UBound(RunSystem)
Response.Write "<a href='javascript:ToRunsystem(""" & Trim(RunSystem(i)) & """)'><u>" & Trim(RunSystem(i)) & "</u></a> "
If i = 10 Then Response.Write "<br>"
Next
%></td>
</tr>
<tr>
<td class="UserTableRow2" align="right"><strong>软件类型</strong></td>
<td class="UserTableRow1"><%
Dim SoftType
SoftType = Split(Channel_Setting(2), ",")
For i = 0 To UBound(SoftType)
Response.Write "<input id=""SoftType"" type=""radio"" name=""SoftType"" value=""" & Trim(SoftType(i)) & """ "
If i = 0 Then Response.Write " checked"
Response.Write "/>" & Trim(SoftType(i)) & " "
If i = 6 Then Response.Write "<br>"
Next
%></td>
</tr>
<tr>
<td class="UserTableRow2" align="right"><strong>软件大小</strong></td>
<td class="UserTableRow1"><input id="filesize" size="14" onkeyup="if(isNaN(this.value))this.value=''" name="SoftSize" value="0" type="text" /> <input type="radio" checked="checked" name="SizeUnit" value="KB" /> KB <input type="radio" name="SizeUnit" value="MB" /> MB <font color="#ff0000">!</font> <strong>解压密码</strong> <input maxlength="100" size="15" name="Decode" type="text" /> <font color="#808080">没有请留空</font></td>
</tr>
<tr>
<td class="UserTableRow2" align="right"><strong>软件性质</strong></td>
<td class="UserTableRow1"><%
Response.Write " <select id=""impower"" name=""impower"">"
Dim ImpowerStr
ImpowerStr = Split(Channel_Setting(3), ",")
For i = 0 To UBound(ImpowerStr)
Response.Write " <option value=""" & ImpowerStr(i) & """>" & ImpowerStr(i) & "</option>"
Next
Response.Write " </select> "
Response.Write " <select id=""Languages"" name=""Languages"">"
Response.Write " "
Dim LanguagesStr
LanguagesStr = Split(Channel_Setting(4), ",")
For i = 0 To UBound(LanguagesStr)
Response.Write " <option value=""" & LanguagesStr(i) & """>" & LanguagesStr(i) & "</option>"
Next
Response.Write " </select> "
%><select id="star5" name="star">
<option value="5">★★★★★</option>
<option value="4">★★★★</option>
<option value="3" selected="selected">★★★</option>
<option value="2">★★</option>
<option value="1">★</option>
</select> <strong><font color="#0000ff">注册软件的价格</font></strong> <input id="SoftPrice" size="10" onkeyup="if(isNaN(this.value))this.value=''" name="SoftPrice" value="0" type="text" /> 元</td>
</tr>
<tr>
<td class="UserTableRow2" align="right"><strong>联系方式</strong></td>
<td class="UserTableRow1"><input id="Contact" size="33" name="Contact" type="text" /> <strong>程序主页</strong> <input id="Homepages" size="30" name="Homepage" type="text" /></td>
</tr>
<tr>
<td class="usertablerow1" colspan="2"><%
'-- 编辑器设置
Dim oEditor,EditorCode
Set oEditor = New Editor_Cls
oEditor.UserMode = 1
oEditor.setEditMode = Newasp.setUserEditor(0)
oEditor.ChannelID = ChannelID
oEditor.Width = Newasp.setUserEditor(2)
oEditor.Height = Newasp.setUserEditor(3)
oEditor.BasePath = Newasp.InstallDir & Newasp.setAdminEditor(4)
oEditor.ToolbarSet = Newasp.setUserEditor(1)'Default,AdminMode,Simple,UserMode,Basic
oEditor.InstanceName = "content"
oEditor.Execute()
Set oEditor = Nothing
%></td>
</tr>
<tr>
<td class="UserTableRow2" align="right"><strong>预览图片</strong></td>
<td class="UserTableRow1"><input id="ImageUrl" size="60" name="SoftImage" type="text" /></td>
</tr>
<tr>
<td class="UserTableRow2" align="right"><strong>上传图片</strong></td>
<td class="UserTableRow1"><iframe name="frm_image2" id="frm_image2" src="upload.asp?ChannelID=<%=ChannelID%>" frameborder="0" width="100%" scrolling="no" height="22"></iframe></td>
</tr>
<tr>
<td class="UserTableRow2" align="right"><strong>下载地址</strong></td>
<td class="UserTableRow1"><input id="SiteName1" size="15" name="SiteName1" value="下载地址1" type="text" /> <input id="filePath" size="50" name="DownAddress1" type="text" /> <font color="#ff0000">*</font></td>
</tr>
<tr>
<td class="UserTableRow2" align="right"><strong>下载地址</strong></td>
<td class="UserTableRow1"><input id="SiteName2" size="15" name="SiteName2" value="下载地址2" type="text" /> <input id="filePath2" size="50" name="DownAddress2" type="text" /></td>
</tr>
<tr>
<td class="UserTableRow2" align="right"><strong>下载地址</strong></td>
<td class="UserTableRow1"><input id="SiteName3" size="15" name="SiteName3" value="下载地址3" type="text" /> <input id="filePath3" size="50" name="DownAddress3" type="text" /></td>
</tr>
<tr>
<td class="UserTableRow2" align="right"><strong>文件上传</strong></td>
<td class="UserTableRow1"><iframe name="frm_file2" id="frm_file2" src="upfile.asp?ChannelID=<%=ChannelID%>" frameborder="0" width="100%" scrolling="no" height="60"></iframe></td>
</tr><%
If CInt(GroupSetting(2)) = 1 Then
%>
<tr>
<td class="UserTableRow2" align="right"><strong>验证码</strong></td>
<td class="UserTableRow1"><input id="codestr" maxlength="5" size="5" name="codestr" type="text" /> <img style="cursor: pointer" height="10" alt="验证码,看不清楚?请点击刷新验证码" onclick="this.src='../inc/getcode.asp?t='+(new Date().getTime());" src="../inc/getcode.asp" /></td>
</tr>
<%
End If
%> <tr align="center">
<td class="UserTableRow2" colspan="4"><input class="Button" type="button" onclick="javascript:history.go(-1)" name="Submit4" value="返回上一页" /> <input class="Button" type="submit" name="Submit1" value="现在发布" /></td>
</tr>
</form>
</table>
</div>
<%
End Sub
Sub SaveNewSoft()
Dim TextContent,isAccept,AlphaSoftName
If CLng(UserToday(2)) => CLng(GroupSetting(14)) And CLng(GroupSetting(14))>0 Then
FoundErr = True
ErrMsg = ErrMsg + "<li>您每天最多只能发布<font color=red><b>" & GroupSetting(14) & "</b></font>个软件,如果还要继续发布请明天再来吧!</li>"
End If
If Newasp.CheckPost=False Then
ErrMsg = ErrMsg + Postmsg
FoundErr = True
Exit Sub
End If
If CInt(GroupSetting(2)) = 1 Then
If Not Newasp.CodeIsTrue() Then
ErrMsg = ErrMsg + "<meta http-equiv=refresh content=""2;URL="&Request.ServerVariables("HTTP_REFERER")&"""><li>验证码校验失败,请返回刷新页面再试。两秒后自动返回</li>"
Founderr = True
Exit Sub
End If
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?