Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: CapriSkye on August 26, 2004, 08:09:53 PM

Title: Disabling certain member's post count
Post by: CapriSkye on August 26, 2004, 08:09:53 PM
i would like to disable certain member's post count, mine actually. i dont think this feature is included but maybe somebody knows how to modify some files to make it work. can somebody please explain how to do this or if it's even possible? thank you.
Title: Re: is it possible to disable certain member's post count?
Post by: Metho on August 26, 2004, 08:36:31 PM
Possible, of course. Easy, in fact. I'll show you how to do it specifically for you (the straight hack custom way that isn't changed through fancy smancy options in the admin area. If you want that, it'll be a mod (that I could write at some point))

In Display.template.php FIND: // Show how many posts they have made.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
<br />';

REPLACE WITH: // Show how many posts they have made.
if ($message['member']['name'] == 'CapriSkye')
echo '<br /> <br />';
else
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
<br />';


THEN FIND the same original code in InstantMessage.template.php and replace it with the same code I gave you. All is well.

That's it. Make sure to change CapriSkye to whatever name you used on your board.

- Methonis

*******EDIT********
Forgot about the profile. :P

In Profile.template.php FIND: echo '
<tr>
<td><b>', $txt[86], ': </b></td>
<td>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</td>
</tr><tr>
<td><b>', $txt[87], ': </b></td>
<td>', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</td>
</tr>';

REPLACE WITH: if ($context['member']['name'] != 'CapriSkye')
{
echo '
<tr>
<td><b>', $txt[86], ': </b></td>
<td>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</td>
</tr>';
}
echo '
<tr>
<td><b>', $txt[87], ': </b></td>
<td>', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</td>
</tr>';
Title: Re: is it possible to disable certain member's post count?
Post by: CapriSkye on August 27, 2004, 01:09:43 AM
i will give it a try, thank you very much.
Title: Re: is it possible to disable certain member's post count?
Post by: CapriSkye on August 27, 2004, 01:15:39 AM
you have extra ' in
// Show how many posts they have made.
if ($message['member']['name'] == 'CapriSkye'')
echo '<br /> <br />';
else
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
<br />';


also i still want to show how many post, just not increasing it. if it's not too much trouble, would you please show me how to do it? thank you.
Title: Re: Disabling certain member's post count
Post by: CapriSkye on December 02, 2004, 12:00:03 AM
i've found a solution to my last reply, just in case somebody's interested.

in Post.php,
find:

if (empty($pcounter))
{
++$user_info['posts'];
updateMemberData($ID_MEMBER, array('posts' => 'posts + 1'));
}


replace with:

if (empty($pcounter))
{
if($ID_MEMBER != 'id#')
{
++$user_info['posts'];
updateMemberData($ID_MEMBER, array('posts' => 'posts + 1'));
}
}


and replace id# with whatever user's id number is.
Title: Re: Disabling certain member's post count
Post by: Oldiesmann on December 02, 2004, 09:57:24 AM
That will work for now, but if they change their display name, that won't work anymore. Use $ID_MEMBER instead:
if($ID_MEMBER != '{andrewsidnumber}')
Title: Re: Disabling certain member's post count
Post by: CapriSkye on December 02, 2004, 03:28:16 PM
thanks for the tips
Title: Re: Disabling certain member's post count
Post by: SeaOfSin on July 01, 2005, 03:10:18 AM
Quote from: CapriSkye on December 02, 2004, 12:00:03 AM
i've found a solution to my last reply, just in case somebody's interested.

in Post.php,
find:

if (empty($pcounter))
{
++$user_info['posts'];
updateMemberData($ID_MEMBER, array('posts' => 'posts + 1'));
}


replace with:

if (empty($pcounter))
{
if($ID_MEMBER != 'id#')
{
++$user_info['posts'];
updateMemberData($ID_MEMBER, array('posts' => 'posts + 1'));
}
}


and replace id# with whatever user's id number is.

Well since I cannot find the code, I assume that things have changed for the post.php.  I am using 1.1 Beta 3 public and wanted to know if anyone can tell me how to use this in that version from this version!

:)

Sea Of Sin
Title: Re: is it possible to disable certain member's post count?
Post by: SeaOfSin on July 10, 2005, 11:50:34 AM
Quote from: CapriSkye on August 27, 2004, 01:15:39 AM
you have extra ' in
// Show how many posts they have made.
if ($message['member']['name'] == 'CapriSkye'')
echo '<br /> <br />';
else
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
<br />';


also i still want to show how many post, just not increasing it. if it's not too much trouble, would you please show me how to do it? thank you.

In case anyone is interested for 1.1 Beta 3 to do this
Find Post.php

'update_post_count' => !$user_info['is_guest'] && !isset($_REQUEST['msg']) && $board_info['posts_count'],


Replace

'update_post_count' => $ID_MEMBER != '{id}' && !$user_info['is_guest'] && !isset($_REQUEST['msg']) && $board_info['posts_count'],

Title: Re: Disabling certain member's post count
Post by: psycho on July 11, 2005, 12:28:29 PM
how do you disable everyone post count in 1.1 beta 3???   I am lost 

thanks in advance
Title: Re: Disabling certain member's post count
Post by: SeaOfSin on July 11, 2005, 02:37:39 PM
Uncheck post count in admin/boards for every board would be one way!
Title: Re: Disabling certain member's post count
Post by: psycho on July 11, 2005, 02:46:33 PM
thanks...he only problem is that one of the admins is in a post count war.....without making her a non-admin I was trying to disable it so no one could even see the counts at all....and if I am going to disable it for one I am going to disable it for everyone.
Title: Re: Disabling certain member's post count
Post by: JustJa on July 27, 2005, 12:18:50 PM
How would I modify my code so that it would be disabled both post counts from admins and moderators?
Thanks!
Title: Re: Disabling certain member's post count
Post by: Saku on October 30, 2005, 11:11:21 PM
how can i do that for a Membergroup??
Title: Re: Disabling certain member's post count
Post by: junglecat on November 25, 2006, 02:04:33 PM
I want to know how to do this for a membergroup, too. I was actually going to start a topic, but found this one.

I have 1.1RC3
Title: Re: Disabling certain member's post count
Post by: codenaught on November 25, 2006, 10:59:59 PM
For the Display.template.php, change this code given in the first reply of this topic:

if ($message['member']['name'] == 'CapriSkye')

To this:

if ($message['member']['group'] != ID_OF_GROUP)

Changing ID_OF_GROUP to the membergroup ID.

For the Profile.template.php, change this code given:

if ($context['member']['name'] != 'CapriSkye')

To this:

if ($context['member']['group_id'] != ID_OF_GROUP)

Although this would only work for primary groups and not additional groups and post count based groups. Tell me if you need to include those.
Title: Re: Disabling certain member's post count
Post by: junglecat on November 26, 2006, 12:39:20 AM
I need to do it for an added non-post based group.
Title: Re: Disabling certain member's post count
Post by: codenaught on November 26, 2006, 12:40:27 PM
Well to make it so that it checks any type of group the member is in, you can change this:

if ($message['member']['group'] != ID_OF_GROUP)

To this:

global $user_info;
if (!in_array(ID_OF_GROUP, $user_info['groups']))


For Profile it would be a similar thing:

if ($context['member']['group_id'] != ID_OF_GROUP)

To this:

global $user_info;
if (!in_array(ID_OF_GROUP, $user_info['groups']))


Unfortunately, $context['user'] does not load additionalGroups, nor does $context['member']. $user_profile does though, but like $user_info, it is not the best for use in templates.