This is a small hack for the SMF 2.0 series that will show a user's current action in their profile. You can set set permissions for it to show to select groups by choosing the right replacement code.
SMF 2.0 BETA versions (NOT RC versions)
Open ./Themes/default/Profile.template.php
Find:
<tr>
<td><b>', $txt['lastLoggedIn'], ': </b></td>
<td>', $context['member']['last_login'], '</td>
</tr>';
Replace with:
if (!empty($context['member']['action']))
echo '
<tr>
<td><strong>', $txt['current_action'], ': </strong></td>
<td>', $context['member']['action'], '</td>
</tr>';
Or replace with:
if ((!empty($context['member']['action'])) && ($context['user']['is_logged']))
echo '
<tr>
<td><strong>', $txt['current_action'], ': </strong></td>
<td>', $context['member']['action'], '</td>
</tr>';
Or replace with:
if ((!empty($context['member']['action'])) && ($context['user']['is_admin']))
echo '
<tr>
<td><strong>', $txt['current_action'], ': </strong></td>
<td>', $context['member']['action'], '</td>
</tr>';
Or replace with:
// Delimit the following line with commas within an array. Example: array(1, 2, 5, 8, 12, 6). Group 3 will not work.
$groups_can_see = array(1, 2);
$can_view_action = count(array_intersect($groups_can_see, $user_info['groups'])) > 0;
if ((!empty($context['member']['action'])) && ($can_view_action))
echo '
<tr>
<td><strong>', $txt['current_action'], ': </strong></td>
<td>', $context['member']['action'], '</td>
</tr>';
Open ./Themes/default/languages/Modifications.english.php
Find:
?>
Replace with:
$txt['current_action'] = 'Current Action';
?>
SMF 2.0 RC versions (NOT BETA versions)
Open ./Themes/default/Profile.template.php
Find:
echo '
<dt>', $txt['lastLoggedIn'], ': </dt>
<dd>', $context['member']['last_login'] ,'</dd>';
Add after:
if (!empty($context['member']['action']))
echo '
<dt><strong>', $txt['current_action'], ': </strong></dt>
<dd>', $context['member']['action'], '</dd>';
Or instead, add after:
if ((!empty($context['member']['action'])) && ($context['user']['is_logged']))
echo '
<dt><strong>', $txt['current_action'], ': </strong></dt>
<dd>', $context['member']['action'], '</dd>';
Or instead, add after:
if ((!empty($context['member']['action'])) && ($context['user']['is_admin']))
echo '
<dt><strong>', $txt['current_action'], ': </strong></dt>
<dd>', $context['member']['action'], '</dd>';
Or instead, add after:
// Delimit the following line with commas within an array. Example: array(1, 2, 5, 8, 12, 6). Group 3 will not work.
$groups_can_see = array(1, 2);
$can_view_action = count(array_intersect($groups_can_see, $user_info['groups'])) > 0;
if ((!empty($context['member']['action'])) && ($can_view_action))
echo '
<dt><strong>', $txt['current_action'], ': </strong></dt>
<dd>', $context['member']['action'], '</dd>';
Open ./Themes/default/languages/Modifications.english.php
Find:
?>
Replace with:
$txt['current_action'] = 'Current Action';
?>