Private Profile

Started by Diego Andrés, July 07, 2013, 04:40:07 PM

Previous topic - Next topic

Diego Andrés

Link to the mod

Private Profile
If you need to report a bug, please do so on GitHub!

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

  • Users can make their profile private at Profile > Modify Profile > Account Settings.
  • Permissions can be changed at Admin > Members > Permissions.
  • Settings for this mod can be changed at Admin > Configuration > Modification Settings.

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.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Rain Forest

Nice mod! :)

Is there a way to open your profile to buddies only?

NanoSector

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.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Rain Forest

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)

NanoSector

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)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Rain Forest

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. :)

4Kstore

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!

¡¡NEW MOD: Sparkles User Names!!!

NanoSector

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 :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Mr. Pedram

My Modifications:
» Loading For SMF
» Buddies Block
» Redirect Links
» Birthdate On Registration
» PM Warning
» Instagram
» Add Table,Td,Tr Button
» Search Topic & Board Button
Browse All...

NanoSector

v0.3 up which adds all requested features and more :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Rain Forest

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.

NanoSector

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.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Rain Forest

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



NanoSector

Private profile does not touch that file ;)

I'll have to dig into this. It should work just fine (and it did for me...)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Rain Forest

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

NanoSector

Check if version 0.3.1 works for you :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Rain Forest

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

NanoSector

That's not a problem with this mod, sorry :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Shambles

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.

NanoSector

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.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Advertisement: