<html>
<head>
<META content=ywnt,云网互动影视管理系统 name=keywords>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>云网互动影视6.0--模版管理</title>
<LINK href="css/css.css" type=text/css rel=stylesheet>
</head>
<BODY leftMargin=0 topMargin=0 scroll=yes MARGINHEIGHT="0" MARGINWIDTH="0">
<script language=JavaScript src='../Editor/language/schi/editor_lang.js'></script>
<script language=JavaScript src='../Editor/editor.js'></script>
<script language="JavaScript" type="text/javascript" src="YWNT_TMS_inc/YWNT_TMS_Common.js"></script>
<!--#include file="../Conn.asp" -->
<!--#include file="YWNT_TMS_inc/YWNT_TMS_Function.asp" -->
<%
'===================================================================================================================
'软件名称：云网影视管理系统
'Copyright (C) 2002-2007 ywnt.net  All rights reserved.
'产品咨询QQ：489234,2813712
'程序版权：云网互动科技有限公司
'程序开发：云网互动科技有限公司
'官方网站：http://www.ywnt.net 
'郑重声明:
'    1、免费版本请在程序首页保留版权信息，并做上本站LOGO友情连接,商业版本无此要求;
'    2、任何个人或组织不得在授权允许的情况下删除、修改、拷贝本软件及其他副本上一切关于版权的信息；
'    3、云网互动科技有限公司保留此软件的法律追究权利
'===================================================================================================================
Call CheckLogin("Template")
sub EditSave()
		Set Rs=Server.CreateObject(YWNT_TMS_RS)
		sql="select * from YWNT_TMS_Template where ID="&NoSqlHack(Request.Form("ID"))
		Rs.open sql,Conn,1,3
		RS("TemplateName")=NoSqlHack(Request.Form("TemplateName"))
		RS("StyleID")=NoSqlHack(Request.Form("StyleID"))
		RS("CssID")=NoSqlHack(Request.Form("CssID"))
		RS("TemplateType")=NoSqlHack(Request.Form("TemplateType"))
		RS("Template")=Request.Form("Content")
		Rs.Update
		Rs.Close
		Set Rs = Nothing
		Call AddLog("修改模版"&Request.Form("TemplateName"),6)
		call Admin_ShowErr("<li>修改模版成功</li>","Admin_Template.asp",1)
end sub
sub AddSave()
		if request.Form("TemplateType")=1 or request.Form("TemplateType")=6 or request.Form("TemplateType")=7 or request.Form("TemplateType")=8 then
		if CheckTemplate(NoSqlHack(request.Form("TemplateType")),NoSqlHack(Request.Form("StyleID")))>0 then 
		call Admin_ShowErr("<li>每个风格只能有一个首页模版 搜索模版 免费试看模版 全部影片模版！</li>","javascript:history.go(-1);",0)
		end if
		end if
		Set Rs=Server.CreateObject(YWNT_TMS_RS)
		sql="select * from YWNT_TMS_Template"
		Rs.open sql,Conn,1,3
		Rs.addnew
		RS("TemplateName")=NoSqlHack(Request.Form("TemplateName"))
		RS("StyleID")=NoSqlHack(Request.Form("StyleID"))
		RS("CssID")=NoSqlHack(Request.Form("CssID"))
		RS("TemplateType")=NoSqlHack(Request.Form("TemplateType"))
		RS("Template")=Request.Form("Content")
		RS("TemplateDate")=date()
		Rs.Update
		Rs.Close
		Set Rs = Nothing
		Call AddLog("添加模版"&Request.Form("TemplateName"),6)
		call Admin_ShowErr("<li>添加模版成功</li>","Admin_Template.asp",1)
end sub
sub Del()
	conn.execute "delete from YWNT_TMS_Template WHERE ID = "&NoSqlHack(Request("ID"))&""
	Call AddLog("删除模版",6)
	call Admin_ShowErr("<li>删除模版成功！</li>","Admin_Template.asp",1)
