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

makehtml_freelist_action.php 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /**
  3. * 生成自由列表操作
  4. *
  5. * @version $Id: makehtml_freelist_action.php 1 9:11 2010年7月19日Z tianya $
  6. * @package DedeCMS.Administrator
  7. * @copyright Copyright (c) 2020, DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license/v6
  9. * @link https://www.dedebiz.com
  10. */
  11. require_once(dirname(__FILE__)."/config.php");
  12. CheckPurview('sys_MakeHtml');
  13. require_once(DEDEINC."/arc.freelist.class.php");
  14. if(empty($startid)) $startid = 0;
  15. $ci = " aid >= $startid ";
  16. if(!empty($endid) && $endid>=$startid)
  17. {
  18. $ci .= " And aid <= $endid ";
  19. }
  20. header("Content-Type: text/html; charset={$cfg_soft_lang}");
  21. $dsql->SetQuery("SELECT aid FROM `#@__freelist` WHERE $ci");
  22. $dsql->Execute();
  23. while($row=$dsql->GetArray())
  24. {
  25. $idArray[] = $row['aid'];
  26. }
  27. if(!isset($pageno)) $pageno=0;
  28. if(empty($idArray)) $idArray = '';
  29. $totalpage = count($idArray);
  30. if(isset($idArray[$pageno]))
  31. {
  32. $lid = $idArray[$pageno];
  33. } else {
  34. ShowMsg( "完成所有文件创建!", 'javascript:;');
  35. exit();
  36. }
  37. $lv = new FreeList($lid);
  38. $ntotalpage = $lv->TotalPage;
  39. if(empty($mkpage)) $mkpage = 1;
  40. if(empty($maxpagesize)) $maxpagesize = 50;
  41. //如果栏目的文档太多,分多批次更新
  42. if($ntotalpage<=$maxpagesize)
  43. {
  44. $lv->MakeHtml();
  45. $finishType = true;
  46. }else
  47. {
  48. $lv->MakeHtml($mkpage,$maxpagesize);
  49. $finishType = false;
  50. $mkpage = $mkpage + $maxpagesize;
  51. if( $mkpage >= ($ntotalpage+1) )
  52. {
  53. $finishType = true;
  54. }
  55. }
  56. $lv->Close();
  57. $nextpage = $pageno+1;
  58. if($nextpage==$totalpage)
  59. {
  60. ShowMsg( "完成所有文件创建!", 'javascript:;');
  61. }
  62. else
  63. {
  64. if($finishType)
  65. {
  66. $gourl = "makehtml_freelist_action.php?maxpagesize=$maxpagesize&startid=$startid&endid=$endid&pageno=$nextpage";
  67. ShowMsg("成功创建列表:".$tid.",继续进行操作!",$gourl,0,100);
  68. }
  69. else
  70. {
  71. $gourl = "makehtml_freelist_action.php?mkpage=$mkpage&maxpagesize=$maxpagesize&startid=$startid&endid=$endid&pageno=$pageno";
  72. ShowMsg("列表:".$tid.",继续进行操作...",$gourl,0,100);
  73. }
  74. }
  75. $dsql->ExecuteNoneQuery("Update `#@__freelist` set nodefault='1' where aid='$startid';");