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

98 lines
3.0KB

  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 - 2019, DesDev, Inc.
  8. * @license http://help.dedecms.com/usersguide/license.html
  9. * @link http://www.dedecms.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. {
  17. csrf_check();
  18. //timeset tagname typeid normbody expbody
  19. $tagname = trim($tagname);
  20. $row = $dsql->GetOne("SELECT typeid FROM #@__myad WHERE typeid='$typeid' AND tagname LIKE '$tagname'");
  21. if(is_array($row))
  22. {
  23. ShowMsg("在相同栏目下已经存在同名的标记!","-1");
  24. exit();
  25. }
  26. $starttime = GetMkTime($starttime);
  27. $endtime = GetMkTime($endtime);
  28. $link = addslashes($normbody['link']);
  29. if($normbody['style']=='code')
  30. {
  31. $normbody = addslashes($normbody['htmlcode']);
  32. }
  33. else if($normbody['style']=='txt')
  34. {
  35. $normbody = "<a href=\"{$link}\" font-size=\"{$normbody['size']}\" color=\"{$normbody['color']}\">{$normbody['title']}</a>";
  36. }
  37. else if($normbody['style']=='img')
  38. {
  39. if(empty($normbody['width']))
  40. {
  41. $width = "";
  42. }
  43. else
  44. {
  45. $width = " width=\"{$normbody['width']}\"";
  46. }
  47. if (empty($normbody['height']))
  48. {
  49. $height = "";
  50. }
  51. else
  52. {
  53. $height = "height=\"{$normbody['height']}\"";
  54. }
  55. $normbody = "<a href=\"{$link}\"><img src=\"{$normbody['url']}\"$width $height border=\"0\" /></a>";
  56. }
  57. else
  58. {
  59. if(empty($normbody['width']))
  60. {
  61. $width = "";
  62. }
  63. else
  64. {
  65. $width = " width=\"{$normbody['width']}\"";
  66. }
  67. if (empty($normbody['height']))
  68. {
  69. $height = "";
  70. }
  71. else
  72. {
  73. $height = "height=\"{$normbody['height']}\"";
  74. }
  75. $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>";
  76. }
  77. $query = "
  78. INSERT INTO #@__myad(clsid,typeid,tagname,adname,timeset,starttime,endtime,normbody,expbody)
  79. VALUES('$clsid','$typeid','$tagname','$adname','$timeset','$starttime','$endtime','$normbody','$expbody');
  80. ";
  81. $dsql->ExecuteNoneQuery($query);
  82. ShowMsg("成功增加一个广告!","ad_main.php");
  83. exit();
  84. }
  85. $dsql->Execute('dd','SELECT * FROM `#@__myadtype` ORDER BY id DESC');
  86. $option = '';
  87. while($arr = $dsql->GetArray('dd'))
  88. {
  89. $option .= "<option value='{$arr['id']}'>{$arr['typename']}</option>\n\r";
  90. }
  91. $startDay = time();
  92. $endDay = AddDay($startDay,30);
  93. $startDay = GetDateTimeMk($startDay);
  94. $endDay = GetDateTimeMk($endDay);
  95. include DedeInclude('templets/ad_add.htm');