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

64 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='360'></iframe>";
  26. $row = $dsql->GetOne("SELECT tagname from `#@__myad` WHERE aid='$aid' ");
  27. $showtag = '{'."dede:myad name='{$row['tagname']}'/".'}';
  28. $info = "广告标签会解析成标签中文档到页面,广告修改后需要重新生成,如果不希望重新生成所有页面,则直接js调用代码即可";
  29. $wintitle = "广告管理-获取广告标签";
  30. $wecome_info = "<a href='ad_main.php'>广告管理</a>::获取js";
  31. $win = new OxWindow();
  32. $win->Init();
  33. $winform = $win->GetWindow("hand", $info);
  34. $win->AddTitle("标签调用代码");
  35. $winform = $win->GetWindow("hand", $showtag);
  36. $win->myWinItem = '';
  37. $win->AddTitle("以下为选定广告的js调用代码");
  38. $winform = $win->GetWindow("hand", $showhtml);
  39. $win->Display();
  40. exit();
  41. } else if ($dopost == 'testjs') {
  42. echo "<script src='{$cfg_phpurl}/ad_js.php?aid=$aid&nocache=1'></script>";
  43. exit();
  44. } else if ($dopost == 'saveedit') {
  45. CheckCSRF();
  46. $starttime = GetMkTime($starttime);
  47. $endtime = GetMkTime($endtime);
  48. $query = "UPDATE `#@__myad` SET clsid='$clsid',typeid='$typeid',adname='$adname',timeset='$timeset',starttime='$starttime',endtime='$endtime',normbody='$normbody',expbody='$expbody' WHERE aid='$aid'";
  49. $dsql->ExecuteNoneQuery($query);
  50. ShowMsg("成功修改一则广告代码", $ENV_GOBACK_URL);
  51. exit();
  52. }
  53. $row = $dsql->GetOne("SELECT * FROM `#@__myad` WHERE aid='$aid'");
  54. $dsql->Execute('dd', 'SELECT * FROM `#@__myadtype` ORDER BY id DESC');
  55. $option = '';
  56. while ($arr = $dsql->GetArray('dd')) {
  57. if ($arr['id'] == $row['clsid']) {
  58. $option .= "<option value='{$arr['id']}' selected='selected'>{$arr['typename']}</option>\n\r";
  59. } else {
  60. $option .= "<option value='{$arr['id']}'>{$arr['typename']}</option>\n\r";
  61. }
  62. }
  63. include DedeInclude('templets/ad_edit.htm');
  64. ?>