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

66 lines
3.0KB

  1. <?php
  2. /**
  3. * 广告编辑
  4. *
  5. * @version $id:ad_edit.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. $aid = preg_replace("#[^0-9]#", '', $aid);
  16. $ENV_GOBACK_URL = empty($_COOKIE['ENV_GOBACK_URL']) ? "ad_main.php" : $_COOKIE['ENV_GOBACK_URL'];
  17. if ($dopost == 'delete') {
  18. $dsql->ExecuteNoneQuery("DELETE FROM `#@__myad` WHERE aid='$aid' ");
  19. ShowMsg("成功删除一则广告代码", $ENV_GOBACK_URL);
  20. exit();
  21. } else if ($dopost == "gettag") {
  22. require_once(DEDEINC.'/libraries/oxwindow.class.php');
  23. $jscode = "<script src='{$cfg_phpurl}/ad_js.php?aid=$aid'></script>";
  24. $showhtml = "<xmp style='color:#333333;background-color:#ffffff'>\r\n\r\n$jscode\r\n\r\n</xmp>";
  25. $showhtml .= "预览:<iframe name='testfrm' frameborder='0' src='ad_edit.php?aid={$aid}&dopost=testjs' id='testfrm' width='100%' height='200'></iframe>";
  26. $row = $dsql->GetOne("SELECT tagname from `#@__myad` WHERE aid='$aid' ");
  27. $showtag = '{'."dede:myad name='{$row['tagname']}'/".'}';
  28. $info = "说明:如果嵌入的是织梦广告标签,那将会解析成标签中的内容到页面,广告修改后需要重新生成<br>
  29. 如果不希望重新生成所有页面,则直接调用js代码即可
  30. ";
  31. $wintitle = "广告管理-获取广告标签";
  32. $wecome_info = "<a href='ad_main.php'>广告管理</a>::获取js";
  33. $win = new OxWindow();
  34. $win->Init();
  35. $winform = $win->GetWindow("hand", $info);
  36. $win->AddTitle("织梦标签调用代码:");
  37. $winform = $win->GetWindow("hand", $showtag);
  38. $win->myWinItem = '';
  39. $win->AddTitle("以下为选定广告的js调用代码:");
  40. $winform = $win->GetWindow("hand", $showhtml);
  41. $win->Display();
  42. exit();
  43. } else if ($dopost == 'testjs') {
  44. echo "<script src='{$cfg_phpurl}/ad_js.php?aid=$aid&nocache=1'></script>";
  45. exit();
  46. } else if ($dopost == 'saveedit') {
  47. CheckCSRF();
  48. $starttime = GetMkTime($starttime);
  49. $endtime = GetMkTime($endtime);
  50. $query = "UPDATE `#@__myad` SET clsid='$clsid',typeid='$typeid',adname='$adname',timeset='$timeset',starttime='$starttime',endtime='$endtime',normbody='$normbody',expbody='$expbody' WHERE aid='$aid'";
  51. $dsql->ExecuteNoneQuery($query);
  52. ShowMsg("成功修改一则广告代码", $ENV_GOBACK_URL);
  53. exit();
  54. }
  55. $row = $dsql->GetOne("SELECT * FROM `#@__myad` WHERE aid='$aid'");
  56. $dsql->Execute('dd', 'SELECT * FROM `#@__myadtype` ORDER BY id DESC');
  57. $option = '';
  58. while ($arr = $dsql->GetArray('dd')) {
  59. if ($arr['id'] == $row['clsid']) {
  60. $option .= "<option value='{$arr['id']}' selected='selected'>{$arr['typename']}</option>\n\r";
  61. } else {
  62. $option .= "<option value='{$arr['id']}'>{$arr['typename']}</option>\n\r";
  63. }
  64. }
  65. include DedeInclude('templets/ad_edit.htm');
  66. ?>