国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

256 lines
9.7KB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="<?php echo $cfg_soft_lang; ?>">
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  6. <title>增加广告</title>
  7. <link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
  8. <link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
  9. <link rel="stylesheet" href="../static/web/css/admin.css">
  10. <link rel="stylesheet" href="../static/web/css/daterangepicker.css">
  11. <script src="../static/web/js/jquery.min.js"></script>
  12. <script src="../static/web/js/moment.min.js"></script>
  13. <script src="../static/web/js/daterangepicker.js"></script>
  14. <script>
  15. function checkSubmit() {
  16. if (document.form1.tagname.value == "") {
  17. alert("广告标识不能为空");
  18. document.form1.tagname.focus();
  19. return false;
  20. }
  21. }
  22. $(document).ready(function () {
  23. $('.datepicker').daterangepicker({
  24. "singleDatePicker": true,
  25. "autoApply": true,
  26. "showDropdowns": true,
  27. "linkedCalendars": false,
  28. "timePicker": true,
  29. "timePicker24Hour": true,
  30. //"timePickerSeconds": true,
  31. "showCustomRangeLabel": false,
  32. ranges: {
  33. '今日': [moment(), moment()],
  34. '昨日': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
  35. '本月': [moment().startOf('month'), moment().startOf('month')],
  36. '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').startOf('month')]
  37. },
  38. "locale": {
  39. format: 'YYYY-MM-DD HH:mm',
  40. applyLabel: '确定',
  41. cancelLabel: '取消',
  42. daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'],
  43. monthNames: ['一月', '二月', '三月', '四月', '五月', '六月',
  44. '七月', '八月', '九月', '十月', '十一月', '十二月'],
  45. firstDay: 1
  46. }
  47. }, function (start) {
  48. $(this).val(start.format("YYYY-MM-DD HH:mm"));
  49. });
  50. })
  51. </script>
  52. <style>
  53. .typetab {
  54. text-align: left;
  55. }
  56. .typetab ul {
  57. list-style: none;
  58. }
  59. .typetab ul li {
  60. float: left;
  61. width: 64px;
  62. height: 26px;
  63. line-height: 26px;
  64. background: #f8f8f8;
  65. text-align: center;
  66. cursor: pointer;
  67. }
  68. .typetab ul .act {
  69. background:#FBFCE2;
  70. }
  71. .i_table {
  72. border: 1px solid #eee;
  73. }
  74. </style>
  75. </head>
  76. <body>
  77. <form action="ad_add.php" method="post" name="form1" onSubmit="return checkSubmit()">
  78. <table width="98%" cellpadding="3" cellspacing="1" align="center" class="table maintable mt-3 mb-3">
  79. <tr>
  80. <td bgcolor="#f8f8f8"><a href="ad_main.php">广告管理</a> &gt; 增加广告位置</td>
  81. </tr>
  82. <tr>
  83. <td>
  84. <table width="100%" cellspacing="4" cellpadding="4" class="table table-borderless">
  85. <input type="hidden" name="normbody[style]" value="code" id="adstyle">
  86. <input type="hidden" name="_csrf_token" value="<?php echo $GLOBALS['csrf_token']; ?>">
  87. <input type="hidden" name="dopost" value="save">
  88. <tr>
  89. <td colspan="3">广告代码的调用方法:{dede:myad name='广告位标识'/} </td>
  90. </tr>
  91. <tr>
  92. <td>广告位标识:</td>
  93. <td colspan="2"><input type="text" name="tagname" id="tagname" class="iptxt" style="width:260px">(使用英文或数字表示的简洁标识)</td>
  94. </tr>
  95. <tr>
  96. <td>广告分类:</td>
  97. <td colspan="2">
  98. <select name="clsid" id="clsid" style="width:160px">
  99. <option value="0">默认分类</option>
  100. <?php echo $option; ?>
  101. </select>
  102. </td>
  103. </tr>
  104. <tr>
  105. <td>广告投放范围:</td>
  106. <td colspan="2">
  107. <?php
  108. $tl = new TypeLink(0);
  109. $typeOptions = $tl->GetOptionArray(0,0,0);
  110. echo "<select name='typeid' style='width:160px'>";
  111. echo "<option value='0' selected>投放在没有同名标识的所有栏目</option>";
  112. echo $typeOptions;
  113. echo "</select>";
  114. ?>(如果在所选栏目找不到指定标识的广告内容,系统会自动搜索父栏目)
  115. </td>
  116. </tr>
  117. <tr>
  118. <td>广告位名称:</td>
  119. <td colspan="2"><input type="text" name="adname" id="adname" class="iptxt" style="width:260px"></td>
  120. </tr>
  121. <tr>
  122. <td>时间限制:</td>
  123. <td colspan="2">
  124. <label><input type="radio" name="timeset" value="0" checked="1"> 永不过期</label>
  125. <label><input type="radio" name="timeset" value="1"> 在设内时间内有效</label>
  126. </td>
  127. </tr>
  128. <tr>
  129. <td>投放时间:</td>
  130. <td colspan="2">
  131. 从:<input type="text" name="starttime" id="starttime" value="<?php echo $startDay?>" style="width:160px">
  132. 到:<input type="text" name="endtime" id="endtime" value="<?php echo $endDay?>" style="width:160px">
  133. </td>
  134. </tr>
  135. <tr>
  136. <td height="80">广告内容:</td>
  137. <td width="70%">
  138. <div class="typetab">
  139. <ul id="changeTab">
  140. <li id="t_code" class="act">代码</li>
  141. <li id="t_txt">文字</li>
  142. <li id="t_img">图片</li>
  143. <li id="t_flash">Flash</li>
  144. </ul>
  145. <div style="clear:both"></div>
  146. </div>
  147. <div id="advert"></div>
  148. </td>
  149. <td width="10%"></td>
  150. </tr>
  151. <tr>
  152. <td height="80">过期显示内容:</td>
  153. <td><textarea name="expbody" rows="10" id="expbody" style="width:80%;height:100px"></textarea></td>
  154. <td></td>
  155. </tr>
  156. <tr>
  157. <td colspan="3" align="center" class="py-2"><button type="submit" class="btn btn-success btn-sm">保存</button></td>
  158. </tr>
  159. </table>
  160. </td>
  161. </tr>
  162. </table>
  163. </form>
  164. <div style="display:none" id="formtxt">
  165. <div class="content" id="code" style="display:none">
  166. <table width="80%" cellpadding="3" cellspacing="1" class="i_table">
  167. <tr>
  168. <td width="260">广告代码:<br>
  169. 请填写广告代码,支持html代码</td>
  170. <td><textarea name="normbody[htmlcode]" style="width:390px;height:100px"></textarea></td>
  171. </tr>
  172. </table>
  173. </div>
  174. <div class="content" id="txt" style="display:none">
  175. <table width="80%" cellpadding="3" cellspacing="1" class="i_table">
  176. <tr>
  177. <td width="260">文字内容 *</td>
  178. <td><input type="text" name="normbody[title]" value="" class="iptxt" style="width:360px"></td>
  179. </tr>
  180. <tr>
  181. <td>文字链接 *</td>
  182. <td><input type="text" name="normbody[link]" value="" class="iptxt" style="width:360px"></td>
  183. </tr>
  184. <tr>
  185. <td>文字颜色</td>
  186. <td><input type="text" name="normbody[color]" value="" class="iptxt" style="width:360px"></td>
  187. </tr>
  188. <tr>
  189. <td>文字大小</td>
  190. <td><input type="text" name="normbody[size]" value="" class="iptxt" style="width:360px"></td>
  191. </tr>
  192. </table>
  193. </div>
  194. <div class="content" id="img" style="display:none">
  195. <table width="80%" cellpadding="3" cellspacing="1" class="i_table">
  196. <tr>
  197. <td width="260">图片地址 *</td>
  198. <td><input type="text" name="normbody[url]" value="" class="iptxt" style="width:360px"></td>
  199. </tr>
  200. <tr>
  201. <td>图片链接 *</td>
  202. <td><input type="text" name="normbody[link]" value="" class="iptxt" style="width:360px"></td>
  203. </tr>
  204. <tr>
  205. <td>图片宽度</td>
  206. <td><input type="text" name="normbody[width]" value="" class="iptxt" style="width:360px"></td>
  207. </tr>
  208. <tr>
  209. <td>图片高度</td>
  210. <td><input type="text" name="normbody[height]" value="" class="iptxt" style="width:360px"></td>
  211. </tr>
  212. <tr>
  213. <td>图片描述</td>
  214. <td><input type="text" name="normbody[descrip]" value="" class="iptxt" style="width:360px"></td>
  215. </tr>
  216. </table>
  217. </div>
  218. <div class="content" id="flash" style="display:none">
  219. <table width="80%" cellpadding="3" cellspacing="1" class="i_table">
  220. <tr>
  221. <td width="260">flash链接</td>
  222. <td><input type="text" name="normbody[link]" value="" class="iptxt" style="width:360px"></td>
  223. </tr>
  224. <tr>
  225. <td>flash宽度</td>
  226. <td><input type="text" name="normbody[width]" value="" class="iptxt" style="width:360px"></td>
  227. </tr>
  228. <tr>
  229. <td>flash高度</td>
  230. <td><input type="text" name="normbody[height]" value="" class="iptxt" style="width:360px"></td>
  231. </tr>
  232. </table>
  233. </div>
  234. </div>
  235. <script>
  236. (function ($) {
  237. function showcode(idName) {
  238. $("#advert").html("").html($("#formtxt>#" + idName).html());
  239. $("#adstyle").val(idName);
  240. }
  241. showcode('code');
  242. $("#changeTab>li").click(function () {
  243. var tabLi = $(this);
  244. var thistab = tabLi[0].id;
  245. $(".content").each(function () {
  246. if ("t_" + $(this)[0].id == thistab) {
  247. $("#changeTab>li").removeClass("act");
  248. $("#t_" + $(this)[0].id).addClass("act");
  249. showcode($(this)[0].id);
  250. }
  251. })
  252. })
  253. })(jQuery);
  254. </script>
  255. </body>
  256. </html>