Hi
This adds a Stats tab to your menu!
First, Go to index.template.php
Find:
// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'mlist' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a>
</td>' , $current_action == 'mlist' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
// Show the [Stats] button
echo ($current_action == 'stats' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'stats' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=stats">' , $txt['stats_mod'] , '</a>
</td>' , $current_action == 'stats' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
Now you will see a space after the member button
Now we have to go to modifications.english.php
?>
$txt['stats_mod']= 'Stats';
Thanks For reading and I hope this helps!
Joe N
p.s. Also, if anyone has used it, please put there forum url so I can take a look
Hello.
Would oyu like to have this moved to Tips and Tricks (http://www.simplemachines.org/community/index.php?board=72.0)?
Quote from: Nas on June 28, 2009, 04:58:26 AM
Hello.
Would oyu like to have this moved to Tips and Tricks (http://www.simplemachines.org/community/index.php?board=72.0)?
Yes Please
Nice...
Quote from: [Core28] on June 30, 2009, 10:54:18 PM
Nice...
Thank You!
Also, if anyone has used it, please put there forum url so I can take a look
Very nice! I just added it to my place, and it works like a charm. ;D
Thank you!
Oh...just click the gold image in my sig for the forum link.
Quote from: Joe N on July 01, 2009, 10:18:28 AM
Quote from: [Core28] on June 30, 2009, 10:54:18 PM
Nice...
Thank You!
Also, if anyone has used it, please put there forum url so I can take a look
your welcome.
I added this after the comment line:
if ($context['user']['is_logged'])
Now the Stats aren't viewable by Guests: only Members.
If you want to use the group permission, use this
if (isset($context['show_stats']) && $context['show_stats'])
To enable permission for guests, go to Admin => Permissions => Permission by Membergroups, modify "Guests" permission, tick the "View forum statistics" checkbox.
Quote from: Bulakbol on July 04, 2009, 02:11:31 PM
If you want to use the group permission, use this
if (isset($context['show_stats']) && $context['show_stats'])
To enable permission for guests, go to Admin => Permissions => Permission by Membergroups, modify "Guests" permission, tick the "View forum statistics" checkbox.
I tried that. After you click on the STATS button, the button disappears from the menu bar when the Stats Page is displayed.
Also, if you use the Tip as posted, or with
Quote from: Lord High Warlock on July 02, 2009, 04:51:19 PM
if ($context['user']['is_logged'])
The STATS button is not selected / highlighted as others would be when the Stats Page is displayed...it selects the HOME button. Is there a way to correct this??
Yes. Sorry 'bout that. I forgot that the $context['show_stats'] is only available in board index.
To highlight the stats tab, in index,template.php, look for
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
and add after
if ($context['current_action'] == 'stats')
$current_action = 'stats';
Thanks, Bulakbol! That worked perfectly!
Kudos to you! :D
Thanks For the Tip.
Some Translations:
Spanish:
$txt['stats_mod']= 'Estadísticas';
Polish:
$txt['stats_mod']= 'Statystyki';
Do you mind if I add to those boards?
-JB
SURE JB
Thanks.
Quote from: JeremyB. on July 16, 2009, 08:37:20 PM
Thanks.
Hey
Could I have the link for ur site so I can take a look?
A link to what site?
Quote from: JeremyB. on July 17, 2009, 08:07:20 AM
A link to what site?
The site where you're using this tip.
Oh I'm not using just translated it.
Oh ok
Thanks Anyway!