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

56 lines
2.5KB

  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 GNU GPL v2 (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. $row = $dsql->GetOne("SELECT tagname from `#@__myad` WHERE aid='$aid' ");
  24. $tagcode = "{dede:myad name='{$row['tagname']}'/} <script src='{$cfg_phpurl}/ad_js.php?aid=$aid'></script>";
  25. $showhtml = "<p>2种方法调用</p><xmp>$tagcode</xmp>";
  26. $showhtml .= "<p>前台调用效果</p><iframe name='testfrm' frameborder='0' src='ad_edit.php?aid={$aid}&dopost=testjs' id='testfrm' width='100%' height='350'></iframe>";
  27. $wecome_info = "<a href='ad_main.php'>广告管理</a> - 调用示例";
  28. $win = new OxWindow();
  29. $win->Init();
  30. $winform = $win->GetWindow("hand", $showhtml);
  31. $win->Display();
  32. exit();
  33. } else if ($dopost == 'testjs') {
  34. echo "<script src='{$cfg_phpurl}/ad_js.php?aid=$aid&nocache=1'></script>";
  35. exit();
  36. } else if ($dopost == 'saveedit') {
  37. CheckCSRF();
  38. $starttime = GetMkTime($starttime);
  39. $endtime = GetMkTime($endtime);
  40. $query = "UPDATE `#@__myad` SET clsid='$clsid',typeid='$typeid',adname='$adname',timeset='$timeset',starttime='$starttime',endtime='$endtime',normbody='$normbody',expbody='$expbody' WHERE aid='$aid'";
  41. $dsql->ExecuteNoneQuery($query);
  42. ShowMsg("成功修改一则广告代码", $ENV_GOBACK_URL);
  43. exit();
  44. }
  45. $row = $dsql->GetOne("SELECT * FROM `#@__myad` WHERE aid='$aid'");
  46. $dsql->Execute('dd', 'SELECT * FROM `#@__myadtype` ORDER BY id DESC');
  47. $option = '';
  48. while ($arr = $dsql->GetArray('dd')) {
  49. if ($arr['id'] == $row['clsid']) {
  50. $option .= "<option value='{$arr['id']}' selected='selected'>{$arr['typename']}</option>\n\r";
  51. } else {
  52. $option .= "<option value='{$arr['id']}'>{$arr['typename']}</option>\n\r";
  53. }
  54. }
  55. include DedeInclude('templets/ad_edit.htm');
  56. ?>