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

57 lines
1.7KB

  1. <?php
  2. /**
  3. * @version $Id: co_url.php 1 14:31 2010年7月12日Z tianya $
  4. * @package DedeBIZ.Administrator
  5. * @copyright Copyright (c) 2020, DedeBIZ.COM
  6. * @license https://www.dedebiz.com/license
  7. * @link https://www.dedebiz.com
  8. */
  9. require_once(dirname(__FILE__) . "/config.php");
  10. require_once(DEDEINC . "/dedecollection.class.php");
  11. $backurl = isset($_COOKIE['ENV_GOBACK_URL']) ? $_COOKIE['ENV_GOBACK_URL'] : "co_url.php";
  12. if (empty($action)) $action = '';
  13. if ($aid == '') {
  14. ShowMsg('参数无效!', '-1');
  15. exit();
  16. }
  17. //保存更改
  18. if ($action == "save") {
  19. $result = '';
  20. for ($i = 0; $i < $endid; $i++) {
  21. $result .= "{dede:field name=\\'" . ${"noteid_$i"} . "\\'}" . ${"value_$i"} . "{/dede:field}\r\n";
  22. }
  23. $dsql->ExecuteNoneQuery("UPDATE `#@__co_htmls` SET result='$result' WHERE aid='$aid'; ");
  24. ShowMsg("成功保存一条记录!", $backurl);
  25. exit();
  26. }
  27. $dsql->SetSql("SELECT * FROM `#@__co_htmls` WHERE aid='$aid'");
  28. $dsql->Execute();
  29. $row = $dsql->GetObject();
  30. $isdown = $row->isdown;
  31. $nid = $row->nid;
  32. $url = $row->url;
  33. $dtime = $row->dtime;
  34. $body = $row->result;
  35. $litpic = $row->litpic;
  36. $fields = array();
  37. if ($isdown == 0) {
  38. $co = new DedeCollection();
  39. $co->LoadNote($nid);
  40. $co->DownUrl($aid, $url, $litpic);
  41. $co->dsql->SetSql("SELECT * FROM `#@__co_htmls` WHERE aid='$aid'");
  42. $co->dsql->Execute();
  43. $row = $co->dsql->GetObject();
  44. $isdown = $row->isdown;
  45. $nid = $row->nid;
  46. $url = $row->url;
  47. $dtime = $row->dtime;
  48. $body = $row->result;
  49. $litpic = $row->litpic;
  50. }
  51. $dtp = new DedeTagParse();
  52. $dtp->SetNameSpace("dede", "{", "}");
  53. $dtp->LoadString($body);
  54. include DedeInclude('templets/co_view.htm');