<%
if session("dj")<>"1" then
   Response.Write "<BR><BR><BR><BR><center>权限不足，你没有此功能的管理权限"
   Response.end
end if
ON ERROR RESUME NEXT
%>

<%
if session("admin__user")="" then
  Response.Redirect "login.asp?id=8"
end if
%>

<script language="JavaScript">
<!--
//显示图层
function show_icon_cho(i)
{ 
var xx=document.FrontPage_Form1.select_icon.options[document.FrontPage_Form1.select_icon.selectedIndex].value;

// if(xx.indexOf("images")!=1) 
   if(xx.length>5) 
	 { 	
		i.style.display = "" 
		document.show_icon.src=xx;
        document.FrontPage_Form1.icon.value="<img src=\""+xx+"\" border=\"0\">";
	 }
	 else
	  { 
         i.style.display = "none";  
		 document.FrontPage_Form1.icon.value=xx;

	  }
}


// -->
</script>


<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type="text/css">
<!--
a:link       {text-decoration: none;  color: #000000 }
a:visited    {text-decoration: none; color: #000000 }
A:hover      {COLOR: green;  TEXT-DECORATION: underline}
body         {font-size: 9pt;color: #000000}
TD           {FONT-SIZE: 9pt; color: #000000;table-layout:fixed;word-break:break-all}
p            {FONT-SIZE: 9pt; color: #000000}
input        {FONT-SIZE: 9pt; color: #000000}
body         {margin-top: 0; margin-bottom: 0;margin-left:0;margin-right:0; color: #000000}
select       {FONT-SIZE: 9PT;}
option       {FONT-SIZE: 9pt;}
textarea     {FONT-SIZE: 9pt;}
-->
</STYLE>
</head>
<!--#include file = admin_conn.asp -->
<body bgcolor="#EFEFDE">

<div align="center">

<%
id=trim(request("id"))
lx=trim(request("lx"))

if lx="" then lx=1
if id<>"" then 
  sql = "select * from newsmb where id="&id
  Set rs = Server.CreateObject("ADODB.RecordSet")
  rs.Open sql,conn,1,1
  title=rs("title")
  midd=rs("top")+rs("mid")+rs("down")
  listmb=rs("listmb")
  listshu=rs("list")
  somb=rs("somb")
  tb=rs("tb")
  
  picw=rs("picw")
  pich=rs("pich")
  picx=rs("picx")
  picy=rs("picy")
  pictitle=rs("pictitle")
  pictitlecolor=rs("pictitlecolor")
  pictitlesize=rs("pictitlesize")
  lmname=rs("lmname")
  newshit=rs("newshit")
  newstime=rs("newstime")
  open=rs("openwindow")
  updown=rs("updown")
  icon=rs("icon")
  listtumb=rs("listtumb")

    rs.close:set rs=nothing
    conn.close:set conn=nothing
else
'属于新的情况时，则默认值
  picw=100
  pich=100
  picx=4
  picy=2
  pictitle=18
  pictitlecolor=FFFFFF
  pictitlesize=9
  listshu=10
  tb=38
  somb=""

end if
%>
<br><a href="admin_mb.asp">返回模版列表</a><br><br>

	
</div>
<div align="center">
	<!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="VBScript" Type="text/vbscript"><!--
function FrontPage_Form1_onsubmit()
  Set theForm = document.FrontPage_Form1

  If (theForm.title.value = "") Then
    MsgBox "请在 标题 域中输入值。", 0, "有效性验证错误"
    theForm.title.focus()
    FrontPage_Form1_onsubmit = False
    Exit Function
  End If

  If (Len(theForm.title.value) < 5) Then
    MsgBox "在 标题 域中，请至少输入 5 个字符。", 0, "有效性验证错误"
    theForm.title.focus()
    FrontPage_Form1_onsubmit = False
    Exit Function
  End If

  If (Len(theForm.title.value) > 10) Then
    MsgBox "在 标题 域中，请最多输入 10 个字符。", 0, "有效性验证错误"
    theForm.title.focus()
    FrontPage_Form1_onsubmit = False
    Exit Function
  End If

  If (theForm.mid.value = "") Then
    MsgBox "请在 模版 中部 域中输入值。", 0, "有效性验证错误"
    theForm.mid.focus()
    FrontPage_Form1_onsubmit = False
    Exit Function
  End If

  If (Len(theForm.mid.value) < 10) Then
    MsgBox "在 模版 中部 域中，请至少输入 10 个字符。", 0, "有效性验证错误"
    theForm.mid.focus()
    FrontPage_Form1_onsubmit = False
    Exit Function
  End If

  If (theForm.list.value = "") Then
    MsgBox "请在 列表代码 域中输入值。", 0, "有效性验证错误"
    theForm.list.focus()
    FrontPage_Form1_onsubmit = False
    Exit Function
  End If

  If (Len(theForm.list.value) < 1) Then
    MsgBox "在 列表代码 域中，请至少输入 1 个字符。", 0, "有效性验证错误"
    theForm.list.focus()
    FrontPage_Form1_onsubmit = False
    Exit Function
  End If
  FrontPage_Form1_onsubmit = True 
End Function
--></script><!--webbot BOT="GeneratedScript" endspan --><form method="POST" action="admin_mb_add_save.asp?lx=<%=lx%><%if id<>"" then response.write "&id="&id%>" name="FrontPage_Form1">
		<table border="1" width="800" id="table1" cellspacing="0" cellpadding="5" style="border-collapse: collapse" bordercolor="#C0C0C0">
			<tr>
				<td width="94" bgcolor="#FFFFFF">
				<p align="center">标题</td>
				<td bgcolor="#FFFFFF">
				&nbsp;<!--webbot bot="Validation" s-display-name="标题" b-value-required="TRUE" i-minimum-length="5" i-maximum-length="10" --><input type="text" name="title" size="58" maxlength="10" value="<%if id<>"" then response.write title%>" <%if lx=2 then response.write "readonly"%>></td>
			</tr>
			<tr>
				<td width="94">
				<p align="center">新闻显示页面<br>
				(news_view.asp)</p>
				<p align="center"><font color="#999999">可以使用<br>
				HTML代码</font></p>
				<p align="center"><font color="#999999">$$标题$$<br>
				$$副标题$$<br>
				$$时间$$<br>
				$$栏目名$$<br>
				$$内容$$<br>
				$$访问量$$<br>
				$$来源$$<br>
				$$作者$$<br>
				$$图片作者$$<br>
				$$相关$$<br>
				$$上下条$$<br>
				$$工具栏$$<br>
				$$评论$$<br>
				$$路径$$<br>
				$$NEWSID$$</font></td>
				<td>
				&nbsp;<!--webbot bot="Validation" s-display-name="模版 中部" b-value-required="TRUE" i-minimum-length="10" --><textarea rows="21" name="mid" cols="98" <%if lx=2 then response.write "readonly"%>>
<%
if id<>"" then 
response.write midd
else
%><div align="center">
<table border="0" width="737" id="table1" cellspacing="0" cellpadding="5">
<tr><td>
$$路径$$
</td></tr>
<tr>
<td><center><font size=5><b>$$标题$$</b></font></center></td>
</tr>
<tr>
<td><hr>
<CENTER> $$栏目名$$　加入时间：$$时间$$　来源：$$来源$$　访问量：$$访问量$$</CENTER>
</td>
</tr>
<tr>
<td>　</td>
</tr>
<tr>
<td>$$内容$$</td>
</tr>
</table>
</div>
<%end if%>
</textarea></td>
			</tr>


			<tr>
				<td width="94" bgcolor="#F5F5F5">
				<p align="center">更多新闻列表<br>
				(news_more.asp)</p>
				<p align="center"><font color="#999999">可以使用<br>
				HTML代码</font><p align="center">
				<font color="#999999">$$列表$$<br>
				$$栏目名$$<br>
				$$LMID$$<br>
				$$路径$$<br>
　</font></td>
				<td bgcolor="#F5F5F5">
				&nbsp;<!--webbot bot="Validation" s-display-name="列表代码" b-value-required="TRUE" i-minimum-length="1" --><textarea rows="18" name="list" cols="98"><%if id<>"" then 
                    response.write listmb
                 else%>$$列表$$<br><%=vbcrlf%>$$栏目名$$<br><%=vbcrlf%>$$LMID$$<%end  if%></textarea></td>
			</tr>

			<tr>
				<td width="94" align="center">
				图片模版<br>
				(js-pic.asp)<br>
				<br>
				<font color="#999999">可以使用<br>
				HTML代码<br>
				<br>
				$$图片列表$$<br>
				$$栏目名$$<br>
				$$LMID$$<br>
				$$路径$$</font></td>
				<td>
				&nbsp;<textarea rows="18" name="listtumb" cols="98"><%
                 if id<>"" then 
                    response.write listtumb
                 else
                %>$$图片列表$$<br><%=vbcrlf%>$$栏目名$$<br><%=vbcrlf%>$$LMID$$<%end if%>
				</textarea> </td>
			</tr>
			</table>

<table align=center border="1" cellpadding="3" width="800" id="table2" style="border-collapse: collapse" bordercolor="#C0C0C0">
		<tr>
			<td bgcolor="#F8F8F8" width="736" align="center" background="images/bj5.jpg" height="25" colspan="3">
			<p align="left"><a name="newspicxg"></a><font color="#FFFFFF"><b>图片相关设置 </b>(仅对 js-pic.asp 
			文件有效)</font></td>
		</tr>
		<tr>
			<td bgcolor="#F8F8F8" width="117" align="center" background="images/bj3.jpg" height="25" >
			图片宽度</td>
			<td bgcolor="#F8F8F8" width="406" background="images/bj3.jpg" height="25" >
			&nbsp;<input type="text" value="<%=picw%>" name="picw" size="6" maxlength="3" > </td>
			<td bgcolor="#F8F8F8" width="250" background="images/bj3.jpg" height="25" >　</td>
		</tr>
		<tr>
			<td bgcolor="#F8F8F8" width="117" align="center" background="images/bj3.jpg" height="25" >
			图片高度</td>
			<td bgcolor="#F8F8F8" width="406" background="images/bj3.jpg" height="25" >
			&nbsp;<input type="text" value="<%=pich%>" name="pich" size="6" maxlength="3" ></td>
			<td bgcolor="#F8F8F8" width="250" background="images/bj3.jpg" height="25" >　</td>
		</tr>
		<tr>
			<td bgcolor="#F8F8F8" width="117" align="center" background="images/bj3.jpg" height="25" >
			x横排显示数</td>
			<td bgcolor="#F8F8F8" width="406" background="images/bj3.jpg" height="25" >
			&nbsp;<input type="text" value='<%=picx%>' name="picx" size="6" maxlength="3" ></td>
			<td bgcolor="#F8F8F8" width="250" background="images/bj3.jpg" height="25" >　</td>
		</tr>
		<tr>
			<td bgcolor="#F8F8F8" width="117" align="center" background="images/bj3.jpg" height="25" >
			y竖排显示数</td>
			<td bgcolor="#F8F8F8" width="406" background="images/bj3.jpg" height="25" >
			&nbsp;<input type="text" value='<%=picy%>' name="picy" size="6" maxlength="3" ></td>
			<td bgcolor="#F8F8F8" width="250" background="images/bj3.jpg" height="25" >　</td>
		</tr>
		<tr>
			<td bgcolor="#F8F8F8" width="117" align="center" background="images/bj3.jpg" height="25" >
			图片标题显示字数</td>
			<td bgcolor="#F8F8F8" width="406" background="images/bj3.jpg" height="25" >
			&nbsp;<input type="text" value='<%=pictitle%>' name="pictitle" size="6" maxlength="3" > </td>
			<td bgcolor="#F8F8F8" width="250" background="images/bj3.jpg" height="25" >
			0 为不显示标题</td>
		</tr>
		<tr>
			<td bgcolor="#F8F8F8" width="117" align="center" background="images/bj3.jpg" height="25">
			图片标题颜色</td>
			<td bgcolor="#F8F8F8" width="406" background="images/bj3.jpg" height="25" >
			<!-- 选择式颜色 -->
                   &nbsp;<select size="1" name="pictitlecolor" >
				<option value="FFFFFF">请选择颜色</option>
                <%
					   '自选一些是经典教程中的配色方案:
				dim color_string,array_bg_color
				 color_string="000000、4C4C4C、BEC0C2、CECECE、D4D4D4、E6E8EB、F0F0F0、FFFFFF、E7F2FD、CBF3FB、8EC2F5、049FF1、4499EE、065FB9、04477C、70E1FF、BCF9FE、E1FFFF、F5FFF7、BD7803、EF9D01、FFBB1C、EED205、FF8C05、FDD283、FCFCBA、43A102、A2B700、C5DA01、036803、3F813F、55A255、74A474、712704、DA891E、F6BF1C、FFF3DD、FFF1D1、CC3300、FF9000、F1AEA8、DB3091、FFE4FF"
				 
				 '配色方案一，每种颜色后面要加顿号，然后用数组把它们读成数组。
                 '最后一个不要加顿号，否则会多一个空字符串。
					  
					   '读成数组
					   array_bg_color=split(replace(color_string," ",""),"、")

					   for bg_n=0 to ubound(array_bg_color)
					       bg_color=array_bg_color(bg_n)
						  %>

                        <OPTION <%if pictitlecolor=bg_color then response.write "selected"%> value="<%=bg_color%>" style="background-color:#<%=bg_color%>">bg=<%=bg_color%></OPTION>
						  <%
					   next
					 %>
					</select>
			</td>
			<td bgcolor="#F8F8F8" width="250" background="images/bj3.jpg" height="25" >
			比如 黑色 000000 白色 ffffff</td>
		</tr>
		<tr>
			<td bgcolor="#F8F8F8" width="117" align="center" background="images/bj3.jpg" height="25" >
			图片标题字号</td>
			<td bgcolor="#F8F8F8" width="406" background="images/bj3.jpg" height="25" >
			&nbsp;<input type="text" value='<%=pictitlesize%>' name="pictitlesize" size="6" maxlength="5" > 
			pt</td>
			<td bgcolor="#F8F8F8" width="250" background="images/bj3.jpg" height="25" >
			比如 9pt 10.5pt</td>
		</tr>
		</table>

			<table border="1" width="800" id="table1" cellspacing="0" cellpadding="2" style="border-collapse: collapse" bordercolor="#C0C0C0">

			<tr>
				<td background="images/bj5.jpg" height="25" colspan="2">
				<b><font color="#FFFFFF">新闻相关设置</font></b></td>
			</tr>

			<tr>
				<td width="118" background="images/bj3.jpg" height="25">
				<p align="center">更多新闻显示条数</td>
				<td background="images/bj3.jpg" height="25">
				每一页显示：<input type="text" name="listshu" size="4" maxlength="3" value="<%=listshu%>">条新闻。</td>
			</tr>
			<tr>
				<td width="118" bgcolor="#F5F5F5" background="images/bj3.jpg" height="25">
				<p align="center">标题字数</td>
				<td bgcolor="#F5F5F5" background="images/bj3.jpg" height="25">
				列表中每一个标题显示<input type="text" name="tb" size="4" value="<%=tb%>" maxlength="2">个字
				符。(一个汉字2个字符，一个英文数字1个字符)</td>
			</tr>
			<tr>
				<td width="118" background="images/bj3.jpg" height="25">
				<p align="center">栏目名称</td>
				<td background="images/bj3.jpg" height="25">
				<select size="1" name="lmname">
				<option value="0" <% if lmname="0" then response.write " selected "%>>不显示</option>
				<option value="1" <% if lmname="1" then response.write " selected "%>>显示</option>
				</select>　在列表中标题前面显示栏目名称</td>
			</tr>
			<tr>
				<td width="118" bgcolor="#F5F5F5" background="images/bj3.jpg" height="25">
				<p align="center">新闻日期</td>
				<td bgcolor="#F5F5F5" background="images/bj3.jpg" height="25">
				<select size="1" name="newstime">
				<option value="0" <% if newstime="0" then response.write " selected "%>>不显示</option>
				<option value="1" <% if newstime="1" then response.write " selected "%>>显示</option>
				</select>　在新闻后面显示新闻的添加日期</td>
			</tr>
			<tr>
				<td width="118" background="images/bj3.jpg" height="25">
				<p align="center">阅读数</td>
				<td background="images/bj3.jpg" height="25">
				<select size="1" name="newshit">
				<option value="0" <% if newshit="0" then response.write " selected "%>>不显示</option>
				<option value="1" <% if newshit="1" then response.write " selected "%>>显示</option>
				</select>　在新闻后面显示新闻的阅读数</td>
			</tr>
			<tr>
				<td width="118" bgcolor="#F5F5F5" background="images/bj3.jpg" height="25">
				<p align="center">新开窗口</td>
				<td bgcolor="#F5F5F5" background="images/bj3.jpg" height="25">
				<select size="1" name="open">
				<option value="1" <% if open="1" then response.write " selected "%>>新开窗口</option>
				<option value="0" <% if open="0" then response.write " selected "%>>本地窗口</option>
				</select>　在列表中查看新闻是否新开窗口</td>
			</tr>
			<tr>
				<td width="118" background="images/bj3.jpg" height="25">
				<p align="center">显示上下条</td>
				<td background="images/bj3.jpg" height="25">
				<select size="1" name="updown">
				<option value="0" <% if updown="0" then response.write " selected "%>>不显示</option>
				<option value="1" <% if updown="1" then response.write " selected "%>>显示</option>
				</select>　在新闻内容中是否显示同栏目的上一条和下一条新闻。</td>
			</tr>
			<tr>
				<td width="118" bgcolor="#F5F5F5" background="images/bj6.jpg" height="25">
				<p align="center">标题图标</td>
				<td bgcolor="#F5F5F5" background="images/bj6.jpg" height="25">
						
							
							<!-- 小图标 -->
							<select size="1" name="select_icon" id="select_icon" onchange="show_icon_cho(pic_div)">
							<option value="" <%if icon="" then response.write "selected"%>>&nbsp;(无图标)</option>
							<option value="·" <%if icon="·" then response.write "selected"%>>· </option>
							<option value="★" <%if icon="★" then response.write "selected"%>> ★</option>
							<option value="☆" <%if icon="☆" then response.write "selected"%>>☆</option>
							<option value="○" <%if icon="○" then response.write "selected"%>>○</option>
							<option value="●" <%if icon="●"  then response.write "selected"%>>●</option>
							<option value="◎" <%if icon="◎" then response.write "selected"%>>◎</option>
							<option value="◇" <%if icon="◇" then response.write "selected"%>>◇</option>
							<option value="◆" <%if icon="◆" then response.write "selected"%>>◆</option>
							<option value="□" <%if icon="□" then response.write "selected"%>>□</option>
							<option value="■" <%if icon="■" then response.write "selected"%>>■</option>
							<option value="△" <%if icon="△" then response.write "selected"%>>△</option>
							<option value="▲" <%if icon="▲" then response.write "selected"%>>▲</option>
							<%
							'取出目录中的图标
							  icon_path=Server.MapPath("images/icon")
				              'on error resume next
							  set						  fso=server.CreateObject("scripting.filesystemobject")  
                              set objFolder=fso.GetFolder(icon_path)   
                              set  objFiles=objFolder.Files    
                               for  each  objFile  in  objFiles    
                                    if right(objFile.name,3)="gif" or right(objFile.name,3)="jpg" or right(objFile.name,3)="bmp" then
                                    response.write "<option value='images/icon/"&trim(objFile.name)&"' "
									 
									  'if icon="<img src=""images/icon/"&trim(objFile.name)&""" border=""0"">" then response.write " selected "
									response.write ">"&trim(objFile.name)&"</option>"&vbcrlf
									end if 
                               next    
                              set  objFolder=nothing    
                              set  fso=nothing    
							
							'结束取出目录中的图标							
							%>

							</select><span id="pic_div" style="DISPLAY:none">
                              <img name="show_icon" src="" border="0">
							(小图标存放在目录：images/icon/)</span><br>
							<!-- 图形图标 -->


				<input type="text" name="icon" size="40" value="<%=Server.HtmLEncode(icon)%>"> 原图标：<%=icon%>
				支持HTML语句。显示在更多新闻时的标题前面。
				
				
				
				</td>
			</tr>
		</table>

		<p><input type="submit" value=" 保 存 " name="B1">　　　<input type="reset" value=" 重 置 " name="B2"></p>
	</form>
</div>
<BR><BR>
