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

  1. <?php
  2. /**
  3. * 生成js操作
  4. *
  5. * @version $Id: makehtml_js_action.php 1 11:04 2010年7月19日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. CheckPurview('sys_MakeHtml');
  13. require_once(DEDEINC."/arc.partview.class.php");
  14. if(empty($typeid)) $typeid = 0;
  15. $isremote = empty($isremote)? 0 : $isremote;
  16. $serviterm=empty($serviterm)? "" : $serviterm;
  17. if(empty($templet)) $templet = "plus/js.htm";
  18. if(empty($uptype)) $uptype = "all";
  19. if($cfg_remote_site=='Y' && $isremote=="1")
  20. {
  21. if($serviterm!="")
  22. {
  23. list($servurl, $servuser, $servpwd) = explode(',',$serviterm);
  24. $config=array( 'hostname' => $servurl, 'username' => $servuser,
  25. 'password' => $servpwd,'debug' => 'TRUE');
  26. } else {
  27. $config=array();
  28. }
  29. if(!$ftp->connect($config)) exit('Error:None FTP Connection!');
  30. }
  31. if($uptype == "all")
  32. {
  33. $row = $dsql->GetOne("SELECT id FROM #@__arctype WHERE id>'$typeid' AND ispart<>2 ORDER BY id ASC LIMIT 0,1;");
  34. if(!is_array($row))
  35. {
  36. echo "完成所有文件更新!";
  37. exit();
  38. } else {
  39. $pv = new PartView($row['id']);
  40. $pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet);
  41. $pv->SaveToHtml($cfg_basedir.$cfg_cmspath."/data/js/".$row['id'].".js",$isremote);
  42. $typeid = $row['id'];;
  43. ShowMsg("成功更新".$cfg_cmspath."/data/js/".$row['id'].".js,继续进行操作!","makehtml_js_action.php?typeid=$typeid&isremote=$isremote&serviterm=$serviterm",0,100);
  44. exit();
  45. }
  46. } else {
  47. $pv = new PartView($typeid);
  48. $pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet);
  49. $pv->SaveToHtml($cfg_basedir.$cfg_cmspath."/data/js/".$typeid.".js",$isremote);
  50. echo "成功更新".$cfg_cmspath."/data/js/".$typeid.".js!";
  51. echo "预览:";
  52. echo "<hr>";
  53. echo "<script src='".$cfg_cmspath."/data/js/".$typeid.".js'></script>";
  54. exit();
  55. }