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

99 lines
3.1KB

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