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

82 lines
2.9KB

  1. <?php
  2. /**
  3. * @version $Id: story_add_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_New');
  11. require_once(DEDEINC. "/image.func.php");
  12. require_once(DEDEINC. "/oxwindow.class.php");
  13. require_once(dirname(__FILE__). "/inc/inc_archives_functions.php");
  14. if(!isset($iscommend))
  15. {
  16. $iscommend = 0;
  17. }
  18. if($catid==0)
  19. {
  20. ShowMsg("请指定图书所属栏目!", "-1");
  21. exit();
  22. }
  23. //获得父栏目
  24. $nrow = $dsql->GetOne("SELECT * FROM #@__story_catalog WHERE id='$catid' ");
  25. $bcatid = $nrow['pid'];
  26. $booktype = $nrow['booktype'];
  27. $pubdate = GetMkTime($pubdate);
  28. $bookname = cn_substr($bookname,50);
  29. if($keywords!="") $keywords = trim(cn_substr($keywords,60));
  30. if(empty($author))$author=$cuserLogin->getUserName();
  31. //处理上传的缩略图
  32. if($litpic != ""){
  33. $litpic = GetDDImage('litpic',$litpicname,0);
  34. }
  35. $adminID = $cuserLogin->getUserID();
  36. //自动摘要
  37. if($description=="" && $cfg_auot_description>0)
  38. {
  39. $description = stripslashes(cn_substr(html2text($body),$cfg_auot_description));
  40. $description = addslashes($description);
  41. }
  42. $inQuery = "
  43. INSERT INTO `#@__story_books`(`catid`,`bcatid`,`booktype`,`iscommend`,`click`,`freenum`,`bookname`,`author`,`mid`,`litpic`,`pubdate`,`lastpost`,`postnum`,`lastfeedback`,`feedbacknum`,`weekcc`,`monthcc`,`weekup`,`monthup`,`description`,`body`,`keywords`,`userip`,`senddate` ,`arcrank`,`goodpost`,`badpost`,`notpost`) VALUES ('$catid','$bcatid','$booktype', '$iscommend', '$click', '$freenum', '$bookname', '$author', '0', '$litpic', '$pubdate', '$pubdate', '0', '0', '0', '0', '0', '0', '0', '$description' , '$body' , '$keywords', '','".time()."','$arcrank','0','0','0')";
  44. if(!$dsql->ExecuteNoneQuery($inQuery))
  45. {
  46. ShowMsg("把数据保存到数据库时出错,请检查!","-1");
  47. exit();
  48. }
  49. $arcID = $dsql->GetLastID();
  50. //生成HTML
  51. require_once(DEDEROOT. '/book/include/story.view.class.php');
  52. $bv = new BookView($arcID, 'book');
  53. $artUrl = $bv->MakeHtml();
  54. $bv->Close();
  55. //返回成功信息
  56. $msg = "
  57.   请选择你的后续操作:
  58. <a href='./story_add.php?catid=$catid'><u>继续发布图书</u></a>
  59. &nbsp;&nbsp;
  60. <a href='$artUrl' target='_blank'><u>查看图书</u></a>
  61. &nbsp;&nbsp;
  62. <a href='./story_add_content.php?bookid={$arcID}'><u>增加图书内容</u></a>
  63. &nbsp;&nbsp;
  64. <a href='./story_books.php'><u>管理图书</u></a>
  65. ";
  66. $wintitle = "成功发布图书!";
  67. $wecome_info = "连载管理::发布图书";
  68. $win = new OxWindow();
  69. $win->AddTitle("成功发布一本图书:");
  70. $win->AddMsgItem($msg);
  71. $winform = $win->GetWindow("hand", "&nbsp;", false);
  72. $win->Display();