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

113 lines
3.5KB

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