Skip to main content
Topic: How to disable "Currently" section in user profiles? (Read 2787 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to disable "Currently" section in user profiles?

Is there a way to disable the section of a profile that says what the person is currently doing except for hiding the online status? I couldn't find anything in the admin nor the personal account/profile settings. I'd just like the members to be able to see who is online without being able to see what they are doing.

Thanks in advance :)

Re: How to disable "Currently" section in user profiles?

Reply #1

I think you're gonna have to edit the Who.template.php file under Themes/Default  (or whatever themes you have installed and are enabled)

For the default file (assuming v. 1.1.6.. YMMV), you might try commenting out line 85 (containing ->  <div class="online_action">', $member['action'], '</div>] ).

If that works (and doesn't blow anything up), you owe me a beer., If it doesn't work (or does blow up and you have to dig that file out of the rubble), uncomment that line,  and maybe Spuds has a better answer than just my wild guess.  Good luck..
Last Edit: July 29, 2021, 11:25:13 pm by Steeley

// Deep inside every dilemma lies a solution that involves explosives //

Re: How to disable "Currently" section in user profiles?

Reply #2

If you're talking about the profile one only, it looks like you should be able to turn this off in admin. I forget exactly where the field configuration is (maybe you need to turn the custom profile fields on in Core Features first? I recently got a new laptop, have not installed Elkarte on it yet), but if you go into there, you should be able to disable the 'Action' profile field which should do what you're wanting.

What Steeley is referring to is the main who's online page in full rather than the profile page, and presumably is already restricted if you don't want people seeing this.

Re: How to disable "Currently" section in user profiles?

Reply #3

Actually, I don't see such a field (that I recognize as such any way), in the profile section (custom or otherwise). Arantor. That's what sent me looking through the php files.

When I found $member['action'] I said "Ah HA!" and stopped searching. If that's the wrong file, I'll start looking again when I get a chance..  it's got to be in one of 'em somewhere.. :-)

// Deep inside every dilemma lies a solution that involves explosives //

Re: How to disable "Currently" section in user profiles?

Reply #4

If you're looking in the files, ProfileInfo.template.php is the one to look at, on line 659 according to GitHub:

Code: [Select]
	// What are they up to?
if (!isset($context['disabled_fields']['action']) && !empty($context['member']['action']))
echo '
<dt>', $txt['profile_action'], ':</dt>
<dd>', $context['member']['action'], '</dd>';

I assumed since the disabled fields stuff was there, and it follows the same setup as the other disabled fields in SMF (which was previously behind the Core Features > Advanced Profile Fields feature), that this is how it could be disabled without a code edit.

Re: How to disable "Currently" section in user profiles?

Reply #5

You can disable "Who's online", but it looks like there isn't an option for enabling it and disabling the action part of it (I see no "action" field to disable in the Custom Profile Fields list - and I do have who's on-line enabled - and I don't think I altered any existing default fields, merely disabled the defaults I didn't want to use).

But Aye - I think commenting out lines 660-663 of ProfileInfo.template.php under themes/default should do the trick..

Thanks for finding that..  Now I can go out and wash the Electraglide for my run to Sturgis next week instead of digging around in my server testing the edges of my php knowledge envelope.
Last Edit: July 31, 2021, 05:53:54 pm by Steeley

// Deep inside every dilemma lies a solution that involves explosives //

Re: How to disable "Currently" section in user profiles?

Reply #6

There's no option for Who's Online (but you can lock out access by way of permissions) but the profile area is separate and as mentioned the code clearly has the facility to hook into the profile fields configuration.

I dunno, I don't have a test install handy, just going off what I see in the code.

Re: How to disable "Currently" section in user profiles?

Reply #7

Quote from: Arantor – There's no option for Who's Online (but you can lock out access by way of permissions) but the profile area is separate and as mentioned the code clearly has the facility to hook into the profile fields configuration.

I dunno, I don't have a test install handy, just going off what I see in the code.

Maybe we're not talking about the same thing?

"Enable Who's online list" under Admin / Configuration / General.. ?

