国内流行的内容管理系统(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.

78 lines
2.9KB

  1. <?php
  2. /**
  3. * 广告添加
  4. *
  5. * @version $Id: ad_add.php 1 8:26 2010年7月12日Z tianya $
  6. * @package DedeBIZ.Administrator
  7. * @copyright Copyright (c) 2021, DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. require(dirname(__FILE__) . "/config.php");
  12. CheckPurview('plus_广告管理');
  13. require_once DEDEINC . "/typelink.class.php";
  14. if (empty($dopost)) $dopost = "";
  15. if ($dopost == "save") {
  16. CheckCSRF();
  17. //timeset tagname typeid normbody expbody
  18. $tagname = trim($tagname);
  19. $row = $dsql->GetOne("SELECT typeid FROM #@__myad WHERE typeid='$typeid' AND tagname LIKE '$tagname'");
  20. if (is_array($row)) {
  21. ShowMsg("在相同栏目下已经存在同名的标记!", "-1");
  22. exit();
  23. }
  24. $starttime = GetMkTime($starttime);
  25. $endtime = GetMkTime($endtime);
  26. $link = addslashes($normbody['link']);
  27. if ($normbody['style'] == 'code') {
  28. $normbody = addslashes($normbody['htmlcode']);
  29. } else if ($normbody['style'] == 'txt') {
  30. $normbody = "<a href=\"{$link}\" font-size=\"{$normbody['size']}\" color=\"{$normbody['color']}\">{$normbody['title']}</a>";
  31. } else if ($normbody['style'] == 'img') {
  32. if (empty($normbody['width'])) {
  33. $width = "";
  34. } else {
  35. $width = " width=\"{$normbody['width']}\"";
  36. }
  37. if (empty($normbody['height'])) {
  38. $height = "";
  39. } else {
  40. $height = "height=\"{$normbody['height']}\"";
  41. }
  42. $normbody = "<a href=\"{$link}\"><img src=\"{$normbody['url']}\"$width $height border=\"0\" /></a>";
  43. } else {
  44. if (empty($normbody['width'])) {
  45. $width = "";
  46. } else {
  47. $width = " width=\"{$normbody['width']}\"";
  48. }
  49. if (empty($normbody['height'])) {
  50. $height = "";
  51. } else {
  52. $height = "height=\"{$normbody['height']}\"";
  53. }
  54. $normbody = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.Macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\"$width $height><param name=\"movie\" value=\"{$link}\"/><param name=\"quality\" value=\"high\"/></object>";
  55. }
  56. $query = "
  57. INSERT INTO #@__myad(clsid,typeid,tagname,adname,timeset,starttime,endtime,normbody,expbody)
  58. VALUES('$clsid','$typeid','$tagname','$adname','$timeset','$starttime','$endtime','$normbody','$expbody');
  59. ";
  60. $dsql->ExecuteNoneQuery($query);
  61. ShowMsg("成功增加一个广告!", "ad_main.php");
  62. exit();
  63. }
  64. $dsql->Execute('dd', 'SELECT * FROM `#@__myadtype` ORDER BY id DESC');
  65. $option = '';
  66. while ($arr = $dsql->GetArray('dd')) {
  67. $option .= "<option value='{$arr['id']}'>{$arr['typename']}</option>\n\r";
  68. }
  69. $startDay = time();
  70. $endDay = AddDay($startDay, 30);
  71. $startDay = GetDateTimeMk($startDay);
  72. $endDay = GetDateTimeMk($endDay);
  73. include DedeInclude('templets/ad_add.htm');