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

ad_add.php 2.9KB

2 years ago
2 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * 广告添加
  4. *
  5. * @version $id:ad_add.php 8:26 2010年7月12日 tianya $
  6. * @package DedeBIZ.Administrator
  7. * @copyright Copyright (c) 2022 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/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 = "INSERT INTO `#@__myad` (clsid,typeid,tagname,adname,timeset,starttime,endtime,normbody,expbody) VALUES ('$clsid','$typeid','$tagname','$adname','$timeset','$starttime','$endtime','$normbody','$expbody');";
  57. $dsql->ExecuteNoneQuery($query);
  58. ShowMsg("成功增加一个广告", "ad_main.php");
  59. exit();
  60. }
  61. $dsql->Execute('dd', 'SELECT * FROM `#@__myadtype` ORDER BY id DESC');
  62. $option = '';
  63. while ($arr = $dsql->GetArray('dd')) {
  64. $option .= "<option value='{$arr['id']}'>{$arr['typename']}</option>\n\r";
  65. }
  66. $startDay = time();
  67. $endDay = AddDay($startDay, 30);
  68. $startDay = GetDateTimeMk($startDay);
  69. $endDay = GetDateTimeMk($endDay);
  70. include DedeInclude('templets/ad_add.htm');
  71. ?>