Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Diego Andrés on July 07, 2013, 04:40:07 PM

Title: Private Profile
Post by: Diego Andrés on July 07, 2013, 04:40:07 PM
Link to the mod (https://custom.simplemachines.org/index.php?mod=3721)

Private Profile
If you need to report a bug, please do so on GitHub! (https://github.com/Yoshi2889/PrivateProfile)

This mod allows users to hide their profile (make it private).


How to install:
The Package Manager should work in most cases.

Languages:
- English

Features:
- Allows users to hide their profile.
- The mod can override various permissions to gain access to previously unavailable profiles; can be disabled and is disabled by default.
- The mod uses permissions to allow members to change their visibility settings; if they are not able to do so, the mod shows them the current setting applied to their profile.

Idea List:
- Make mod smarter depending on the forum settings (only show hide for guests option when guests can view profile etc.)

Changelog:
v0.3.2:
! Fixed critical bug (I thought I fixed that...)

v0.3.1:
! Bug fixed

v0.3:
+ Added "Only to buddies"
+ Added new settings, for both admins and users
+ Added reset switches

v0.2.1:
! Fixed a bug which randomly occured.

v0.2:
+ Added options to only show to guests or members, or to show to nobody but myself.
+ Added permissions.
+ Added setting to choose whether Private Profile is allowed to override profile permissions.

v0.1:
- Initial release

License:
This mod is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported license. (http://creativecommons.org/licenses/by-sa/3.0/)
Title: Re: Private Profile
Post by: Rain Forest on July 07, 2013, 04:48:38 PM
Nice mod! :)

Is there a way to open your profile to buddies only?
Title: Re: Private Profile
Post by: NanoSector on July 07, 2013, 04:55:54 PM
Quote from: 4Three on July 07, 2013, 04:48:38 PM
Nice mod! :)

Is there a way to open your profile to buddies only?
Thanks :)

Nope, but I will add that in the next version.
Title: Re: Private Profile
Post by: Rain Forest on July 07, 2013, 04:59:25 PM
Quote from: Yoshi on July 07, 2013, 04:55:54 PM
Quote from: 4Three on July 07, 2013, 04:48:38 PM
Nice mod! :)

Is there a way to open your profile to buddies only?
Thanks :)

Nope, but I will add that in the next version.
Ok, thanks Yoshi :)

Another note: make it 'everyone' on default (instead of 'nobody but myself') :)

(I changed my softy avatar :P)
Title: Re: Private Profile
Post by: NanoSector on July 07, 2013, 05:12:21 PM
Quote from: 4Three on July 07, 2013, 04:59:25 PM
Quote from: Yoshi on July 07, 2013, 04:55:54 PM
Quote from: 4Three on July 07, 2013, 04:48:38 PM
Nice mod! :)

Is there a way to open your profile to buddies only?
Thanks :)

Nope, but I will add that in the next version.
Ok, thanks Yoshi :)

Another note: make it 'everyone' on default (instead of 'nobody but myself') :)

(I changed my softy avatar :P)
Hm? It is members only by default.

(noes, now my counterpart is gone :o)
Title: Re: Private Profile
Post by: Rain Forest on July 07, 2013, 05:22:45 PM
Quote from: Yoshi on July 07, 2013, 05:12:21 PM
Quote from: 4Three on July 07, 2013, 04:59:25 PM
Quote from: Yoshi on July 07, 2013, 04:55:54 PM
Quote from: 4Three on July 07, 2013, 04:48:38 PM
Nice mod! :)

Is there a way to open your profile to buddies only?
Thanks :)

Nope, but I will add that in the next version.
Ok, thanks Yoshi :)

Another note: make it 'everyone' on default (instead of 'nobody but myself') :)

(I changed my softy avatar :P)
Hm? It is members only by default.

(noes, now my counterpart is gone :o)

Ah! When I go to Profile > Modify profile > Account settings it says: Allow my profile to be viewed by 'Nobody but me' without changing it. :)
Title: Re: Private Profile
Post by: 4Kstore on July 08, 2013, 06:08:48 PM
Cool idea, I would suggest the same:

