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

44 lines
1.3KB

  1. <?php
  2. /**
  3. * 文章来源编辑
  4. *
  5. * @version $Id: archives_add.php 1 14:30 2010年7月12日Z tianya $
  6. * @package DedeCMS.Administrator
  7. * @copyright Copyright (c) 2007 - 2020, DesDev, Inc.
  8. * @license http://help.dedecms.com/usersguide/license.html
  9. * @link http://www.dedecms.com
  10. */
  11. require_once(dirname(__FILE__)."/config.php");
  12. require_once(DEDEINC."/oxwindow.class.php");
  13. CheckPurview('sys_Source');
  14. if(empty($dopost)) $dopost = '';
  15. if(empty($allsource)) $allsource = '';
  16. else $allsource = stripslashes($allsource);
  17. $m_file = DEDEDATA."/admin/source.txt";
  18. //保存
  19. if($dopost=='save')
  20. {
  21. $fp = fopen($m_file,'w');
  22. flock($fp,3);
  23. fwrite($fp,$allsource);
  24. fclose($fp);
  25. echo "<script>alert('Save OK!');</script>";
  26. }
  27. //读出
  28. if(empty($allsource) && filesize($m_file)>0)
  29. {
  30. $fp = fopen($m_file,'r');
  31. $allsource = fread($fp,filesize($m_file));
  32. fclose($fp);
  33. }
  34. $wintitle = "文章来源管理";
  35. $wecome_info = "文章来源管理";
  36. $win = new OxWindow();
  37. $win->Init('article_source_edit.php','js/blank.js','POST');
  38. $win->AddHidden('dopost','save');
  39. $win->AddTitle("每行保存一个来源:");
  40. $win->AddMsgItem("<textarea name='allsource' id='allsource' style='width:100%;height:300px'>$allsource</textarea>");
  41. $winform = $win->GetWindow('ok');
  42. $win->Display();