From 8c819b6aa7b076d58e0733686ae62373f4f9599a Mon Sep 17 00:00:00 2001 From: "zhangf@suq.cn" Date: Mon, 2 Feb 2026 15:17:37 +0800 Subject: [PATCH] =?UTF-8?q?feat(article):=20=E6=B7=BB=E5=8A=A0=E8=BF=85?= =?UTF-8?q?=E6=B5=81=E6=96=B0=E9=97=BB=E6=96=87=E7=AB=A0=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 集成文章发布模块,支持自定义字段和属性处理 - 实现文章基本属性设置和状态管理 - 添加远程图片保存和链接清理功能 - 集成微博同步发布功能 - 实现积分扣费和权限验证机制 - 支持文章审核流程和HTML页面生成功能 --- member/xunliuAddNews.php | 83 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 member/xunliuAddNews.php diff --git a/member/xunliuAddNews.php b/member/xunliuAddNews.php new file mode 100644 index 0000000..826d58e --- /dev/null +++ b/member/xunliuAddNews.php @@ -0,0 +1,83 @@ + $DT['quick_pay']; +$need_captcha = $MOD['captcha_add'] == 2 ? $MG['captcha'] : $MOD['captcha_add']; +$need_question = $MOD['question_add'] == 2 ? $MG['question'] : $MOD['question_add']; +$could_color = check_group($_groupid, $MOD['group_color']) && $MOD['credit_color'] && $_userid; + + +if(isset($post['islink'])) unset($post['islink']); + +if($do->pass($post)) { + $CAT = get_cat($post['catid']); + if(!$CAT || !check_group($_groupid, $CAT['group_add'])) { + dalert(lang($L['group_add'], array($CAT['catname']))); + } + + // 设置文章基本属性 + $post['addtime'] = $post['level'] = $post['fee'] = 0; + $post['style'] = $post['template'] = $post['note'] = $post['filepath'] = ''; + $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; + $post['status'] = get_status(3, $need_check); + $post['hits'] = 0; + $post['username'] = $_username; + $post['save_remotepic'] = $MOD['save_remotepic'] ? 1 : 0; + $post['clear_link'] = $MOD['clear_link'] ? 1 : 0; + $post['introduce_length'] = $MOD['introduce_length'] ? $MOD['introduce_length'] : 0; + $post['areaid'] = $cityid; + + // 处理自定义字段和属性 + if($FD) fields_check($post_fields); + if($CP) property_check($post_ppt); + + // 处理颜色样式 + if($could_color && $color && $_credit > $MOD['credit_color']) { + $post['style'] = $color; + credit_add($_username, -$MOD['credit_color']); + credit_record($_username, -$MOD['credit_color'], 'system', $L['title_color'], '['.$MOD['name'].']'.$post['title']); + } + $do->table = get_table(21); + $MOD = cache_read('module-21.php'); + $table = $do->table; + // 添加文章 + $do->add($post); + + // 更新自定义字段和属性 + if($FD) fields_update($post_fields, $table, $do->itemid); + if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid); + + // 生成HTML页面 + if($MOD['show_html'] && $post['status'] > 2) $do->tohtml($do->itemid); + + $msg = $post['status'] == 2 ? $L['success_check'] : $L['success_add']; + $js = ''; + if(isset($post['sync_sina']) && $post['sync_sina']) { + $js .= sync_weibo('sina', $moduleid, $do->itemid); + } +} +?> \ No newline at end of file