Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: gmoneyluv on November 18, 2008, 06:57:14 AM

Title: Removing Forum Stats
Post by: gmoneyluv on November 18, 2008, 06:57:14 AM
Hey folks,

You guys were very helpful when i asked about removing the info centre from the default theme (1.17) but i've noticed the stats are still there - Forum Stats. Latest Member, Latest Post, etc

Is there any way of removing this info? I've tried denying access (found on a forum post) and no luck. What am i doing wrong? :(   

G   
Title: Re: Removing Forum Stats
Post by: Kermit on November 18, 2008, 07:01:17 AM
BoardIndex.template.php

Code (find) Select

// Show YaBB SP1 style information...
if ($settings['show_sp1_info'])
{
echo '
<tr>
<td class="titlebg" colspan="2">', $txt[645], '</td>
</tr>
<tr>
<td class="windowbg" width="20" valign="middle" align="center">
<a href="', $scripturl, '?action=stats"><img src="', $settings['images_url'], '/icons/info.gif" alt="', $txt[645], '" /></a>
</td>
<td class="windowbg2" width="100%">
<span class="middletext">
', $context['common_stats']['total_posts'], ' ', $txt[95], ' ', $txt['smf88'], ' ', $context['common_stats']['total_topics'], ' ', $txt[64], ' ', $txt[525], ' ', $context['common_stats']['total_members'], ' ', $txt[19], '. ', $txt[656], ': <b> ', $context['common_stats']['latest_member']['link'], '</b>
<br /> ' . $txt[659] . ': <b>&quot;' . $context['latest_post']['link'] . '&quot;</b>  ( ' . $context['latest_post']['time'] . ' )<br />
<a href="', $scripturl, '?action=recent">', $txt[234], '</a>', $context['show_stats'] ? '<br />
<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
</span>
</td>
</tr>';
}


Code (replace with) Select

/*

// Show YaBB SP1 style information...
if ($settings['show_sp1_info'])
{
echo '
<tr>
<td class="titlebg" colspan="2">', $txt[645], '</td>
</tr>
<tr>
<td class="windowbg" width="20" valign="middle" align="center">
<a href="', $scripturl, '?action=stats"><img src="', $settings['images_url'], '/icons/info.gif" alt="', $txt[645], '" /></a>
</td>
<td class="windowbg2" width="100%">
<span class="middletext">
', $context['common_stats']['total_posts'], ' ', $txt[95], ' ', $txt['smf88'], ' ', $context['common_stats']['total_topics'], ' ', $txt[64], ' ', $txt[525], ' ', $context['common_stats']['total_members'], ' ', $txt[19], '. ', $txt[656], ': <b> ', $context['common_stats']['latest_member']['link'], '</b>
<br /> ' . $txt[659] . ': <b>&quot;' . $context['latest_post']['link'] . '&quot;</b>  ( ' . $context['latest_post']['time'] . ' )<br />
<a href="', $scripturl, '?action=recent">', $txt[234], '</a>', $context['show_stats'] ? '<br />
<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
</span>
</td>
</tr>';
}
*/
Title: Re: Removing Forum Stats
Post by: Antechinus on November 18, 2008, 07:21:28 AM
That's the same code, Duncan.

gmoneyluv, you can get rid of that lot using the guest membergroup permissions.
Title: Re: Removing Forum Stats
Post by: Kermit on November 18, 2008, 07:24:37 AM
Quote from: antechinus on November 18, 2008, 07:21:28 AM
That's the same code, Duncan.

gmoneyluv, you can get rid of that lot using the guest membergroup permissions.

oh really ,look again,the code is not the same ^^

look carefully at the beginning & ending of the code
Title: Re: Removing Forum Stats
Post by: gmoneyluv on November 18, 2008, 07:42:42 AM
wow you guys are fast!

I'm willing to try both options!
So go to permissions/guests modify/general/and uncheck view forum stats, meberlist and who'sonline

Unfortunately it still shoes up. I've also gone to regular users and checked the deny these permissions and they still show.   

should i try the code?

G   
Title: Re: Removing Forum Stats
Post by: Dragooon on November 18, 2008, 07:43:58 AM
There should be a option for it in Admin > Current Theme > Settings. If no, try the code(It would work AFAIK).
Title: Re: Removing Forum Stats
Post by: Kermit on November 18, 2008, 07:44:31 AM
you can not hide the whole forum stats with the permissions,with permission you can hide just the [More Stats] button,if you want to hide the whole forum stats,than you should do,what i wrote above
Title: Re: Removing Forum Stats
Post by: gmoneyluv on November 18, 2008, 08:08:20 AM
ok guys!

I managed to get rid of some of that info via current theme settings but the most online and most online ever sections still remain.

Duncan i tried the code but there was no difference...not sure what i am doing wrong...
   
Title: Re: Removing Forum Stats
Post by: Kermit on November 18, 2008, 08:14:50 AM
Please attach your BoardIndex.template.php
Title: Re: Removing Forum Stats
Post by: gmoneyluv on November 18, 2008, 08:37:22 AM
ok, here you go.


Title: Re: Removing Forum Stats
Post by: Kermit on November 18, 2008, 08:54:41 AM
it should work actually,are you using custom theme ?
i've commented the forum stats line,also what means,the lines have no more effects and would be not showed anymore...
Title: Re: Removing Forum Stats
Post by: gmoneyluv on November 18, 2008, 09:54:21 AM
Hey D,

Thanks for your help.

I'm not using a custom theme...i'll load this later today when i get a chance and let you know how it works.

G

   
Title: Re: Removing Forum Stats
Post by: gmoneyluv on November 18, 2008, 10:15:29 AM
Sorry Duncan,

Do you have the modified file? Just not sure what is should do next.

G
Title: Re: Removing Forum Stats
Post by: [SiNaN] on November 19, 2008, 07:20:42 AM
Removed most online and most online ever sections. Attached.
Title: Re: Removing Forum Stats
Post by: gmoneyluv on November 19, 2008, 10:29:27 AM
Thanks Blue Dream!

I'll load it up and let you know how it works out! :D
Title: Re: Removing Forum Stats
Post by: gmoneyluv on November 19, 2008, 07:02:01 PM
Hey Blue Dream!

This worked like a charm!
Thanks for everyone's help! :D   
Title: Re: Removing Forum Stats
Post by: illusion_ on December 18, 2008, 05:18:49 AM
Have also used Duncan's code to edit out the stats and it works perfectly     BUT   there is one stat I would like to have showing     the "latest member"

If Duncan, or anyone else can help with the code to leave this one in there but edit out the rest it would be much appreciated

Thanks
Title: Re: Removing Forum Stats
Post by: [SiNaN] on December 18, 2008, 05:22:03 AM
Find:

                  <span class="middletext">
                     ', $context['common_stats']['total_posts'], ' ', $txt[95], ' ', $txt['smf88'], ' ', $context['common_stats']['total_topics'], ' ', $txt[64], ' ', $txt[525], ' ', $context['common_stats']['total_members'], ' ', $txt[19], '. ', $txt[656], ': <b> ', $context['common_stats']['latest_member']['link'], '</b>
                     <br /> ' . $txt[659] . ': <b>&quot;' . $context['latest_post']['link'] . '&quot;</b>  ( ' . $context['latest_post']['time'] . ' )<br />
                     <a href="', $scripturl, '?action=recent">', $txt[234], '</a>', $context['show_stats'] ? '<br />
                     <a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
                  </span>


Replace:

                  <span class="middletext">
                     ', $txt[656], ': <b> ', $context['common_stats']['latest_member']['link'], '</b>
                  </span>