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

62 line
1.8KB

  1. <?php
  2. /**
  3. * @version $Id: story_add_content.php 1 9:02 2010年9月25日Z 蓝色随想 $
  4. * @package DedeCMS.Module.Book
  5. * @copyright Copyright (c) 2007 - 2020, DesDev, Inc.
  6. * @license http://help.dedecms.com/usersguide/license.html
  7. * @link http://www.dedecms.com
  8. */
  9. require_once(dirname(__FILE__). "/config.php");
  10. CheckPurview('story_New');
  11. if(!isset($action)) $action = '';
  12. if(empty($bookid))
  13. {
  14. ShowMsg("参数错误!","-1");
  15. exit();
  16. }
  17. $bookinfos = $dsql->GetOne("SELECT catid,bcatid,bookname,booktype FROM #@__story_books WHERE bid='$bookid' ");
  18. if(empty($bookinfos['booktype'])) $bookinfos['booktype'] = '';
  19. if($bookinfos['booktype']==1)
  20. {
  21. header("location:story_add_photo.php?bookid={$bookid}");
  22. exit();
  23. }
  24. //读取所有栏目
  25. $dsql->SetQuery("SELECT id,classname,pid,rank FROM #@__story_catalog ORDER BY rank ASC");
  26. $dsql->Execute();
  27. $ranks = Array();
  28. $btypes = Array();
  29. $stypes = Array();
  30. while($row = $dsql->GetArray())
  31. {
  32. if($row['pid']==0)
  33. {
  34. $btypes[$row['id']] = $row['classname'];
  35. }
  36. else
  37. {
  38. $stypes[$row['pid']][$row['id']] = $row['classname'];
  39. }
  40. $ranks[$row['id']] = $row['rank'];
  41. }
  42. $lastid = $row['id'];
  43. $msg = '';
  44. $dsql->SetQuery("SELECT id,chapnum,chaptername FROM #@__story_chapter WHERE bookid='$bookid' ORDER BY chapnum DESC");
  45. $dsql->Execute();
  46. $chapters = Array();
  47. $chapnums = Array();
  48. while($row = $dsql->GetArray())
  49. {
  50. $chapters[$row['id']] = $row['chaptername'];
  51. $chapnums[$row['id']] = $row['chapnum'];
  52. }
  53. $catid = $bookinfos['catid'];
  54. $bcatid = $bookinfos['bcatid'];
  55. $bookname = $bookinfos['bookname'];
  56. $booktype = $bookinfos['booktype'];
  57. require_once(DEDEADMIN. '/templets/story_add_content.htm');