// Deep inside every dilemma lies a solution that involves explosives //

Re: How to disable "Currently" section in user profiles?

Reply #8

No, we're not, no. That is how to change the main who's online page, which is not what the OP or I was talking about.

As I mentioned, I suspect (without looking) that if you have Advanced Profile Fields / Custom Fields enabled in Core Features, the page on which you can configure the fields will let you disable certain fields, like post count... and the action shown in the profile. This is what the code snippet I mentioned does, it looks up against the list of enabled/disabled fields in the profile and hides them there.

Re: How to disable "Currently" section in user profiles?

Reply #9

Quote from: Arantor – No, we're not, no. That is how to change the main who's online page, which is not what the OP or I was talking about.

As I mentioned, I suspect (without looking) that if you have Advanced Profile Fields / Custom Fields enabled in Core Features, the page on which you can configure the fields will let you disable certain fields, like post count... and the action shown in the profile. This is what the code snippet I mentioned does, it looks up against the list of enabled/disabled fields in the profile and hides them there.

I do have that enabled, and do have a number of custom profile fields I've added, all the instagram/messenger/ICQ/ etc. stuff is unchecked (inactive)  but no, alas, I don't see anything related to current user activity in the custom profile fields.  (EA v.1.1.6)  :'(

When you do get a chance to look, tell me if you see something I don't.  Otherwise it looks like commenting out lines 660-663 in ProfileInfo.template.php may be the only solution (assuming that works).

// Deep inside every dilemma lies a solution that involves explosives //

 

Re: How to disable "Currently" section in user profiles?

Reply #10

You're right, the setting's not there - which is doubly weird because the code to use the setting absolutely exists in the snippet I mentioned.

Sure enough if I add the config, that works as you'd expect.

Code: (sources/subs/ManageFeatures.subs.php) [Select]
		$standard_fields = array('website', 'posts', 'warning_status', 'date_registered');
$fields_no_registration = array('posts', 'warning_status', 'date_registered');

Code: (replace with) [Select]
		$standard_fields = array('website', 'posts', 'warning_status', 'date_registered', 'action');
$fields_no_registration = array('posts', 'warning_status', 'date_registered', 'action');

and

Code: (sources/admin/ManageFeatures.controller.php) [Select]
		// What about standard fields they can tweak?
$standard_fields = array('website', 'posts', 'warning_status', 'date_registered');

// What fields can't you put on the registration page?
$context['fields_no_registration'] = array('posts', 'warning_status', 'date_registered');

Code: (replace with) [Select]
		// What about standard fields they can tweak?
$standard_fields = array('website', 'posts', 'warning_status', 'date_registered', 'action');

// What fields can't you put on the registration page?
$context['fields_no_registration'] = array('posts', 'warning_status', 'date_registered', 'action');

Plus a language string, say in ManageSettings.english.php:
Code: [Select]
$txt['action'] = 'Profile Action';

And presto, the thing turns up as a setting which is honoured by the profile page. I'd add a screenshot but apparently a 9KB PNG file has a problem :(

@Spuds can put the above into a PR for you if you like? Seems like a legit bug fix to me to have a thing respect configuration but not provide the configuration...

Re: How to disable "Currently" section in user profiles?

Reply #11

Quote from: Arantor –
And presto, the thing turns up as a setting which is honoured by the profile page. I'd add a screenshot but apparently a 9KB PNG file has a problem :(


This topic {board?} punts any image attachments for some reason..  that might be the first thing for spuds {or someone} to chase down  :-\

(Karvan hasn't been back since we started discussing his issue, but at least we got a couple of 'fixes' identified as a result..)
Last Edit: August 03, 2021, 04:32:31 pm by Steeley

// Deep inside every dilemma lies a solution that involves explosives //

Re: How to disable "Currently" section in user profiles?

Reply #12

Quote from: Arantor – @Spuds can put the above into a PR for you if you like? Seems like a legit bug fix to me to have a thing respect configuration but not provide the configuration...
Sorry I missed this, RL is in the way again.

I added this to a 1.1.8 PR and set you as the author, thanks !