From d8608f79aca5948d135c1080e117a723d318be79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Wed, 23 Jun 2021 22:24:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E8=A2=AB=E5=85=B3?= =?UTF-8?q?=E6=B3=A8=E6=97=B6=E9=80=9A=E7=9F=A5=E8=A2=AB=E5=85=B3=E6=B3=A8?= =?UTF-8?q?=E8=80=85=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/install/data/install_data.sql | 1 + upload/source/admincp/admincp_setting.php | 1 + upload/source/include/spacecp/spacecp_follow.php | 4 +++- upload/source/language/lang_admincp.php | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/upload/install/data/install_data.sql b/upload/install/data/install_data.sql index b8c148cb2..64301010a 100644 --- a/upload/install/data/install_data.sql +++ b/upload/install/data/install_data.sql @@ -559,6 +559,7 @@ INSERT INTO pre_common_setting VALUES ('report_receive', 'a:2:{s:9:"adminuser";a INSERT INTO pre_common_setting VALUES ('leftsideopen', '0'); INSERT INTO pre_common_setting VALUES ('showexif', '0'); INSERT INTO pre_common_setting VALUES ('followretainday', '7'); +INSERT INTO pre_common_setting VALUES ('followaddnotice', '0'); INSERT INTO pre_common_setting VALUES ('newbie', '20'); INSERT INTO pre_common_setting VALUES ('collectionteamworkernum', '3'); INSERT INTO pre_common_setting VALUES ('collectionnum', '10'); diff --git a/upload/source/admincp/admincp_setting.php b/upload/source/admincp/admincp_setting.php index d87b7e6cc..d3582bb8a 100644 --- a/upload/source/admincp/admincp_setting.php +++ b/upload/source/admincp/admincp_setting.php @@ -221,6 +221,7 @@ if(!submitcheck('settingsubmit')) { /*search={"setting_follow":"action=setting&operation=follow","setting_follow_base":"action=setting&operation=follow&anchor=base"}*/ showtableheader('', 'nobottom', 'id="base"'.($_GET['anchor'] != 'base' ? ' style="display: none"' : '')); showsetting('setting_follow_base_default_follow_retain_day', 'settingnew[followretainday]', $setting['followretainday'], 'text'); + showsetting('setting_follow_base_default_follow_add_notice', 'settingnew[followaddnotice]', $setting['followaddnotice'], 'radio'); showsetting('setting_follow_base_default_view_profile', 'settingnew[allowquickviewprofile]', $setting['allowquickviewprofile'], 'radio'); showtablefooter(); /*search*/ diff --git a/upload/source/include/spacecp/spacecp_follow.php b/upload/source/include/spacecp/spacecp_follow.php index 56c40df8d..f75cd5567 100644 --- a/upload/source/include/spacecp/spacecp_follow.php +++ b/upload/source/include/spacecp/spacecp_follow.php @@ -46,7 +46,9 @@ if($op == 'add') { C::t('home_follow')->insert($followdata, false, true); C::t('common_member_count')->increase($_G['uid'], array('following' => 1)); C::t('common_member_count')->increase($followuid, array('follower' => 1, 'newfollower' => 1)); - notification_add($followuid, 'follower', 'member_follow_add', array('count' => $count, 'from_id'=>$_G['uid'], 'from_idtype' => 'following'), 1); + if($_G['setting']['followaddnotice']) { + notification_add($followuid, 'follower', 'member_follow_add', array('count' => $count, 'from_id'=>$_G['uid'], 'from_idtype' => 'following'), 1); + } } elseif($special) { $status = $special == 1 ? 1 : 0; C::t('home_follow')->update_by_uid_followuid($_G['uid'], $followuid, array('status'=>$status)); diff --git a/upload/source/language/lang_admincp.php b/upload/source/language/lang_admincp.php index 04d036985..0d86ab922 100644 --- a/upload/source/language/lang_admincp.php +++ b/upload/source/language/lang_admincp.php @@ -1171,6 +1171,8 @@ $lang = array 'setting_follow_base_default_follow_retain_day_comment' => '广播超过多少天移入存档表(单位:天)', 'setting_follow_base_default_view_profile' => '默认查看个人资料', 'setting_follow_base_default_view_profile_comment' => '该设置对管理员有效,开启后默认管理员查看将直接查看个人资料页面', + 'setting_follow_base_default_follow_add_notice' => '被关注时通知被关注者', + 'setting_follow_base_default_follow_add_notice_comment' => '开启后用户被关注时将会收到通知', 'setting_home' => '空间设置', 'setting_home_base' => '基本设置', 'setting_home_base_feedday' => '动态保留天数', -- Gitee