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

67 lines
2.2KB

  1. <?php
  2. /**
  3. * Enter description here...
  4. *
  5. * @author Administrator
  6. * @package defaultPackage
  7. * @rcsfile $RCSfile: makehtml_story.php,v $
  8. * @revision $Revision: 1.1 $
  9. * @date $Date: 2008/12/11 02:09:55 $
  10. */
  11. require_once(dirname(__FILE__)."/config.php");
  12. require_once(DEDEROOT.'/book/include/story.view.class.php');
  13. CheckPurview('sys_MakeHtml');
  14. if(!isset($action)) $action = '';
  15. if(empty($startid)) $startid = 0;
  16. //更新HTML操作
  17. if($action=='make')
  18. {
  19. if(empty($start)) $start = 0;
  20. $addquery = " bid>='$startid' ";
  21. if(!empty($endid) && $endid>$startid ) $addquery .= " And bid<='$endid' ";
  22. if(!empty($catid)) $addquery .= " And (catid='$catid' Or bcatid='$catid') ";
  23. if(empty($makenum)) $makenum = 50;
  24. $dsql->SetQuery("Select SQL_CALC_FOUND_ROWS bid From #@__story_books where $addquery limit $start,$makenum ");
  25. $dsql->Execute();
  26. $n = 0;
  27. $row = $dsql->GetOne("SELECT FOUND_ROWS() as dd ");
  28. $limitrow = $row['dd'];
  29. while($row = $dsql->GetObject()){
  30. $start++;
  31. $bv = new BookView($row->bid,'book');
  32. $artUrl = $bv->MakeHtml(false);
  33. //echo "更新: <a href='$artUrl' target='_blank'>{$bv->Fields['bookname']}</a> OK!<br />\r\n";
  34. //echo $row->bid." - ";
  35. }
  36. if($start>=$limitrow){
  37. ShowMsg("完成所有HTML的更新!","javascript:;");
  38. }
  39. else{
  40. $hasMake = $limitrow - $start;
  41. if($limitrow>0) $proportion = 100 - ceil(($hasMake / $limitrow) * 100);
  42. ShowMsg("已更新至:{$proportion}% 继续更新其它内容...","makehtml_story.php?start={$start}&action=make&startid={$startid}&endid={$endid}&catid={$catid}&makenum={$makenum}");
  43. }
  44. exit();
  45. }
  46. //读取所有栏目
  47. $dsql->SetQuery("Select id,classname,pid,rank,booktype From #@__story_catalog order by rank asc");
  48. $dsql->Execute();
  49. $ranks = Array();
  50. $btypes = Array();
  51. $stypes = Array();
  52. $booktypes = Array();
  53. while($row = $dsql->GetArray()){
  54. if($row['pid']==0) $btypes[$row['id']] = $row['classname'];
  55. else $stypes[$row['pid']][$row['id']] = $row['classname'];
  56. $ranks[$row['id']] = $row['rank'];
  57. if($row['booktype']=='0') $booktypes[$row['id']] = '小说';
  58. else $booktypes[$row['id']] = '漫画';
  59. }
  60. $lastid = $row['id'];
  61. require_once(dirname(__FILE__)."/templets/makehtml_story.htm");
  62. ?>