Quote from: Soft Drink on July 07, 2013, 04:48:38 PM
Is there a way to open your profile to buddies only?

Thanks for share!
Title: Re: Private Profile
Post by: NanoSector on July 10, 2013, 05:29:49 AM
Quote from: Soft Drink on July 07, 2013, 05:22:45 PM
Quote from: Yoshi on July 07, 2013, 05:12:21 PM
Quote from: 4Three on July 07, 2013, 04:59:25 PM
Quote from: Yoshi on July 07, 2013, 04:55:54 PM
Quote from: 4Three on July 07, 2013, 04:48:38 PM
Nice mod! :)

Is there a way to open your profile to buddies only?
Thanks :)

Nope, but I will add that in the next version.
Ok, thanks Yoshi :)

Another note: make it 'everyone' on default (instead of 'nobody but myself') :)

(I changed my softy avatar :P)
Hm? It is members only by default.

(noes, now my counterpart is gone :o)

Ah! When I go to Profile > Modify profile > Account settings it says: Allow my profile to be viewed by 'Nobody but me' without changing it. :)
Weird, it is made to set that to Members only by default... However I can make a query for you which changes this for all members, if you want.

And thanks 4Kstore :)
Title: Re: Private Profile
Post by: Mr. Pedram on July 10, 2013, 12:05:29 PM
Really Nice! ;)
Title: Re: Private Profile
Post by: NanoSector on July 12, 2013, 08:15:29 PM
v0.3 up which adds all requested features and more :)
Title: Re: Private Profile
Post by: Rain Forest on July 13, 2013, 04:48:17 AM
Thanks! :)

EDIT: Reset the visibility settings of *ALL* members to Only works once..
I wanted to check if this works, set the permission to 'buddies only', which worked, and set it back to 'members only' but it failed. Also after Empty the file cache.. :'(

Another request: when a member set his permission to: 'buddies only' and a random member click on their profile it says:
QuoteThis profile is made private by the owner, therefore you can't view it.

Maybe it's better to let this message say:
QuoteThis profile is only visible for buddies only, become buddies to see his/her profile.
Title: Re: Private Profile
Post by: NanoSector on July 13, 2013, 05:14:14 AM
Is there anything in your error log?

And as soon as I get on my laptop I'll write that text change up for you, though I don't feel it is needed in the core.
Title: Re: Private Profile
Post by: Rain Forest on July 13, 2013, 05:18:55 AM
Quote from: Yoshi on July 13, 2013, 05:14:14 AM
Is there anything in your error log?

And as soon as I get on my laptop I'll write that text change up for you, though I don't feel it is needed in the core.


Apply Filter: Only show the errors with the same message
8: Undefined index: first_post
Apply Filter: Only show the errors from this file
File: /var/www/vhosts/ URL /httpdocs/forum/Themes/RUSH/Display.template.php
Line: 701



Apply Filter: Only show the errors with the same message
8: Undefined index: first_post
Apply Filter: Only show the errors from this file
File: /var/www/vhosts/ URL /httpdocs/forum/Themes/RUSH/Display.template.php
Line: 699


Title: Re: Private Profile
Post by: NanoSector on July 13, 2013, 05:20:52 AM
Private profile does not touch that file ;)

I'll have to dig into this. It should work just fine (and it did for me...)
Title: Re: Private Profile
Post by: Rain Forest on July 13, 2013, 05:34:26 AM
Quote from: Yoshi on July 13, 2013, 05:20:52 AM
Private profile does not touch that file ;)

I'll have to dig into this. It should work just fine (and it did for me...)
It was an old bug, I never cleared the error log :P it's gone now :)

But I still have the 'change' error of this mod
Title: Re: Private Profile
Post by: NanoSector on July 13, 2013, 07:14:53 AM
Check if version 0.3.1 works for you :)
Title: Re: Private Profile
Post by: Rain Forest on July 13, 2013, 07:23:48 AM
It does but sometimes when I click on my profile (tested as admin and as a test-user) it says:

Wrong value type sent to the database. Array of integers expected. (users)

In errorlog:

092fa76f0f5007e9aeb888dbbe3c089b
Apply Filter: Only show the errors of this type Type of error: Critical

