AddPagetemp.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <?php
  2. define('EmpireCMSAdmin','1');
  3. require("../../class/connect.php");
  4. require("../../class/db_sql.php");
  5. require("../../class/functions.php");
  6. $link=db_connect();
  7. $empire=new mysqlquery();
  8. $editor=1;
  9. //验证用户
  10. $lur=is_login();
  11. $logininid=$lur['userid'];
  12. $loginin=$lur['username'];
  13. $loginrnd=$lur['rnd'];
  14. $loginlevel=$lur['groupid'];
  15. $loginadminstyleid=$lur['adminstyleid'];
  16. //ehash
  17. $ecms_hashur=hReturnEcmsHashStrAll();
  18. //验证权限
  19. CheckLevel($logininid,$loginin,$classid,"template");
  20. $gid=(int)$_GET['gid'];
  21. $gname=CheckTempGroup($gid);
  22. $urlgname=$gname."&nbsp;>&nbsp;";
  23. $cid=ehtmlspecialchars($_GET['cid']);
  24. $enews=ehtmlspecialchars($_GET['enews']);
  25. $url=$urlgname."<a href=ListPagetemp.php?gid=$gid".$ecms_hashur['ehref'].">管理自定义页面模板</a>&nbsp;>&nbsp;增加自定义页面模板";
  26. $postword='增加自定义页面模板';
  27. //复制
  28. if($enews=="AddPagetemp"&&$_GET['docopy'])
  29. {
  30. $tempid=(int)$_GET['tempid'];
  31. $r=$empire->fetch1("select tempid,tempname,temptext from ".GetDoTemptb("enewspagetemp",$gid)." where tempid='$tempid'");
  32. $url=$urlgname."<a href=ListPagetemp.php?gid=$gid".$ecms_hashur['ehref'].">管理自定义页面模板</a>&nbsp;>&nbsp;复制自定义页面模板: ".$r[tempname];
  33. $postword='修改自定义页面模板';
  34. }
  35. //修改
  36. if($enews=="EditPagetemp")
  37. {
  38. $tempid=(int)$_GET['tempid'];
  39. $r=$empire->fetch1("select tempid,tempname,temptext from ".GetDoTemptb("enewspagetemp",$gid)." where tempid='$tempid'");
  40. $url=$urlgname."<a href=ListPagetemp.php?gid=$gid".$ecms_hashur['ehref'].">管理自定义页面模板</a>&nbsp;>&nbsp;修改自定义页面模板: ".$r[tempname];
  41. $postword='修改自定义页面模板';
  42. }
  43. db_close();
  44. $empire=null;
  45. ?>
  46. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  47. <html>
  48. <head>
  49. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  50. <title><?=$postword?></title>
  51. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  52. <script>
  53. function ReturnHtml(html)
  54. {
  55. document.form1.temptext.value=html;
  56. }
  57. </script>
  58. <SCRIPT lanuage="JScript">
  59. <!--
  60. function tempturnit(ss)
  61. {
  62. if (ss.style.display=="")
  63. ss.style.display="none";
  64. else
  65. ss.style.display="";
  66. }
  67. -->
  68. </SCRIPT>
  69. <script>
  70. function ReTempBak(){
  71. self.location.reload();
  72. }
  73. </script>
  74. </head>
  75. <body>
  76. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1">
  77. <tr>
  78. <td height="25">位置:<?=$url?></td>
  79. </tr>
  80. </table>
  81. <br>
  82. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  83. <form name="form1" method="post" action="ListPagetemp.php">
  84. <?=$ecms_hashur['form']?>
  85. <tr class="header">
  86. <td height="25" colspan="2">
  87. <?=$postword?>
  88. <input name="enews" type="hidden" id="enews" value="<?=$enews?>"> <input name="tempid" type="hidden" id="tempid" value="<?=$tempid?>">
  89. <input name="gid" type="hidden" id="gid" value="<?=$gid?>"></td>
  90. </tr>
  91. <tr bgcolor="#FFFFFF">
  92. <td width="19%" height="25">模板名称(*)</td>
  93. <td width="81%" height="25"> <input name="tempname" type="text" id="tempname" value="<?=$r[tempname]?>" size="30">
  94. </td>
  95. </tr>
  96. <tr bgcolor="#FFFFFF">
  97. <td height="25"><strong>模板内容</strong>(*)</td>
  98. <td height="25">请将模板内容<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<?=$ecms_hashur['ehref']?>','edittemp','width=880,height=600,scrollbars=auto,resizable=yes');"><strong>模板在线编辑</strong></a>进行可视化编辑</td>
  99. </tr>
  100. <tr bgcolor="#FFFFFF">
  101. <td height="25" colspan="2"><div align="center">
  102. <textarea name="temptext" cols="90" rows="27" id="temptext" wrap="OFF" style="WIDTH: 100%"><?=ehtmlspecialchars(stripSlashes($r[temptext]))?></textarea>
  103. </div></td>
  104. </tr>
  105. <tr bgcolor="#FFFFFF">
  106. <td height="25">&nbsp;</td>
  107. <td height="25"><input type="submit" name="Submit" value="保存模板"> &nbsp;
  108. <input type="reset" name="Submit2" value="重置">
  109. <?php
  110. if($enews=='EditPagetemp')
  111. {
  112. ?>
  113. &nbsp;&nbsp;[<a href="#empirecms" onclick="window.open('TempBak.php?temptype=pagetemp&tempid=<?=$tempid?>&gid=<?=$gid?><?=$ecms_hashur['ehref']?>','ViewTempBak','width=450,height=500,scrollbars=yes,left=300,top=150,resizable=yes');">修改记录</a>]
  114. <?php
  115. }
  116. ?>
  117. </td>
  118. </tr>
  119. </form>
  120. <tr bgcolor="#FFFFFF">
  121. <td height="25" colspan="2">&nbsp;&nbsp;[<a href="#ecms" onclick="tempturnit(showtempvar);">显示模板变量说明</a>]
  122. &nbsp;&nbsp;[<a href="#ecms" onclick="window.open('EnewsBq.php<?=$ecms_hashur['whehref']?>','','width=600,height=500,scrollbars=yes,resizable=yes');">查看模板标签语法</a>]
  123. &nbsp;&nbsp;[<a href="#ecms" onclick="window.open('../ListClass.php<?=$ecms_hashur['whehref']?>','','width=800,height=600,scrollbars=yes,resizable=yes');">查看JS调用地址</a>]
  124. &nbsp;&nbsp;[<a href="#ecms" onclick="window.open('ListTempvar.php<?=$ecms_hashur['whehref']?>','','width=800,height=600,scrollbars=yes,resizable=yes');">查看公共模板变量</a>]
  125. &nbsp;&nbsp;[<a href="#ecms" onclick="window.open('ListBqtemp.php<?=$ecms_hashur['whehref']?>','','width=800,height=600,scrollbars=yes,resizable=yes');">查看标签模板</a>]
  126. </td>
  127. </tr>
  128. <tr bgcolor="#FFFFFF" id="showtempvar" style="display:none">
  129. <td height="25" colspan="2"><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#DBEAF5">
  130. <tr bgcolor="#FFFFFF">
  131. <td width="33%" height="25"> <input name="textfield" type="text" value="[!--pagetitle--]">
  132. : 网页标题</td>
  133. <td width="34%"><input name="textfield2" type="text" value="[!--pagekeywords--]">
  134. : 网页关键词</td>
  135. <td width="33%"><input name="textfield3" type="text" value="[!--pagedescription--]">
  136. : 网页描述</td>
  137. </tr>
  138. <tr bgcolor="#FFFFFF">
  139. <td height="25"><input name="textfield32" type="text" value="[!--pagetext--]">
  140. : 网页内容</td>
  141. <td><input name="textfield322" type="text" value="[!--pagename--]">
  142. : 页面名称</td>
  143. <td><input name="textfield3222" type="text" value="[!--pageid--]">
  144. : 页面ID</td>
  145. </tr>
  146. <tr bgcolor="#FFFFFF">
  147. <td height="25"><input name="textfield4" type="text" value="[!--news.url--]">
  148. : 网站地址</td>
  149. <td><strong>支持公共模板变量</strong></td>
  150. <td><strong>支持所有模板标签</strong></td>
  151. </tr>
  152. </table></td>
  153. </tr>
  154. </table>
  155. </body>
  156. </html>