diff --git a/upload/install/data/install.sql b/upload/install/data/install.sql index 76065be14bed1d70aca8b8eaacfe69e6cb7c6f9c..64cf0f487d5b6b728fd8e2909bb699d40f5a5c5c 100644 --- a/upload/install/data/install.sql +++ b/upload/install/data/install.sql @@ -804,6 +804,8 @@ CREATE TABLE pre_common_member_field_home ( domain char(15) NOT NULL DEFAULT '', addsize int(10) unsigned NOT NULL DEFAULT '0', addfriend smallint(6) unsigned NOT NULL DEFAULT '0', + allowasfriend tinyint(1) NOT NULL DEFAULT '1', + allowasfollow tinyint(1) NOT NULL DEFAULT '1', menunum smallint(6) unsigned NOT NULL DEFAULT '0', theme varchar(20) NOT NULL DEFAULT '', spacecss text NOT NULL, diff --git a/upload/source/admincp/admincp_usergroups.php b/upload/source/admincp/admincp_usergroups.php index 9a9df39d09db570e1febe0625bd41b6c5195b3ef..9515c4b16a1efb7e52fee16a9a50983eb67ad327 100644 --- a/upload/source/admincp/admincp_usergroups.php +++ b/upload/source/admincp/admincp_usergroups.php @@ -579,7 +579,7 @@ EOT; showsetting('usergroups_edit_basic_domain_length', 'domainlengthnew', $group['domainlength'], 'text'); showsetting('usergroups_edit_basic_invisible', 'allowinvisiblenew', $group['allowinvisible'], 'radio'); showsetting('usergroups_edit_basic_allowtransfer', 'allowtransfernew', $group['allowtransfer'], 'radio'); - showsetting('usergroups_edit_basic_allowfollow', 'allowfollownew', $group['allowfollow'], 'radio', 0, 1); + showsetting('usergroups_edit_basic_allowfollow', 'allowfollownew', $group['allowfollow'], 'radio'); showsetting('usergroups_edit_basic_allowsendpm', 'allowsendpmnew', $group['allowsendpm'], 'radio', 0, 1); showsetting('usergroups_edit_pm_sendpmmaxnum', 'allowsendpmmaxnumnew', $group['allowsendpmmaxnum'], 'text'); showsetting('usergroups_edit_pm_sendallpm', 'allowsendallpmnew', $group['allowsendallpm'], 'radio'); diff --git a/upload/source/include/spacecp/spacecp_follow.php b/upload/source/include/spacecp/spacecp_follow.php index 361193a4c34c55e40f144eab3f6b5c36c66c815d..deefefea7618b42e257baa9871ccfbd60d627ad4 100644 --- a/upload/source/include/spacecp/spacecp_follow.php +++ b/upload/source/include/spacecp/spacecp_follow.php @@ -31,6 +31,14 @@ if($op == 'add') { } $special = intval($_GET['special']) ? intval($_GET['special']) : 0; $followuser = getuserbyuid($followuid); + if(empty($followuser)) { + showmessage('space_does_not_exist'); + } + // 允许单个用户屏蔽所有人收听 Ta + $fields = C::t('common_member_field_home')->fetch($followuid); + if(!$fields['allowasfollow']) { + showmessage('follow_other_unfollow'); + } $mutual = 0; $followed = C::t('home_follow')->fetch_by_uid_followuid($followuid, $_G['uid']); if(!empty($followed)) { diff --git a/upload/source/include/spacecp/spacecp_friend.php b/upload/source/include/spacecp/spacecp_friend.php index 6e83b245e5d3c78c91e985cea0d1b8496cba84bf..0e6a1cc943a0b39a2e4f13fa18896544c4f23f8f 100644 --- a/upload/source/include/spacecp/spacecp_friend.php +++ b/upload/source/include/spacecp/spacecp_friend.php @@ -44,6 +44,12 @@ if($op == 'add') { showmessage('space_does_not_exist'); } + // 允许单个用户屏蔽所有人加 Ta 为好友 + $fields = C::t('common_member_field_home')->fetch($uid); + if(!$fields['allowasfriend']) { + showmessage('is_blacklist'); + } + if(isblacklist($tospace['uid'])) { showmessage('is_blacklist'); } diff --git a/upload/source/include/spacecp/spacecp_privacy.php b/upload/source/include/spacecp/spacecp_privacy.php index 23f6a87cbdd7e81d21cd8f73c65b4123326b79cb..ca6d5bb5c656e0c0a2883f27d25398ae1fdf004b 100644 --- a/upload/source/include/spacecp/spacecp_privacy.php +++ b/upload/source/include/spacecp/spacecp_privacy.php @@ -12,7 +12,7 @@ if(!defined('IN_DISCUZ')) { } space_merge($space, 'field_home'); -$operation = in_array(getgpc('op'), array('base', 'feed', 'filter', 'getgroup')) ? trim($_GET['op']) : 'base'; +$operation = in_array(getgpc('op'), array('base', 'feed', 'filter', 'other', 'getgroup')) ? trim($_GET['op']) : 'base'; if(submitcheck('privacysubmit')) { @@ -63,6 +63,22 @@ if(submitcheck('privacysubmit')) { require_once libfile('function/friend'); friend_cache($_G['uid']); + showmessage('do_success', 'home.php?mod=spacecp&ac=privacy&op='.$operation); + +} elseif(submitcheck('privacy3submit')) { + + $arr = array(); + + if(isset($_POST['allowasfriend'])) { + $arr['allowasfriend'] = (int)$_POST['allowasfriend']; + } + + if(isset($_POST['allowasfollow'])) { + $arr['allowasfollow'] = (int)$_POST['allowasfollow']; + } + + C::t('common_member_field_home')->update($_G['uid'], $arr); + showmessage('do_success', 'home.php?mod=spacecp&ac=privacy&op='.$operation); } @@ -89,6 +105,15 @@ if($operation == 'filter') { } } +} elseif ($operation == 'other') { + + $arr = array(); + + $fields = C::t('common_member_field_home')->fetch($_G['uid']); + + $arr['allowasfriend'][$fields['allowasfriend']] = ' selected="selected"'; + $arr['allowasfollow'][$fields['allowasfollow']] = ' selected="selected"'; + } elseif ($operation == 'getgroup') { $gid = empty($_GET['gid'])?0:intval($_GET['gid']); diff --git a/upload/source/language/home/lang_template.php b/upload/source/language/home/lang_template.php index e1ab52e9ecffab25a5f3a15be9339814f48050b5..1af92ca1ff71cdf56c8be0047ab0b08d90cdfe3c 100644 --- a/upload/source/language/home/lang_template.php +++ b/upload/source/language/home/lang_template.php @@ -435,6 +435,8 @@ $lang = array ( 'friend_list' => '好友列表', 'friend_message' => '按照好友热度排序', 'friends' => '好友', + 'add_friends' => '添加好友', + 'add_follow' => '添加收听', 'ignore_group_feed' => '屏蔽用户组动态', 'interactive' => '互动', 'manage' => '管理', @@ -1326,6 +1328,7 @@ $lang = array ( 'open_privacy' => '公开', 'personal_feed' => '动态', 'personal_feed_settings' => '个人动态发布设置', + 'personal_other_settings' => '平台用户间互动设置', 'personal_main_page' => '个人主页', 'personal_privacy_settings' => '个人隐私设置', 'pic_blog_position' => '对日志/图片表态', @@ -1349,6 +1352,7 @@ $lang = array ( 'view_right_setting_effective' => '相关浏览权限需要在发表时单独设置方可完全生效', 'write_blog' => '撰写日志', 'you_control_see_content' => '您可以完全控制哪些人可以看到您的主页上面的内容', + 'you_control_other_operation' => '您可以完全控制其他用户是否可以和您进行互动', 'check_date_item' => '请检查该资料项', 'current_time' => '当前时间', 'email' => 'Email', diff --git a/upload/template/default/home/spacecp_privacy.htm b/upload/template/default/home/spacecp_privacy.htm index 314c8f8903cca8082729964f737f9227815f6fb4..59c58ba04e59363884e848c53edc3b5ea8d3a8e4 100644 --- a/upload/template/default/home/spacecp_privacy.htm +++ b/upload/template/default/home/spacecp_privacy.htm @@ -7,6 +7,9 @@ {lang personal_feed_settings} {lang feed_filter} + + {lang personal_other_settings} +
@@ -140,6 +143,38 @@ + +

{lang you_control_other_operation}

+ + + + + + + + + + + + + + + + + + +
{lang add_friends} + +
{lang add_follow} + +
 
+ {eval