[Free] Current activity

Started by DrBlack, September 16, 2014, 12:25:33 PM

Previous topic - Next topic

DrBlack

Message:
good morning ..
i have the mod ( Current activity ) in my SMF forum . it works very well
and appear in profile very good

Version
2.0.8  the latest version

Description
i want to make it ( for admins group ) to appear in current activity : hidden by admin
i hope you help me

Permissions
admin only ( owner )

Feature Set
admin option

Arantor

It already is.

If you go into the admin panel as an admin, a regular user will not see that if they go to the who's online list since they don't have permission themselves to see it.

DrBlack

what i mean is like this

for full image http://store2.up-00.com/2014-09/1410885495551.png


while if you see a regular member activity it appear.

if you saw a admin profile it will be like this image

i hope i know how i can do this > edit the text for admins activity

thank you

Arantor

Oh, I see, your original post wasn't clear.

Profile.template.php
Code (find) Select
if (!isset($context['disabled_fields']['posts']))
echo '
<dt>', $txt['profile_posts'], ': </dt>
<dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';


After it add:

if (!empty($context['member']['action']) && allowedTo('admin_forum'))
echo '
<dt>Currently:</dt>
<dd>', $context['member']['action'], '</dd>';

DrBlack

ty very much > where i can found this file + where to edit the text in this code

DrBlack

where i can find this Profile.template.php

DrBlack

thank you i found it in this

/Themes/default

but i use theam ( infernos )

/Themes/inferno_20rc4

and cant find this file in it :(

Arantor

1. RC4 version of Inferno is out of date. Get the updated version from DzinerStudio.com

2. If a theme doesn't have a template, the default theme's copy will be used instead, so Themes/default/Profile.template.php is the file to use.

Hj Ahmad Rasyid Hj Ismail

If you cannot find it in custom theme, then editing the one in default theme alone would suffice.

Edited: Ninja'd.

DrBlack

i do it but it appear like that

http://store1.up-00.com/2014-09/1410888254681.png

it appear ( Current Activity: + Currently: )

this not what i want

what i want to appear the ( current activity ) of owners to regular user ( Nothing . or nothing you can see ) i want appear this text

thank you

Arantor

I gave you the change for the first one 'Currently:', I don't know what else you've done, sorry.

DrBlack

i type what you give to me


but it's still appear the activity that i do

i want it to be constant text

how i can do this

DrBlack

which text in ( currently ) i can edit ?

Hj Ahmad Rasyid Hj Ismail

May be you are viewing as an admin because admin always have privilege to view user's activity. Try to use other browser and view the profile as guest and regular member instead to see whether you have done it correctly.

By the way, the code given by Arantor will not show the whole thing - from Currently: to its end - if the profile viewer is not the forum admin.

DrBlack

i saw it as Guest.

the ( currently ) doesnt appear at all for guests

i want it to appear but in this text ( nothing , or nothing you can see )

Arantor

The currently doesn't appear to guests because you asked for it to be shown only to admins!

Who's Online doesn't show things to people if they can't see them anyway...

DrBlack

i ask to hide the owner currently .

for guests + Regular members . i want  it appear to them like this :

Currently : nothing , or nothing you can see

but if they look to other member profile

they can see his really currently like this :

Currently : viewing DrBlack's profile

DrBlack

I want it to be like this forum





I was a regular member in it.
I saw the profile of owner like the picture

And if i see a moderator or regular member
it appear normal . Like : current activity : view forums



I hope my forum be like this

Hj Ahmad Rasyid Hj Ismail

#18
Ok. I am trying to understand your wishes.

This is the mod code that you have to change:
// Display the member's current activity
if (isset($context['member']['action']) && allowedTo('who_view')) {
echo '<dt>', $txt['current_activity'], ': </dt>
<dd>', $context['member']['action'], '</dd>';


Replace with:
// Display the member's current activity
if (isset($context['member']['action']) && allowedTo('who_view')) {
echo '<dt>', $txt['current_activity'], ': </dt>
<dd>', ($context['user']['is_owner'] || $context['user']['is_guest']) ? 'nothing or nothing you can see' : $context['member']['action'], '</dd>';


Note: I haven't tested this.

DrBlack

This will appear for all ranks or guests only  ??
I want this appear to all members
That they cant saw the owner current activity

Advertisement: