Log in

View Full Version : Hide the admin "current activity" in profile?


brandonroy
04-08-2009, 05:33 PM
I want to hide the current activity of the admin (me) in my profile. It shows in two places: Just under the "last activity" at the top and in the statistics tab.

on the vb forums they suggested using the invisible mode, but I don't want to go invisible and make myself look like I'm offline.

Thanks.

Brother Malachi
04-08-2009, 10:10 PM
The only way I can think of is using an <if condition=""><else /></if>
Something like
if is admin don't show the last activity
else show it

Not sure what you would put in the condition parameter

brandonroy
04-09-2009, 02:31 AM
The only way I can think of is using an <if condition=""><else /></if>
Something like
if is admin don't show the last activity
else show it

Not sure what you would put in the condition parameter
Probably my profile id, which is "2". Not sure what the code is...maybe someone can help out.

Lynne
04-09-2009, 02:42 AM
Are you trying to hide *your* activity or every admin's (ie. user in usergroupid 6) activity from other users?

If yours, you can try:
<if condition="$bbuserinfo['userid'] == '2'">
the line to hide from all except userid 2
</if>or if for usergroup:
<if condition="$bbuserinfo['usergroupid'] == '6'">
the line to hide from all but usergroupid 6
</if>Try that and see if it works.

brandonroy
04-09-2009, 04:12 AM
Are you trying to hide *your* activity or every admin's (ie. user in usergroupid 6) activity from other users?

If yours, you can try:
<if condition="$bbuserinfo['userid'] == '2'">
the line to hide from all except userid 2
</if>or if for usergroup:
<if condition="$bbuserinfo['usergroupid'] == '6'">
the line to hide from all but usergroupid 6
</if>Try that and see if it works.
I just want to hide my activity. I'm the only admin.

What do I put between those <if tags in the MEMBERINFO template? I got a little confused

Dingo14
04-09-2009, 04:59 AM
what part of template does this go to hide admin 2 thanks

brandonroy
04-09-2009, 05:36 AM
Ok, I get it. I had a brain fart or something. This works BUT, it doesn't allow members to see what other members are doing. I want everyone to see everyone's current activity as normal except not be able to see the admins current activity.

Brother Malachi
04-09-2009, 06:44 AM
Go find the code that shows the activity, then use what Lynne gave you:

<if condition="$bbuserinfo['userid'] != '2'">
the code that shows current activity
</if>
Note the !=

brandonroy
04-09-2009, 07:49 AM
Go find the code that shows the activity, then use what Lynne gave you:

<if condition="$bbuserinfo['userid'] != '2'">
the code that shows current activity
</if>
Note the !=
It still doesn't allow regular members to see other members current activity..

Lynne
04-09-2009, 02:27 PM
Ah, I see. Try changing it to:
<if condition="$prepared['userid'] != '2'">
the code that shows current activity
</if> That should show the activity unless you are on member #2's page. Test it and see. You may have to use $userinfo instead of $prepared in other templates.

brandonroy
04-09-2009, 07:53 PM
Ah, I see. Try changing it to:
<if condition="$prepared['userid'] != '2'">
the code that shows current activity
</if> That should show the activity unless you are on member #2's page. Test it and see. You may have to use $userinfo instead of $prepared in other templates.
Awesome! Works great. Thanks Lynne ;)

g0dfather1984
04-11-2009, 08:05 PM
Thank you both for this information.

One question, what would one put to hide the last activity?

I have the current activity hiding, but now want last activity as well.

Thank you once again.

Lynne
04-11-2009, 08:07 PM
Thank you both for this information.

One question, what would one put to hide the last activity?

I have the current activity hiding, but now want last activity as well.

Thank you once again.
Put the same condition around the lines for last activity. It should be right above the current activity line.

g0dfather1984
04-11-2009, 08:42 PM
Sorry, having a brain lapse here. This is what I have but it's currently not working. What am I doing wrong?

<!-- current activity -->
<if condition="$prepared['userid'] != '1'">
</if>
<if condition="$prepared['lastactivitydate'] OR $prepared['action']">
<div class="alt2 smallfont block_row" id="activity_info">
<if condition="$prepared['lastactivitydate']">
<div id="last_online">
<span class="shade">$vbphrase[last_activity]:</span> $prepared[lastactivitydate]<if condition="!$show['detailedtime']"><if condition="$prepared['userid'] != '1'">
</if> <span class="time">$prepared[lastactivitytime]</span></if>
</div>
</if>
<if condition="$prepared['action']">
<span class="shade">$vbphrase[current_activity]:</span> $prepared[action] $prepared[where]
</if>
</div>
</if>
<!-- / current activity -->

Lynne
04-11-2009, 09:57 PM
You realize you opened the condition on line 2 and closed it on line 3 with nothing in it? And then you did that again?

You probably want something like this (not tested - you will have to test it):

<if condition="$prepared['userid'] != '1'">
<!-- current activity -->
<if condition="$prepared['lastactivitydate'] OR $prepared['action']">
<div class="alt2 smallfont block_row" id="activity_info">
<if condition="$prepared['lastactivitydate']">
<div id="last_online">
<span class="shade">$vbphrase[last_activity]:</span> $prepared[lastactivitydate]<if condition="!$show['detailedtime']"> <span class="time">$prepared[lastactivitytime]</span></if>
</div>
</if>
<if condition="$prepared['action']">
<span class="shade">$vbphrase[current_activity]:</span> $prepared[action] $prepared[where]
</if>
</div>
</if>
<!-- / current activity -->
</if>

That shows the current activity of everyone's profile except userid 1. If that give an error, combine the first two conditions into one.

g0dfather1984
04-11-2009, 10:22 PM
Thank you, Lynne. Works great.

MoviePropCollec
04-12-2009, 02:21 AM
Where do we put that?

Meaning Admin CP>Templates> etc like that.

Thanks ;)

Lynne
04-12-2009, 02:43 AM
It's from the MEMBERINFO template, I believe. You can always take the comment line and do a Search in Template and find it.

Dingo14
04-13-2009, 05:43 AM
You realize you opened the condition on line 2 and closed it on line 3 with nothing in it? And then you did that again?

You probably want something like this (not tested - you will have to test it):

<if condition="$prepared['userid'] != '1'">
<!-- current activity -->
<if condition="$prepared['lastactivitydate'] OR $prepared['action']">
<div class="alt2 smallfont block_row" id="activity_info">
<if condition="$prepared['lastactivitydate']">
<div id="last_online">
<span class="shade">$vbphrase[last_activity]:</span> $prepared[lastactivitydate]<if condition="!$show['detailedtime']"> <span class="time">$prepared[lastactivitytime]</span></if>
</div>
</if>
<if condition="$prepared['action']">
<span class="shade">$vbphrase[current_activity]:</span> $prepared[action] $prepared[where]
</if>
</div>
</if>
<!-- / current activity -->
</if>

That shows the current activity of everyone's profile except userid 1. If that give an error, combine the first two conditions into one.

Lynne this works great could you tell me how I can add a second admin into this so it doesn't show the activity thanks, i tried <if condition="$prepared['userid'] != '1,3'"> but doesn't work any help would be great

Lynne
04-13-2009, 02:53 PM
Lynne this works great could you tell me how I can add a second admin into this so it doesn't show the activity thanks, i tried <if condition="$prepared['userid'] != '1,3'"> but doesn't work any help would be great
Try this:
<if condition="!in_array($prepared['userid'], array(1,3))">

slapjack2fast
04-13-2009, 07:44 PM
Ive done this and it works it don't show my last login date but it does say 'On' beside my name and also in the Statistics it says it aswell, any way i cant hide both of these?

Lynne
04-13-2009, 08:05 PM
If you don't want anyone to see your online status, then either go Invisible or put the same condition around the online status as you put around the current activity. And I don't know what statistics you are talking about - if it's from a mod, you will have to ask in the modification thread for help modifying the code.

slapjack2fast
04-13-2009, 08:08 PM
Ok i'll try it thanks again Lynne :D

--------------- Added 1239658881 at 1239658881 ---------------

Just before i edit anything that might mess up the templates does the code go anywhere here?

<!-- current activity -->
<if condition="$prepared['lastactivitydate'] OR $prepared['action']">
<div class="alt2 smallfont block_row" id="activity_info">
<if condition="$prepared['lastactivitydate']">
<div id="last_online">
<span class="shade">$vbphrase[last_activity]:</span> $prepared[lastactivitydate]<if condition="!$show['detailedtime']"> <span class="time">$prepared[lastactivitytime]</span></if>
</div>
</if>
<if condition="$prepared['action']">
<span class="shade">$vbphrase[current_activity]:</span> $prepared[action]

I Put it somewhere there and it said that there's an error and it's highly recommended that i fix it so i clicked 'Go back' just incase

Dingo14
04-14-2009, 12:08 AM
Try this:
<if condition="!in_array($prepared['userid'], array(1,3))">



thanks heaps Lynne that is spot on works great

bobc973
02-23-2010, 05:54 PM
The individual works great, but what about groups?

On my site, it may not be the primary group, but perhaps a secondary group....
But I tried this and it doesn't work even if it is the primary group:

<if condition="!in_array($prepared['usergroupid'], array(23,4))">

---lines of code---

</if>

where 23 and 4 are Groupids of the groups i do NOT want to show.

Any help would be apprciated!

Lynne
02-23-2010, 08:21 PM
You would not use in_array for the usergroupid, you would use is_member_of (in the API in the Quick Links).

bobc973
02-24-2010, 06:19 PM
You would not use in_array for the usergroupid, you would use is_member_of (in the API in the Quick Links).

Like this?:

<if condition="is_member_of($prepared['usergroupid']) != '23'">

<span class="shade">$vbphrase[current_activity]:</span> $prepared[action] $prepared[where]

</if>

assuming you do NOT want to allow if the profile being viewed is a member of usergroup 23

Thanks

ChopSuey
02-25-2010, 12:37 PM
https://vborg.vbsupport.ru/showthread.php?t=179115

Try that :D