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

55 lines
1.7KB

  1. <?php
  2. /**
  3. * @version $Id: story_photo_edit.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_Edit');
  11. if(!isset($action)) $action = '';
  12. if(empty($cid))
  13. {
  14. ShowMsg("参数错误!", "-1");
  15. exit();
  16. }
  17. //读取所有栏目
  18. $dsql->SetQuery("SELECT id,classname,pid,rank FROM #@__story_catalog ORDER BY rank ASC");
  19. $dsql->Execute();
  20. $ranks = Array();
  21. $btypes = Array();
  22. $stypes = Array();
  23. while($row = $dsql->GetArray())
  24. {
  25. if($row['pid']==0)
  26. {
  27. $btypes[$row['id']] = $row['classname'];
  28. }
  29. else
  30. {
  31. $stypes[$row['pid']][$row['id']] = $row['classname'];
  32. }
  33. $ranks[$row['id']] = $row['rank'];
  34. }
  35. $lastid = $row['id'];
  36. $contents = $dsql->GetOne("SELECT * FROM #@__story_content WHERE id='$cid' ");
  37. $bookinfos = $dsql->GetOne("SELECT catid,bcatid,bookname,booktype FROM #@__story_books WHERE bid='{$contents['bookid']}' ");
  38. $catid = $bookinfos['catid'];
  39. $bcatid = $bookinfos['bcatid'];
  40. $bookname = $bookinfos['bookname'];
  41. $booktype = $bookinfos['booktype'];
  42. $bookid = $contents['bookid'];
  43. $dsql->SetQuery("SELECT id,chapnum,chaptername FROM #@__story_chapter WHERE bookid='{$contents['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. require_once DedeInclude('/templets/story_photo_edit.htm');