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

68 lines
2.6KB

  1. <?php
  2. if (!defined('DEDEMEMBER')) exit('dedebiz');
  3. /**
  4. * 文档验证
  5. *
  6. * @version $id:archives_check.php 13:52 2010年7月9日 tianya $
  7. * @package DedeBIZ.User
  8. * @copyright Copyright (c) 2022 DedeBIZ.COM
  9. * @license https://www.dedebiz.com/license
  10. * @link https://www.dedebiz.com
  11. */
  12. include_once(DEDEINC.'/image.func.php');
  13. include_once(DEDEINC.'/libraries/oxwindow.class.php');
  14. //校验CSRF
  15. CheckCSRF();
  16. $flag = '';
  17. $autokey = $remote = $dellink = $autolitpic = 0;
  18. $userip = GetIP();
  19. if ($typeid == 0) {
  20. ShowMsg('您还没选择栏目,请选择发布文档栏目', '-1');
  21. exit();
  22. }
  23. $query = "SELECT tp.ispart,tp.channeltype,tp.issend,ch.issend as cissend,ch.sendrank,ch.arcsta,ch.addtable,ch.fieldset,ch.usertype FROM `#@__arctype` tp LEFT JOIN `#@__channeltype` ch on ch.id=tp.channeltype WHERE tp.id='$typeid' ";
  24. $cInfos = $dsql->GetOne($query);
  25. //检测栏目是否有投稿权限
  26. if ($cInfos['issend'] != 1 || $cInfos['ispart'] != 0 || $cInfos['channeltype'] != $channelid || $cInfos['cissend'] != 1) {
  27. ShowMsg("您所选择的栏目不支持投稿", "-1");
  28. exit();
  29. }
  30. //检查栏目设定的投稿许可权限
  31. if ($cInfos['sendrank'] > $cfg_ml->M_Rank) {
  32. $row = $dsql->GetOne("SELECT membername FROM `#@__arcrank` WHERE `rank`='".$cInfos['sendrank']."' ");
  33. ShowMsg("需要<span class='text-primary'>".$row['membername']."</span>才能在这个栏目发布文档", "-1", "0", 5000);
  34. exit();
  35. }
  36. if ($cInfos['usertype'] != '' && $cInfos['usertype'] != $cfg_ml->M_MbType) {
  37. ShowMsg("需要<span class='text-primary'>".$cInfos['usertype']."</span>才能在这个栏目发布文档", "-1", "0", 5000);
  38. exit();
  39. }
  40. //文档的默认状态
  41. if ($cInfos['arcsta'] == 0) {
  42. $ismake = 0;
  43. $arcrank = 0;
  44. } else if ($cInfos['arcsta'] == 1) {
  45. $ismake = -1;
  46. $arcrank = 0;
  47. } else {
  48. $ismake = 0;
  49. $arcrank = -1;
  50. }
  51. //对保存的文档进行处理
  52. $money = 0;
  53. $flag = $shorttitle = $color = $source = '';
  54. $sortrank = $senddate = $pubdate = time();
  55. $title = cn_substrR(HtmlReplace($title, 1), $cfg_title_maxlen);
  56. $writer = cn_substrR(HtmlReplace($writer, 1), 20);
  57. if (empty($description)) $description = '';
  58. $description = cn_substrR(HtmlReplace($description, 1), 250);
  59. $keywords = cn_substrR(HtmlReplace($tags, 1), 30);
  60. $mid = $cfg_ml->M_ID;
  61. //检测文档是否重复
  62. if ($cfg_mb_cktitle == 'Y') {
  63. $row = $dsql->GetOne("SELECT * FROM `#@__archives` WHERE title LIKE '$title' ");
  64. if (is_array($row)) {
  65. ShowMsg("请不要发布重复文档", "-1", "0", 5000);
  66. exit();
  67. }
  68. }