end sub%>
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
  <tbody>
    <tr>
      <td class=xingmu>模版管理</td>
    </tr>
    <tr>
      <td class="hback"><a href="Admin_Template.asp?Action=Add">添加模版(可视模式)</a> |  <a href="Admin_Txt_Template.asp?Action=Add">添加模版(文本模式)</a> | <a href="Admin_Css.asp">CSS管理</a> | <a href="Admin_Css.asp?Action=Add">CSS添加</a> | <a href="Admin_labeling.asp">自由标签管理</a> | <a href="Admin_labeling.asp?Action=Add">添加自由标签(可视模式)</a> | <a href="Admin_Txt_Template.asp?Action=Lebelingadd">添加自由标签(文本模式)</a></td>
    </tr>
  </tbody>
</table>
<% Action=Trim(request("Action"))
Select Case Action
Case "Add"
	call Add()
Case "AddSave"
	call AddSave()
Case "Edit"
		Set Rs=Server.CreateObject(YWNT_TMS_RS)
		sql="select * from YWNT_TMS_Template where ID="&NoSqlHack(Request.QueryString("ID"))
		Rs.open sql,Conn,1,1
		YWNT_TMS_ID=RS("ID")
		YWNT_TMS_TemplateName=RS("TemplateName")
		YWNT_TMS_StyleID=RS("StyleID")
		YWNT_TMS_CssID=RS("CssID")
		YWNT_TMS_TemplateType=RS("TemplateType")
		YWNT_TMS_Template=RS("Template")
		RS.close   
      	set RS=nothing
	call Edit()
Case "EditSave"
	call EditSave()
Case "Del"
	call Del()
Case else
	call List()
End Select
sub List()%>
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
  <tbody>
    <tr>
      <td class=xingmu>风格分类</td>
    </tr>
    <tr>
      <td class="hback"><%Response.Write "<A href=""Admin_Template.asp"">全部风格</a> | "
Set Rs = server.CreateObject(YWNT_TMS_RS)
sql="Select ID,StyleName from YWNT_TMS_Style Order by ID desc"
Rs.open sql,Conn,1,1
if RS.eof then
Response.Write"目前还没有风格请先添加风格"
else
do while not RS.eof
Response.Write "<A href=""Admin_Template.asp?StyleID="&RS("ID")&""">"&RS("StyleName")&"</a>"
RS.movenext
IF not RS.eof Then
Response.Write " | "
end if   
loop
end if
RS.close     
set RS=nothing %></td>
    </tr>
  </tbody>
</table>
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
  <tbody>
    <tr>
      <td width="5%" align="center" class=xingmu>ID</td>
      <td align="center" class=xingmu>模版名称</td>
      <td width="12%" align="center" class=xingmu>所属风格</td>
      <td width="12%" align="center" class=xingmu>模版CSS样式</td>
      <td width="12%" align="center" class=xingmu>模版类型</td>
      <td width="10%" align="center" class=xingmu>添加时间</td>
	  <td width="20%" align="center" class=xingmu>操作</td>
    </tr>
	<%Set Rs = server.CreateObject(YWNT_TMS_RS)
sql="Select ID,TemplateName,StyleID,CssID,TemplateType,TemplateDate from YWNT_TMS_Template"
Select Case Request.QueryString("StyleID")
Case ""
sql=sql&" Order by ID desc"
Case else
sql=sql&" where StyleID="&NoSqlHack(Request.QueryString("StyleID"))&" Order by ID desc"
end Select
Rs.open sql,Conn,1,1
if RS.eof then
Response.Write"<TR  class=""hback""><TD colspan=""7"" class=""hback"" height=""40"">没有记录。</TD></TR>"
else
do while not RS.eof%>
    <tr>
      <td height=32 align="center" class="hback"><%=RS("ID")%></td>
      <td height=32 class="hback"><%=RS("TemplateName")%></td>
      <td height=32 align="center" class="hback"><%=StyleWrite(RS("StyleID"))%></td>
      <td height=32 align="center" class="hback"><%=CssWrite(RS("CssID"))%></td>
      <td height=32 align="center" class="hback"><%=TemplateType(RS("TemplateType"))%></td>
      <td align="center" class="hback"><%=RS("TemplateDate")%></td>
	  <td align="center" class="hback"><a href="Admin_Template.asp?Action=Edit&ID=<%=RS("ID")%>">可视编辑</A>｜<a href="Admin_Txt_Template.asp?Action=Edit&ID=<%=RS("ID")%>">文本编辑</A>｜<A onClick="{if(confirm('确定要删除吗?\n如果栏目下有调用此模版那就需要重新设定该栏目模版!!')){return true;}return false;}" href="Admin_Template.asp?Action=Del&ID=<%=RS("ID")%>">删除</A></td>
    </tr>
<%RS.movenext     
loop
end if
RS.close     
set RS=nothing %>
  </tbody>
</table>
<%end sub
sub Add()%>
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
  <tbody>
    <tr>
      <td colspan="2" class=xingmu>添加模版</td>
    </tr>
  <form name="form" action="Admin_Template.asp?Action=AddSave" method="post">
    <tr>
      <td height=32 align="right" class="hback">模版名称：</td>
      <td height=7 class="hback"><input name="TemplateName" type="text" id="TemplateName" size="40"></td>
    </tr>
    <tr>
      <td height=32 align="right" class="hback">所属风格：</td>
      <td height=7 class="hback"><% call StyleSelect("StyleID","") %></td>
    </tr>
	 <tr>
      <td height=32 align="right" class="hback">所属CSS：</td>
      <td height=7 class="hback"><% call CssSelect("CssID","") %></td>
    </tr>
    <tr>
      <td width="21%" height=32 align="right" class="hback">模版类型：</td>
      <td height=7 class="hback"><select name="TemplateType" id="TemplateType">
        <option value="1">首页模版</option>
        <option value="2">栏目模版</option>
        <option value="3">列表模版</option>
        <option value="4">内容模版</option>
        <option value="5">专题模版</option>
		<option value="6">搜索模版</option>
		<option value="7">免费试看模版</option>
		<option value="8">全部影片模版</option>
            </select></td>
    </tr>
    <tr align="center">
      <td height=32 colspan="2" class="hback">
	  <script>
	  	  function insert(leb)
	{
		oUtil.obj.insertHTML(leb);
	}
		var oEdit1 = new InnovaEditor("oEdit1");
		oEdit1.arrStyle = [["BODY",false,"","font:12px verdana,arial,sans-serif;"]];
		oEdit1.width="100%";
		oEdit1.height=450;
		oEdit1.arrCustomButtons = [["btntype","modelessDialogShow('Labeling/TypeLeb.asp',650,600)","栏目标签","type.gif"],
								["btnclass","modelessDialogShow('Labeling/ClassLeb.asp',600,470)","列表标签","class.gif"],
								["btnwithleb","modelessDialogShow('Labeling/Withleb.asp',600,390)","更新/排行标签","Withleb.gif"],
								["btnmovie","modelessDialogShow('Labeling/convert.htm?Movieleb.asp',650,570)","内容标签","movie.gif"],
								["btnsearch","modelessDialogShow('Labeling/SearchLeb.asp',650,470)","搜索标签","search.gif"],
								["btnAllLeb","modelessDialogShow('Labeling/AllLeb.asp',650,260)","全部影片标签","AllLeb.gif"],
								["btnNavLeb","modelessDialogShow('Labeling/NavLeb.asp',650,330)","导航标签","NavLeb.gif"],
								["btnNavigation","modelessDialogShow('Labeling/LocationLeb.asp',350,155)","位置导航标签","Navigation.gif"],								
								["btnFeature","modelessDialogShow('Labeling/Feature.asp',650,410)","专题导航标签","Feature.gif"],
								["btnFlashSlide","modelessDialogShow('Labeling/FlashSlide.asp',650,420)","FLASH幻灯标签","FlashSlide.gif"],
								["btnNotice","modelessDialogShow('Labeling/NoticeLeb.asp',650,320)","公告标签","Notice.gif"],
								["btnlogin","modelessDialogShow('Labeling/UsersLogin.asp',680,350)","登陆标签","login.gif"],
								["btnsearchLeb","modelessDialogShow('Labeling/SearchInputLeb.asp',680,330)","搜索框标签","searchLeb.gif"],
								["btnLabeling","modelessDialogShow('Labeling/convert.htm?ZyLeb.asp',650,330)","自由标签","Labeling.gif"],
								["btnvote","modelessDialogShow('Labeling/convert.htm?VoteLeb.asp',400,330)","投票标签","vote.gif"],
								["btnad","modelessDialogShow('Labeling/convert.htm?AdLeb.asp',400,330)","广告标签","Ad.gif"],
								["btnlinkLeb","modelessDialogShow('Labeling/LinkLeb.asp',650,225)","友情连接标签","linkLeb.gif"],
								["btnTvLeb","modelessDialogShow('Labeling/TvLeb.asp',500,190)","直播导航标签","TvLeb.gif"],
								["btnhelp","modelessDialogShow('Labeling/HelpLeb.asp',650,320)","帮助标签","help.gif"],
								["btnhome","insert('{$SetHome}')","设为首页标签","home.gif"],
								["btnCollection","insert('{$SetCollection}')","加入收藏夹标签","Collection.gif"],
								["btnLogoLeb","modelessDialogShow('Labeling/LogoLeb.asp',500,190)","网站Logo标签","LogoLeb.gif"],
								["btnsetupdir","insert('{$SetupDir}')","网站安装路径标签","setupdir.gif"],
								["btnWebUrl","insert('{$WebUrlW}')","网站URL标签","WebUrl.gif"],
								["btnindex","insert('{$WebNameW}')","网站名称标签","index.gif"]]
		oEdit1.features=["btntype","btnclass","btnwithleb","btnmovie","btnsearch","btnAllLeb","|","btnLogoLeb","btnNavLeb","btnNavigation","btnhome","btnCollection","|","btnLabeling","|","btnFlashSlide","btnNotice","btnlogin","btnsearchLeb","btnlinkLeb","btnTvLeb","btnvote","btnad","btnhelp","btnFeature","|","btnsetupdir","btnWebUrl","btnindex","BRK",
			"Search","Cut","Copy","Paste","PasteText","|","Undo","Redo","|",
			"ForeColor","BackColor","|","Bookmark","Hyperlink","Image","Flash","Media","|","Table","Guidelines","Absolute",
			"|","Characters","Line","Form","ClearAll","Clean","FullScreen","Preview","XHTMLSource","BRK",
			"StyleAndFormatting","TextFormatting","ListFormatting","BoxFormatting",
			"ParagraphFormatting","CssText","Styles","|",
			"Paragraph","FontName","FontSize","|",
			"Bold","Italic",
			"Underline","Strikethrough","|","Superscript","Subscript","|",
			"JustifyLeft","JustifyCenter","JustifyRight","JustifyFull","|","Numbering","Bullets","|","Indent","Outdent"];
		oEdit1.cmdAssetManager="modalDialogShow('<%=GetConfig("WebiInstallDir")&GetConfig("AdminDir")%>Dialog/SelectPic.asp?CurrPath=<% = CurrPath %>',640,410)";
		oEdit1.btnFlash=true;
		oEdit1.btnMedia=true;
		oEdit1.RENDER("");
	</script>
	<input type="hidden" name="Content"  id="Content" value=""></td>
    </tr>
    <tr>
      <td height=32 colspan="2" align="center" class="hback"><input type="button" name="Submit" value="添 加" onClick="SubmitTemplate();"></td>
    </tr>
  </form>
  </tbody>
</table>
<%end sub
sub Edit()%>
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
  <tbody>
    <tr>
      <td colspan="2" class=xingmu>修改模版</td>
    </tr>
  <form name="form" action="Admin_Template.asp?Action=EditSave" method="post">
    <tr>
      <td height=32 align="right" class="hback">模版名称：</td>
      <td height=7 class="hback"><input name="TemplateName" type="text" id="TemplateName" value="<%=YWNT_TMS_TemplateName%>" size="40"></td>
    </tr>
    <tr>
      <td height=32 align="right" class="hback">所属风格：</td>
      <td height=7 class="hback"><% call StyleSelect("StyleID",YWNT_TMS_StyleID) %></td>
    </tr>
    <tr>
      <td height=32 align="right" class="hback">所属CSS：</td>
      <td height=7 class="hback"><% call CssSelect("CssID",YWNT_TMS_CssID) %></td>
    </tr>
    <tr>
      <td width="21%" height=32 align="right" class="hback">模版类型：</td>
      <td height=7 class="hback"><select name="TemplateType" id="TemplateType">
        <option value="1" <%if YWNT_TMS_TemplateType=1 then Response.Write("selected")%>>首页模版</option>
        <option value="2" <%if YWNT_TMS_TemplateType=2 then Response.Write("selected")%>>栏目模版</option>
        <option value="3" <%if YWNT_TMS_TemplateType=3 then Response.Write("selected")%>>列表模版</option>
        <option value="4" <%if YWNT_TMS_TemplateType=4 then Response.Write("selected")%>>内容模版</option>
        <option value="5" <%if YWNT_TMS_TemplateType=5 then Response.Write("selected")%>>专题模版</option>
		<option value="6" <%if YWNT_TMS_TemplateType=6 then Response.Write("selected")%>>搜索模版</option>
        <option value="7" <%if YWNT_TMS_TemplateType=7 then Response.Write("selected")%>>免费试看模版</option>
		<option value="8" <%if YWNT_TMS_TemplateType=8 then Response.Write("selected")%>>全部影片模版</option>
      </select></td>
    </tr>
    <tr align="center">
      <td height=32 colspan="2" class="hback"><pre id="idTemporary" name="idTemporary" style="display:none"><%if YWNT_TMS_Template<>"" then Response.Write Server.HTMLEncode(YWNT_TMS_Template)%></pre>
	  <script>
	  function insert(leb)
	{
		oUtil.obj.insertHTML(leb);
	}
		var oEdit1 = new InnovaEditor("oEdit1");
		oEdit1.arrStyle = [["BODY",false,"","font:12px verdana,arial,sans-serif;"]];
		oEdit1.width="100%";
		oEdit1.height=450;
		oEdit1.arrCustomButtons = [["btntype","modelessDialogShow('Labeling/TypeLeb.asp',650,600)","栏目标签","type.gif"],
								["btnclass","modelessDialogShow('Labeling/ClassLeb.asp',600,470)","列表标签","class.gif"],
								["btnwithleb","modelessDialogShow('Labeling/Withleb.asp',600,390)","更新/排行标签","Withleb.gif"],
								["btnmovie","modelessDialogShow('Labeling/convert.htm?Movieleb.asp',650,570)","内容标签","movie.gif"],
								["btnsearch","modelessDialogShow('Labeling/SearchLeb.asp',650,470)","搜索标签","search.gif"],
								["btnAllLeb","modelessDialogShow('Labeling/AllLeb.asp',650,260)","全部影片标签","AllLeb.gif"],
								["btnNavLeb","modelessDialogShow('Labeling/NavLeb.asp',650,330)","导航标签","NavLeb.gif"],
								["btnNavigation","modelessDialogShow('Labeling/LocationLeb.asp',350,155)","位置导航标签","Navigation.gif"],								
								["btnFeature","modelessDialogShow('Labeling/Feature.asp',650,410)","专题导航标签","Feature.gif"],
								["btnFlashSlide","modelessDialogShow('Labeling/FlashSlide.asp',650,420)","FLASH幻灯标签","FlashSlide.gif"],
								["btnNotice","modelessDialogShow('Labeling/NoticeLeb.asp',650,320)","公告标签","Notice.gif"],
								["btnlogin","modelessDialogShow('Labeling/UsersLogin.asp',680,350)","登陆标签","login.gif"],
								["btnsearchLeb","modelessDialogShow('Labeling/SearchInputLeb.asp',680,330)","搜索框标签","searchLeb.gif"],
								["btnLabeling","modelessDialogShow('Labeling/convert.htm?ZyLeb.asp',650,330)","自由标签","Labeling.gif"],
								["btnvote","modelessDialogShow('Labeling/convert.htm?VoteLeb.asp',400,330)","投票标签","vote.gif"],
								["btnad","modelessDialogShow('Labeling/convert.htm?AdLeb.asp',400,330)","广告标签","Ad.gif"],
								["btnlinkLeb","modelessDialogShow('Labeling/LinkLeb.asp',650,225)","友情连接标签","linkLeb.gif"],
								["btnTvLeb","modelessDialogShow('Labeling/TvLeb.asp',500,190)","直播导航标签","TvLeb.gif"],
								["btnhelp","modelessDialogShow('Labeling/HelpLeb.asp',650,320)","帮助标签","help.gif"],
								["btnhome","insert('{$SetHome}')","设为首页标签","home.gif"],
								["btnCollection","insert('{$SetCollection}')","加入收藏夹标签","Collection.gif"],
								["btnLogoLeb","modelessDialogShow('Labeling/LogoLeb.asp',500,190)","网站Logo标签","LogoLeb.gif"],
								["btnsetupdir","insert('{$SetupDir}')","网站安装路径标签","setupdir.gif"],
								["btnWebUrl","insert('{$WebUrlW}')","网站URL标签","WebUrl.gif"],
								["btnindex","insert('{$WebNameW}')","网站名称标签","index.gif"]]
		oEdit1.features=["btntype","btnclass","btnwithleb","btnmovie","btnsearch","btnAllLeb","|","btnLogoLeb","btnNavLeb","btnNavigation","btnhome","btnCollection","|","btnLabeling","|","btnFlashSlide","btnNotice","btnlogin","btnsearchLeb","btnlinkLeb","btnTvLeb","btnvote","btnad","btnhelp","btnFeature","|","btnsetupdir","btnWebUrl","btnindex","BRK",
			"Search","Cut","Copy","Paste","PasteText","|","Undo","Redo","|",
			"ForeColor","BackColor","|","Bookmark","Hyperlink","Image","Flash","Media","|","Table","Guidelines","Absolute",
			"|","Characters","Line","Form","ClearAll","Clean","FullScreen","Preview","XHTMLSource","BRK",
			"StyleAndFormatting","TextFormatting","ListFormatting","BoxFormatting",
			"ParagraphFormatting","CssText","Styles","|",
			"Paragraph","FontName","FontSize","|",
			"Bold","Italic",
			"Underline","Strikethrough","|","Superscript","Subscript","|",
			"JustifyLeft","JustifyCenter","JustifyRight","JustifyFull","|","Numbering","Bullets","|","Indent","Outdent"];
		oEdit1.cmdAssetManager="modalDialogShow('<%=GetConfig("WebiInstallDir")&GetConfig("AdminDir")%>Dialog/SelectPic.asp?CurrPath=<% = CurrPath %>',640,410)";
		oEdit1.btnFlash=true;
		oEdit1.btnMedia=true;
		oEdit1.RENDER(document.getElementById("idTemporary").innerHTML);
	</script>
	<input type="hidden" name="Content"  id="Content" value=""></td>
    </tr>
    <tr>
      <td height=32 colspan="2" align="center" class="hback"><input name="ID" type="hidden" value="<%=YWNT_TMS_ID%>"><input type="button" name="Submit" value="修 改" onClick="SubmitTemplate();"></td>
    </tr>
  </form>
  </tbody>
</table>
<%end sub
call connclose()%>
</BODY></HTML>
