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

89 lines
2.8KB

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