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

95 lines
3.0KB

  1. <?php
  2. /**
  3. * @version $Id: story_edit_content_action.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. require_once(DEDEINC. "/oxwindow.class.php");
  12. require_once(DEDEROOT. "/book/include/story.func.php");
  13. if( empty($chapterid)
  14. || (!empty($addchapter) && !empty($chapternew)) )
  15. {
  16. if(empty($chapternew))
  17. {
  18. ShowMsg("由于你发布的内容没选择章节,系统拒绝发布!", "-1");
  19. exit();
  20. }
  21. $row = $dsql->GetOne("SELECT * From #@__story_chapter WHERE bookid='$bookid' ORDER BY chapnum DESC");
  22. if(is_array($row)) $nchapnum = $row['chapnum']+1;
  23. else $nchapnum = 1;
  24. $query = "INSERT INTO `#@__story_chapter`(`bookid`,`catid`,`chapnum`,`mid`,`chaptername`,`bookname`)
  25. VALUES ('$bookid', '$catid', '$nchapnum', '0', '$chapternew','$bookname');";
  26. $rs = $dsql->ExecuteNoneQuery($query);
  27. if($rs){
  28. $chapterid = $dsql->GetLastID();
  29. }
  30. else
  31. {
  32. ShowMsg("增加章节失败,请检查原因!", "-1");
  33. exit();
  34. }
  35. }
  36. //获得父栏目
  37. $nrow = $dsql->GetOne("SELECT * FROM #@__story_catalog WHERE id='$catid' ");
  38. $bcatid = $nrow['pid'];
  39. $booktype = $nrow['booktype'];
  40. if(empty($bcatid)) $bcatid = 0;
  41. if(empty($booktype)) $booktype = 0;
  42. $addtime = time();
  43. $inQuery = "
  44. UPDATE `#@__story_content` SET `title`='$title',`bookname`='$bookname',
  45. `chapterid`='$chapterid',`sortid`='$sortid',`body`=''
  46. WHERE id='$cid'
  47. ";
  48. if(!$dsql->ExecuteNoneQuery($inQuery)){
  49. ShowMsg("更新数据时出错,请检查!".str_repolace("'","`",$dsql->GetError().$inQuery),"-1");
  50. $dsql->Close();
  51. exit();
  52. }
  53. WriteBookText($cid,$body);
  54. if(empty($artcontentUrl))$artcontentUrl="";
  55. if($artcontentUrl=="") $artcontentUrl = $cfg_mainsite.$cfg_cmspath."/book/story.php?id={$cid}";
  56. require_once(DEDEROOT. "/book/include/story.view.class.php");
  57. $bv = new BookView($bookid,'book');
  58. $artUrl = $bv->MakeHtml();
  59. $bv->Close();
  60. //---------------------------------
  61. //返回成功信息
  62. //----------------------------------
  63. $msg = "
  64.   请选择你的后续操作:
  65. <a href='story_content_edit.php?cid={$cid}'><u>继续编辑</u></a>
  66. &nbsp;&nbsp;
  67. <a href='$artUrl' target='_blank'><u>预览小说</u></a>
  68. &nbsp;&nbsp;
  69. <a href='$artcontentUrl' target='_blank'><u>预览内容</u></a>
  70. &nbsp;&nbsp;
  71. <a href='story_list_content.php?bookid={$bookid}'><u>本书所有内容</u></a>
  72. &nbsp;&nbsp;
  73. <a href='story_books.php'><u>管理所有图书</u></a>
  74. ";
  75. $wintitle = "成功修改文章!";
  76. $wecome_info = "连载管理::发布文章";
  77. $win = new OxWindow();
  78. $win->AddTitle("成功修改文章:");
  79. $win->AddMsgItem($msg);
  80. $winform = $win->GetWindow("hand", "&nbsp;", false);
  81. $win->Display();
  82. //ClearAllLink();