国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ad_edit.php 2.4KB

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