Wrong value type sent to the database. Array of integers expected. (users)
Function: loadMemberData
Apply Filter: Only show the errors from this file
File: /var/www/vhosts/ URL /httpdocs/forum/Sources/Load.php
Line: 1063
Title: Re: Private Profile
Post by: NanoSector on July 13, 2013, 08:50:17 AM
That's not a problem with this mod, sorry :)
Title: Re: Private Profile
Post by: Shambles on July 13, 2013, 08:59:12 AM
Quote from: Soft Drink

Maybe it's better to let this message say:
QuoteThis profile is only visible for buddies only, become buddies to see his/her profile.
I'd further rephrase it to avoid the tautology of "only" and "profile" ;)

QuoteThis member's profile can only be viewed if you become his or her buddy.
Title: Re: Private Profile
Post by: NanoSector on July 13, 2013, 09:07:27 AM
Okay. For that, in Sources/Profile.php, find:
// Otherwise we simply can't view this profile.
elseif (!$can_view)
fatal_lang_error('pp_cant_view', false);


Replace that with:
// Otherwise we simply can't view this profile.
elseif (!$can_view && $cur_profile['profile_private'] == 'buddies')
fatal_lang_error('pp_cant_view_buddies', false);
elseif (!$can_view)
fatal_lang_error('pp_cant_view', false);


Then, in Themes/default/languages/Modifications.english.php, find:

$txt['pp_cant_view'] = 'This profile is made private by the owner, therefore you can\'t view it.';


Add after:

$txt['pp_cant_view_buddies'] = 'The profile of this member can only be viewed if you become his or her buddy.';


If you want you can replace the text.
Title: Re: Private Profile
Post by: Rain Forest on July 14, 2013, 06:41:35 AM
Hmm, after installing your latest version, new guests are not able to register..

Unknown column 'private_profile' in 'field list'
File: /var/www/vhosts/ URL /httpdocs/forum/Sources/Subs-Members.php
Line: 819


In errorlog:

Type of error: Database


Apply Filter: Only show the error messages of this URL
URL/forum/index.php?action=register2
Apply Filter: Only show the errors with the same message
Database Error: Unknown column 'private_profile' in 'field list'


INSERT INTO smf_members(`member_name`, `email_address`, `passwd`, `password_salt`, `posts`, `date_registered`, `member_ip`, `member_ip2`, `validation_code`, `real_name`, `personal_text`, `private_profile`, `pm_email_notify`, `id_theme`, `id_post_group`, `lngfile`, `buddy_list`, `pm_ignore_list`, `message_labels`, `website_title`, `website_url`, `location`, `icq`, `aim`, `yim`, `msn`, `time_format`, `signature`, `avatar`, `usertitle`, `secret_question`, `secret_answer`, `additional_groups`, `ignore_boards`, `smiley_set`, `openid_uri`, `is_activated`, `gender`, `hide_email`)
VALUES
('USERNAME, E-MAILADDRESS', '82d4d7fb2525fd48ed3a35e1f5a2738e32b3dd60', '4903', 0, 1373798206, 'IP ADDRESS', 'IP ADDRESS', '', 'USERNAME', '', 'members', 1, 0, 4, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 1, 0, 1)
Apply Filter: Only show the errors from this file
File: /var/www/vhosts/ URL /httpdocs/forum/Sources/Subs-Members.php
Line: 819
Title: Re: Private Profile
Post by: NanoSector on July 14, 2013, 06:45:33 AM
In Subs-Members.php, search for private_profile and replace with profile_private. I thought I fixed that...
Title: Re: Private Profile
Post by: Rain Forest on July 14, 2013, 06:52:01 AM
Quote from: Yoshi on July 14, 2013, 06:45:33 AM
In Subs-Members.php, search for private_profile and replace with profile_private. I thought I fixed that...
Thanks I hope it will work :P
Title: Re: Private Profile
Post by: CMOBOSS_OLD on March 31, 2014, 05:01:43 AM
I see this was left unchanged.

Glad to see this did work. :)
Title: Re: Private Profile
Post by: NanoSector on March 31, 2014, 09:30:08 AM
Fixed in 0.3.2.