AddVotetemp.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. $enews=ehtmlspecialchars($_GET['enews']);
  24. $url=$urlgname."<a href=ListVotetemp.php?gid=$gid".$ecms_hashur['ehref'].">管理投票模板</a>&nbsp;>&nbsp;增加投票模板";
  25. //复制
  26. if($enews=="AddVoteTemp"&&$_GET['docopy'])
  27. {
  28. $tempid=(int)$_GET['tempid'];
  29. $r=$empire->fetch1("select tempid,tempname,temptext from ".GetDoTemptb("enewsvotetemp",$gid)." where tempid=$tempid");
  30. $url=$urlgname."<a href=ListVotetemp.php?gid=$gid".$ecms_hashur['ehref'].">管理投票模板</a>&nbsp;>&nbsp;复制投票模板:<b>".$r[tempname]."</b>";
  31. }
  32. //修改
  33. if($enews=="EditVoteTemp")
  34. {
  35. $tempid=(int)$_GET['tempid'];
  36. $r=$empire->fetch1("select tempid,tempname,temptext from ".GetDoTemptb("enewsvotetemp",$gid)." where tempid=$tempid");
  37. $url=$urlgname."<a href=ListVotetemp.php?gid=$gid".$ecms_hashur['ehref'].">管理投票模板</a>&nbsp;>&nbsp;修改投票模板:<b>".$r[tempname]."</b>";
  38. }
  39. db_close();
  40. $empire=null;
  41. ?>
  42. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  43. <html>
  44. <head>
  45. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  46. <title>增加投票模板</title>
  47. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  48. <SCRIPT lanuage="JScript">
  49. <!--
  50. function tempturnit(ss)
  51. {
  52. if (ss.style.display=="")
  53. ss.style.display="none";
  54. else
  55. ss.style.display="";
  56. }
  57. -->
  58. </SCRIPT>
  59. <script>
  60. function ReTempBak(){
  61. self.location.reload();
  62. }
  63. </script>
  64. </head>
  65. <body>
  66. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1">
  67. <tr>
  68. <td height="25">位置:<?=$url?></td>
  69. </tr>
  70. </table>
  71. <br>
  72. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  73. <form name="form1" method="post" action="ListVotetemp.php">
  74. <?=$ecms_hashur['form']?>
  75. <tr class="header">
  76. <td height="25" colspan="2">增加投票模板
  77. <input name="enews" type="hidden" id="enews" value="<?=$enews?>"> <input name="tempid" type="hidden" id="tempid" value="<?=$tempid?>">
  78. <input name="gid" type="hidden" id="gid" value="<?=$gid?>"> </td>
  79. </tr>
  80. <tr bgcolor="#FFFFFF">
  81. <td width="19%" height="25">模板名称</td>
  82. <td width="81%" height="25"> <input name="tempname" type="text" id="tempname" value="<?=$r[tempname]?>">
  83. </td>
  84. </tr>
  85. <tr bgcolor="#FFFFFF">
  86. <td height="25"><strong>模板内容</strong>(*)</td>
  87. <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&notfullpage=1<?=$ecms_hashur['ehref']?>','edittemp','width=880,height=600,scrollbars=auto,resizable=yes');"><strong>模板在线编辑</strong></a>进行可视化编辑</td>
  88. </tr>
  89. <tr bgcolor="#FFFFFF">
  90. <td height="25" colspan="2"><div align="center">
  91. <textarea name="temptext" cols="90" rows="23" id="temptext" wrap="OFF" style="WIDTH: 100%"><?=ehtmlspecialchars(stripSlashes($r[temptext]))?></textarea>
  92. </div></td>
  93. </tr>
  94. <tr bgcolor="#FFFFFF">
  95. <td height="25">&nbsp;</td>
  96. <td height="25"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置">
  97. <?php
  98. if($enews=='EditVoteTemp')
  99. {
  100. ?>
  101. &nbsp;&nbsp;[<a href="#empirecms" onclick="window.open('TempBak.php?temptype=votetemp&tempid=<?=$tempid?>&gid=<?=$gid?><?=$ecms_hashur['ehref']?>','ViewTempBak','width=450,height=500,scrollbars=yes,left=300,top=150,resizable=yes');">修改记录</a>]
  102. <?php
  103. }
  104. ?>
  105. </td>
  106. </tr>
  107. </form>
  108. <tr bgcolor="#FFFFFF">
  109. <td height="25" colspan="2">&nbsp;&nbsp;[<a href="#ecms" onclick="tempturnit(showtempvar);">显示模板变量说明</a>]</td>
  110. </tr>
  111. <tr bgcolor="#FFFFFF" id="showtempvar" style="display:none">
  112. <td height="25" colspan="2"><strong>(1)、投票插件使用时支持的模板变量列表 </strong><br>
  113. <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#DBEAF5">
  114. <tr bgcolor="#FFFFFF">
  115. <td height="25"><div align="center">[!--news.url--]</div></td>
  116. <td>网站地址</td>
  117. </tr>
  118. <tr bgcolor="#FFFFFF">
  119. <td width="36%" height="25"> <div align="center">[!--vote.action--]</div></td>
  120. <td width="64%">投票表单提交地址</td>
  121. </tr>
  122. <tr bgcolor="#FFFFFF">
  123. <td height="25"> <div align="center">[!--title--]</div></td>
  124. <td>显示投票的标题</td>
  125. </tr>
  126. <tr bgcolor="#FFFFFF">
  127. <td height="25"> <div align="center">[!--vote.view--]</div></td>
  128. <td>查看投票结果地址</td>
  129. </tr>
  130. <tr bgcolor="#FFFFFF">
  131. <td height="25"> <div align="center">[!--width--](宽度)、[!--height--](高度)</div></td>
  132. <td>弹出投票结果窗口大小</td>
  133. </tr>
  134. <tr bgcolor="#FFFFFF">
  135. <td height="25"> <div align="center">[!--voteid--]</div></td>
  136. <td>此投票的ID</td>
  137. </tr>
  138. <tr bgcolor="#FFFFFF">
  139. <td height="25"> <div align="center">[!--vote.box--]</div></td>
  140. <td>投票选项(单选框
  141. <input type="radio" name="radiobutton" value="radiobutton">
  142. 与复选框
  143. <input type="checkbox" name="checkbox" value="checkbox">
  144. )</td>
  145. </tr>
  146. <tr bgcolor="#FFFFFF">
  147. <td height="25"> <div align="center">[!--vote.name--]</div></td>
  148. <td>投票选项名称</td>
  149. </tr>
  150. <tr bgcolor="#FFFFFF">
  151. <td height="25"><div align="center">投票事件变量</div></td>
  152. <td>&lt;input type=&quot;hidden&quot; name=&quot;<strong>enews</strong>&quot;
  153. value=&quot;<strong>AddVote</strong>&quot;&gt;</td>
  154. </tr>
  155. </table>
  156. <br> <strong>(2)、信息投票使用时支持的模板变量列表 </strong><br>
  157. <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#DBEAF5">
  158. <tr bgcolor="#FFFFFF">
  159. <td height="25"><div align="center">[!--news.url--]</div></td>
  160. <td>网站地址</td>
  161. </tr>
  162. <tr bgcolor="#FFFFFF">
  163. <td width="36%" height="25"> <div align="center">投票表单提交地址</div></td>
  164. <td width="64%">/e/enews/index.php</td>
  165. </tr>
  166. <tr bgcolor="#FFFFFF">
  167. <td height="25"><div align="center">查看投票结果地址</div></td>
  168. <td>/e/public/vote/?classid=[!--classid--]&amp;id=[!--id--]</td>
  169. </tr>
  170. <tr bgcolor="#FFFFFF">
  171. <td height="25"> <div align="center">[!--title--]</div></td>
  172. <td>显示投票的标题</td>
  173. </tr>
  174. <tr bgcolor="#FFFFFF">
  175. <td height="25"> <div align="center">[!--width--](宽度)、[!--height--](高度)</div></td>
  176. <td>弹出投票结果窗口大小</td>
  177. </tr>
  178. <tr bgcolor="#FFFFFF">
  179. <td height="25"> <div align="center">[!--id--]</div></td>
  180. <td>信息ID</td>
  181. </tr>
  182. <tr bgcolor="#FFFFFF">
  183. <td height="25"><div align="center">[!--classid--]</div></td>
  184. <td>栏目ID</td>
  185. </tr>
  186. <tr bgcolor="#FFFFFF">
  187. <td height="25"> <div align="center">[!--vote.box--]</div></td>
  188. <td>投票选项(单选框
  189. <input type="radio" name="radiobutton" value="radiobutton">
  190. 与复选框
  191. <input type="checkbox" name="checkbox2" value="checkbox">
  192. )</td>
  193. </tr>
  194. <tr bgcolor="#FFFFFF">
  195. <td height="25"> <div align="center">[!--vote.name--]</div></td>
  196. <td>投票选项名称</td>
  197. </tr>
  198. <tr bgcolor="#FFFFFF">
  199. <td height="25"><div align="center">投票事件变量</div></td>
  200. <td>&lt;input type=&quot;hidden&quot; name=&quot;<strong>enews</strong>&quot;
  201. value=&quot;<strong>AddInfoVote</strong>&quot;&gt;</td>
  202. </tr>
  203. </table></td>
  204. </tr>
  205. <tr bgcolor="#FFFFFF">
  206. <td height="25">模板格式:</td>
  207. <td height="25">列表头[!--empirenews.listtemp--]列表内容[!--empirenews.listtemp--]列表尾</td>
  208. </tr>
  209. </table>
  210. </body>
  211. </html>