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

60 lines
1.7KB

  1. <?php
  2. /**
  3. * @version $Id: story_add_photo.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($bookinfos['booktype']==0)
  19. {
  20. header("location:story_add_content.php?bookid={$bookid}");
  21. exit();
  22. }
  23. //读取所有栏目
  24. $dsql->SetQuery("SELECT id,classname,pid,rank FROM #@__story_catalog ORDER BY rank ASC");
  25. $dsql->Execute();
  26. $ranks = Array();
  27. $btypes = Array();
  28. $stypes = Array();
  29. while($row = $dsql->GetArray())
  30. {
  31. if($row['pid']==0)
  32. {
  33. $btypes[$row['id']] = $row['classname'];
  34. }
  35. else
  36. {
  37. $stypes[$row['pid']][$row['id']] = $row['classname'];
  38. }
  39. $ranks[$row['id']] = $row['rank'];
  40. }
  41. $lastid = $row['id'];
  42. $msg = '';
  43. $dsql->SetQuery("SELECT id,chapnum,chaptername FROM #@__story_chapter WHERE bookid='$bookid' ORDER BY chapnum DESC");
  44. $dsql->Execute();
  45. $chapters = Array();
  46. $chapnums = Array();
  47. while($row = $dsql->GetArray())
  48. {
  49. $chapters[$row['id']] = $row['chaptername'];
  50. $chapnums[$row['id']] = $row['chapnum'];
  51. }
  52. $catid = $bookinfos['catid'];
  53. $bcatid = $bookinfos['bcatid'];
  54. $bookname = $bookinfos['bookname'];
  55. $booktype = $bookinfos['booktype'];
  56. require_once DedeInclude('/templets/story_add_photo.htm');