📄 user_photo_code.asp
字号:
Response.Write " <td width='120' align='right' class='tdbg5'><strong>上传" & ChannelShortName & ":</strong></td>"
Response.Write " <td><iframe style='top:2px' id='UploadFiles' src='upload.asp?ChannelID=" & ChannelID & "&dialogtype=photos' frameborder=0 scrolling=no width='650' height='150'></iframe></td>"
Response.Write " </tr>"
'自定义字段
Dim rsField
Set rsField = Conn.Execute("select * from PE_Field where ChannelID=" & ChannelID & " or ChannelID=-3")
Do While Not rsField.EOF
IF rsField("ShowOnForm") = True then
Call WriteFieldHTML(rsField("FieldName"), rsField("Title"), rsField("Tips"), rsField("FieldType"), rsField("DefaultValue"), rsField("Options"), rsField("EnableNull"))
End If
rsField.MoveNext
Loop
Set rsField = Nothing
Response.Write " <tr class='tdbg' class='tdbg5'>"
Response.Write " <td width='120' align='right' class='tdbg5'><strong>" & ChannelShortName & "状态:</strong></td>"
Response.Write " <td><input name='Status' type='radio' id='Status' value='-1'>草稿 <input Name='Status' Type='Radio' Id='Status' Value='0' checked>投稿</td>"
Response.Write " </tr>"
Response.Write " </table>"
Response.Write " <p align='center'>"
Response.Write " <input name='Action' type='hidden' id='Action' value='SaveAdd'>"
Response.Write " <input name='ChannelID' type='hidden' id='ChannelID' value='" & ChannelID & "'>"
Response.Write " <input name='add' type='submit' id='Add' value=' 添 加 ' onClick=""document.myform.Action.value='SaveAdd';document.myform.target='_self';"" style='cursor:hand;'> "
Response.Write " <input name='Preview' type='submit' id='Preview' value=' 预 览 ' onClick=""document.myform.Action.value='Preview';document.myform.target='_blank';"" style='cursor:hand;'> "
Response.Write " <input name='Cancel' type='button' id='Cancel' value=' 取 消 ' onClick=""window.location.href='User_Photo.asp?ChannelID=" & ChannelID & "&Action=Manage';"" style='cursor:hand;'>"
Response.Write " </p><br>"
Response.Write "</form>"
End Sub
Sub Modify()
If FoundInArr(arrClass_Input, ChannelDir & "none", ",") = True Then
FoundErr = True
ErrMsg = ErrMsg & "<br><li>对不起!您没有在" & ChannelName & "添加" & ChannelShortName & "的权限!</li><br><br>"
Exit Sub
End If
Dim rsPhoto, sql, tmpAuthor, tmpCopyFrom, SpecialID
If PhotoID = "" Then
FoundErr = True
ErrMsg = ErrMsg & "<li>请指定要修改的" & ChannelShortName & "ID</li>"
Exit Sub
Else
PhotoID = PE_CLng(PhotoID)
End If
sql = "select * from PE_Photo where Inputer='" & UserName & "' and Deleted=" & PE_False & " and PhotoID=" & PhotoID & ""
Set rsPhoto = Server.CreateObject("ADODB.Recordset")
rsPhoto.Open sql, Conn, 1, 1
If rsPhoto.BOF And rsPhoto.EOF Then
FoundErr = True
ErrMsg = ErrMsg & "<li>找不到" & ChannelShortName & "</li>"
Else
If rsPhoto("Status") > 0 And EnableModifyDelete = 0 Then
FoundErr = True
ErrMsg = ErrMsg & "<li>" & ChannelShortName & "已经被审核通过或在审核中,您不能再进行修改!</li>"
End If
End If
If FoundErr = True Then
rsPhoto.Close
Set rsPhoto = Nothing
Exit Sub
End If
SpecialID = PE_CLng(Conn.Execute("select top 1 SpecialID from PE_InfoS where ModuleType=3 and ItemID=" & PhotoID & "")(0))
If Right(rsPhoto("Author"), 1) = "|" Then
tmpAuthor = Left(rsPhoto("Author"), Len(rsPhoto("Author")) - 1)
Else
tmpAuthor = rsPhoto("Author")
End If
If Right(rsPhoto("CopyFrom"), 1) = "|" Then
tmpCopyFrom = Left(rsPhoto("CopyFrom"), Len(rsPhoto("CopyFrom")) - 1)
Else
tmpCopyFrom = rsPhoto("CopyFrom")
End If
Call ShowJS_Photo
Response.Write "<form method='POST' name='myform' onSubmit='return CheckForm();' action='User_Photo.asp'>"
Response.Write " <table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>"
Response.Write " <tr class='title'>"
Response.Write " <td height='22' align='center' colspan='2'><b>修改" & ChannelShortName & "</b></td>"
Response.Write " </tr>"
Response.Write " <tr class='tdbg'>"
Response.Write " <td width='120' align='right' class='tdbg5'><strong>所属栏目:</strong></td>"
Response.Write " <td>"
Response.Write " <select name='ClassID'>" & User_GetClass_Option(4, rsPhoto("ClassID")) & "</select>"
Response.Write " </td>"
Response.Write " </tr>"
Response.Write " <tr class='tdbg'>"
Response.Write " <td width='120' align='right' class='tdbg5'><strong>所属专题:</strong></td>"
Response.Write " <td><select name='SpecialID'><option value='0'>不属于任何专题</option>" & GetSpecial_Option(SpecialID) & "</select></td>"
Response.Write " </tr>"
Response.Write " <tr class='tdbg'>"
Response.Write " <td width='120' align='right' class='tdbg5'><strong>" & ChannelShortName & "名称:</strong></td>"
Response.Write " <td><input name='PhotoName' type='text' value='" & rsPhoto("PhotoName") & "' size='50' maxlength='255'><font color='#FF0000'>*</font></td>"
Response.Write " </tr>"
Response.Write " <tr class='tdbg'>"
Response.Write " <td width='120' align='right' class='tdbg5'><strong>关键字:</strong></td>"
Response.Write " <td>"
Response.Write " <input name='Keyword' type='text' id='Keyword' value='" & Mid(rsPhoto("Keyword"), 2, Len(rsPhoto("Keyword")) - 2) & "' size='50' maxlength='255'> <font color='#FF0000'>*</font> " & GetKeywordList("User", ChannelID)
Response.Write " <br><font color='#0000FF'>用来查找相关" & ChannelShortName & ",可输入多个关键字,中间用<font color='#FF0000'>“|”</font>隔开。不能出现"'&?;:()等字符。</font>"
Response.Write " </td>"
Response.Write " </tr>"
Response.Write " <tr class='tdbg'>"
Response.Write " <td width='120' align='right' class='tdbg5'><strong>" & ChannelShortName & "作者:</strong></td>"
Response.Write " <td>"
Response.Write " <input name='Author' type='text' id='Author' value='" & tmpAuthor & "' size='50' maxlength='30'>" & GetAuthorList("User", ChannelID, UserName)
Response.Write " </td>"
Response.Write " </tr>"
Response.Write " <tr class='tdbg'>"
Response.Write " <td width='120' align='right' class='tdbg5'><strong>" & ChannelShortName & "来源:</strong></td>"
Response.Write " <td>"
Response.Write " <input name='CopyFrom' type='text' id='CopyFrom' value='" & tmpCopyFrom & "' size='50' maxlength='100'>" & GetCopyFromList("User", ChannelID)
Response.Write " </td>"
Response.Write " </tr>"
Response.Write " <tr class='tdbg'>"
Response.Write " <td width='120' align='right' class='tdbg5' valign='middle'><strong>" & ChannelShortName & "简介:</strong></td>"
Response.Write " <td>"
Response.Write " <textarea name='PhotoIntro' cols='67' rows='5' id='PhotoIntro' style='display:none'>" & Server.HTMLEncode(FilterJS(rsPhoto("PhotoIntro"))) & "</textarea>"
Response.Write " <iframe ID='editor' src='../editor.asp?ChannelID=" & ChannelID & "&ShowType=3&tContentid=PhotoIntro' frameborder='1' scrolling='no' width='650' height='200' ></iframe>"
Response.Write " </td>"
Response.Write " </tr>"
Response.Write " <tr class='tdbg'>"
Response.Write " <td width='120' align='right' class='tdbg5'><strong>缩略图:</strong></td>"
Response.Write " <td>"
Response.Write " <input name='PhotoThumb' type='text' id='PhotoThumb' size='80' maxlength='200' value='" & rsPhoto("PhotoThumb") & "'>"
Response.Write " </td>"
Response.Write " </tr>"
Response.Write " <tr class='tdbg'>"
Response.Write " <td width='120' align='right' class='tdbg5'><strong>" & ChannelShortName & "地址:</strong></td>"
Response.Write " <td>"
Response.Write " <table width='100%' border='0' cellpadding='0' cellspacing='0'>"
Response.Write " <tr>"
Response.Write " <td width='410'>"
Response.Write " <input type='hidden' name='PhotoUrls' value=''>"
Response.Write " <select name='PhotoUrl' style='width:400;height:100' size='2' ondblclick='return ModifyUrl();'>"
Dim PhotoUrls, arrPhotoUrls, iTemp
PhotoUrls = rsPhoto("PhotoUrl")
If InStr(PhotoUrls, "$$$") > 1 Then
arrPhotoUrls = Split(PhotoUrls, "$$$")
For iTemp = 0 To UBound(arrPhotoUrls)
Response.Write "<option value='" & arrPhotoUrls(iTemp) & "'>" & arrPhotoUrls(iTemp) & "</option>"
Next
Else
Response.Write "<option value='" & PhotoUrls & "'>" & PhotoUrls & "</option>"
End If
Response.Write " </select>"
Response.Write " </td>"
Response.Write " <td>"
Response.Write " <input type='button' name='addurl' value='添加外部地址' onclick='AddUrl();'><br>"
Response.Write " <input type='button' name='modifyurl' value='修改当前地址' onclick='ModifyUrl();'><br>"
Response.Write " <input type='button' name='delurl' value='删除当前地址' onclick='DelUrl();'>"
Response.Write " </td>"
Response.Write " </tr>"
Response.Write " </table>"
Response.Write " </td>"
Response.Write " </tr>"
Response.Write " <tr class='tdbg' class='tdbg5'>"
Response.Write " <td width='120' align='right' class='tdbg5'><strong>上传" & ChannelShortName & ":</strong></td>"
Response.Write " <td><iframe style='top:2px' id='UploadFiles' src='upload.asp?ChannelID=" & ChannelID & "&dialogtype=photos' frameborder=0 scrolling=no width='650' height='150'></iframe></td>"
Response.Write " </tr>"
'自定义字段
Dim rsField
Set rsField = Conn.Execute("select * from PE_Field where ChannelID=" & ChannelID & " or ChannelID=-3")
Do While Not rsField.EOF
IF rsField("ShowOnForm") = True then
Call WriteFieldHTML(rsField("FieldName"), rsField("Title"), rsField("Tips"), rsField("FieldType"), rsPhoto(Trim(rsField("FieldName"))), rsField("Options"), rsField("EnableNull"))
End If
rsField.MoveNext
Loop
Set rsField = Nothing
Response.Write " <tr class='tdbg'>"
Response.Write " <td width='120' align='right' class='tdbg5'>" & ChannelShortName & "状态:</td>"
Response.Write " <td>"
If rsPhoto("Status") <= 0 Then
Response.Write "<Input Name='Status' Type='radio' Id='Status' Value='-1'"
If rsPhoto("Status") = -1 Then
Response.Write " checked"
End If
Response.Write "> 草稿 "
Response.Write "<Input Name='Status' Type='radio' Id='Status' Value='0'"
If rsPhoto("Status") = 0 Then
Response.Write "checked"
End If
Response.Write "> 投稿"
Else
If rsPhoto("Status") < 3 Then
Response.Write "审核中"
Else
Response.Write "已经发布"
End If
End If
Response.Write " </td>"
Response.Write " </tr>"
Response.Write " </table>"
Response.Write " <p align='center'>"
Response.Write " <input name='Action' type='hidden' id='Action' value='SaveModify'>"
Response.Write " <input name='PhotoID' type='hidden' id='PhotoID' value='" & rsPhoto("PhotoID") & "'>"
Response.Write " <input name='ChannelID' type='hidden' id='ChannelID' value='" & ChannelID & "'>"
Response.Write " <input name='Save' type='submit' value='保存修改结果' style='cursor:hand;'> "
Response.Write " <input name='Cancel' type='button' id='Cancel' value=' 取 消 ' onClick=""window.location.href='User_Photo.asp?ChannelID=" & ChannelID & "&Action=Manage';"" style='cursor:hand;'>"
Response.Write " </p><br>"
Response.Write "</form>"
rsPhoto.Close
Set rsPhoto = Nothing
End Sub
Sub WriteFieldHTML(FieldName, Title, Tips, FieldType, strValue, Options, EnableNull)
Dim strEnableNull
If EnableNull = False Then
strEnableNull = " <font color='#FF0000'>*</font>"
End If
Response.Write "<tr class='tdbg'><td width='120' align='right' class='tdbg5'><b>" & Title & ":</b></td><td colspan='5'>"
Select Case FieldType
Case 1 '单行文本框
Response.Write "<input type='text' name='" & FieldName & "' size='80' maxlength='255' value='" & strValue & "'>" & strEnableNull
Case 2 '多行文本框
Response.Write "<textarea name='" & FieldName & "' cols='80' rows='10'>" & strValue & "</textarea>" & strEnableNull
Case 3 '下拉列表
Response.Write "<select name='" & FieldName & "'>"
Dim arrOptions, i
arrOptions = Split(Options, vbCrLf)
For i = 0 To UBound(arrOptions)
Response.Write "<option value='" & arrOptions(i) & "'"
If arrOptions(i) = strValue Then Response.Write " selected"
Response.Write ">" & arrOptions(i) & "</option>"
Next
Response.Write "</select>" & strEnableNull
Case 4, 5 '图片和文件
If strValue = "" Then
Response.Write "<input type='text' name='" & FieldName & "' size='40' maxlength='255' value='http://'>" & strEnableNull
Else
Response.Write "<input type='text' name='" & FieldName & "' size='40' maxlength='255' value='" & strValue & "'>" & strEnableNull
End If
Case 6 '日期
If strValue = "" Then
Response.Write "<input type='text' name='" & FieldName & "' size='20' maxlength='20' value='" & Now() & "'>" & strEnableNull
Else
Response.Write "<input type='text' name='" & FieldName & "' size='20' maxlength='20' value='" & strValue & "'>" & strEnableNull
End If
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -