📄 addnewstemp.php
字号:
<?php
require("../../class/connect.php");
include("../../class/db_sql.php");
include("../../class/config.php");
include("../../class/functions.php");
$link=db_connect();
$empire=new mysqlquery();
$logininid=getcvar('loginuserid');
$loginin=getcvar('loginusername');
$loginrnd=getcvar('loginrnd');
$loginlevel=getcvar('loginlevel');
$editor=1;
is_login($logininid,$loginin,$loginrnd);
//验证权限
CheckLevel($logininid,$loginin,$classid,"template");
$gid=(int)$_GET['gid'];
$gname=CheckTempGroup($gid);
$urlgname=$gname." -> ";
$mid=$_GET['mid'];
$cid=$_GET['cid'];
$enews=$_GET['enews'];
$r[showdate]="Y-m-d H:i:s";
$url=$urlgname."<a href=ListNewstemp.php?gid=$gid>管理内容模板</a> -> 增加内容模板";
//复制
if($enews=="AddNewstemp"&&$_GET['docopy'])
{
$tempid=(int)$_GET['tempid'];
$r=$empire->fetch1("select tempname,temptext,modid,showdate,classid from ".GetDoTemptb("enewsnewstemp",$gid)." where tempid='$tempid'");
$url=$urlgname."<a href=ListNewstemp.php?gid=$gid>管理内容模板</a> -> 复制内容模板:".$r[tempname];
}
//修改
if($enews=="EditNewstemp")
{
$tempid=(int)$_GET['tempid'];
$r=$empire->fetch1("select tempname,temptext,modid,showdate,classid from ".GetDoTemptb("enewsnewstemp",$gid)." where tempid='$tempid'");
$url=$urlgname."<a href=ListNewstemp.php?gid=$gid>管理内容模板</a> -> 修改内容模板:".$r[tempname];
}
//系统模型
$msql=$empire->query("select mid,mname from {$dbtbpre}enewsmod order by mid");
while($mr=$empire->fetch($msql))
{
if($mr[mid]==$r[modid])
{$select=" selected";}
else
{$select="";}
$mod.="<option value=".$mr[mid].$select.">".$mr[mname]."</option>";
}
//分类
$cstr="";
$csql=$empire->query("select classid,classname from {$dbtbpre}enewsnewstempclass order by classid");
while($cr=$empire->fetch($csql))
{
$select="";
if($cr[classid]==$r[classid])
{
$select=" selected";
}
$cstr.="<option value='".$cr[classid]."'".$select.">".$cr[classname]."</option>";
}
db_close();
$empire=null;
//风格
$loginadminstyleid=(int)getcvar('loginadminstyleid');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理内容模板</title>
<link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
<script>
function ReturnHtml(html)
{
document.form1.temptext.value=html;
}
</script>
<SCRIPT lanuage="JScript">
<!--
function tempturnit(ss)
{
if (ss.style.display=="")
ss.style.display="none";
else
ss.style.display="";
}
-->
</SCRIPT>
</head>
<body>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td>位置:<?=$url?></td>
</tr>
</table>
<form name="form1" method="post" action="ListNewstemp.php">
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<tr class="header">
<td height="25" colspan="2">增加模板
<input type=hidden name=enews value="<?=$enews?>"> <input name="tempid" type="hidden" id="tempid" value="<?=$tempid?>">
<input name="cid" type="hidden" id="cid" value="<?=$cid?>"> <input name="mid" type="hidden" id="mid" value="<?=$mid?>">
<input name="gid" type="hidden" id="gid" value="<?=$gid?>"> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="19%" height="25">模板名(*)</td>
<td width="69%" height="25"> <input name="tempname" type="text" id="tempname" value="<?=$r[tempname]?>" size="30">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">所属系统模型(*)</td>
<td height="25"><select name="modid" id="modid">
<?=$mod?>
</select> <input type="button" name="Submit6" value="管理系统模型" onclick="window.open('../db/ListTable.php');">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">所属分类</td>
<td height="25"><select name="classid" id="classid">
<option value="0">不隶属于任何分类</option>
<?=$cstr?>
</select> <input type="button" name="Submit6222322" value="管理分类" onclick="window.open('NewstempClass.php');"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">时间显示格式:</td>
<td> <input name="showdate" type="text" id="showdate" value="<?=$r[showdate]?>" size="20">
<select name="select4" onchange="document.form1.showdate.value=this.value">
<option value="Y-m-d H:i:s">选择</option>
<option value="Y-m-d H:i:s">2005-01-27 11:04:27</option>
<option value="Y-m-d">2005-01-27</option>
<option value="m-d">01-27</option>
</select> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25"><strong>模板内容</strong>(*)</td>
<td> 请将模板内容<a href="#ecms" onclick="window.clipboardData.setData('Text',document.form1.temptext.value);document.form1.temptext.select()" title="点击复制模板内容"><strong>复制到Dreamweaver(推荐)</strong></a>或者使用<a href="#ecms" onclick="window.open('editor.php?getvar=opener.document.form1.temptext.value&returnvar=opener.document.form1.temptext.value&fun=ReturnHtml','edittemp','width=880,height=600,scrollbars=auto,resizable=yes');"><strong>模板在线编辑</strong></a>进行可视化编辑</td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="2" valign="top"> <div align="center">
<textarea name="temptext" cols="90" rows="27" wrap="OFF" style="WIDTH: 100%"><?=htmlspecialchars(stripSlashes($r[temptext]))?></textarea>
</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25" colspan="2"> [<a href="#ecms" onclick="tempturnit(showtempvar);">显示模板变量说明</a>]
[<a href="#ecms" onclick="window.open('EnewsBq.php','','width=600,height=500,scrollbars=yes,resizable=yes');">查看模板标签语法</a>]
[<a href="#ecms" onclick="window.open('../ListClass.php','','width=800,height=600,scrollbars=yes,resizable=yes');">查看JS调用地址</a>]
[<a href="#ecms" onclick="window.open('ListTempvar.php','','width=800,height=600,scrollbars=yes,resizable=yes');">查看公共模板变量</a>]
[<a href="#ecms" onclick="window.open('ListBqtemp.php','','width=800,height=600,scrollbars=yes,resizable=yes');">查看标签模板</a>]</td>
</tr>
<tr bgcolor="#FFFFFF" id="showtempvar" style="display:none">
<td height="25" colspan="2"><strong>模板变量说明:</strong><br>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#DBEAF5">
<tr bgcolor="#FFFFFF">
<td width="34%" height="25">
<input name="textfield18" type="text" value="[!--pagetitle--]">
:页面标题</td>
<td width="33%">
<input name="textfield19" type="text" value="[!--newsnav--]">
:导航条</td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -