Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: CapriSkye in August 26, 2004, 08:09:53 NACHMITTAGS

Titel: Disabling certain member's post count
Beitrag von: CapriSkye in August 26, 2004, 08:09:53 NACHMITTAGS
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.
Titel: Re: is it possible to disable certain member's post count?
Beitrag von: Metho in August 26, 2004, 08:36:31 NACHMITTAGS
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>';
Titel: Re: is it possible to disable certain member's post count?
Beitrag von: CapriSkye in August 27, 2004, 01:09:43 VORMITTAG
i will give it a try, thank you very much.
Titel: Re: is it possible to disable certain member's post count?
Beitrag von: CapriSkye in August 27, 2004, 01:15:39 VORMITTAG
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.
Titel: Re: Disabling certain member's post count
Beitrag von: CapriSkye in Dezember 02, 2004, 12:00:03 VORMITTAG
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.
Titel: Re: Disabling certain member's post count
Beitrag von: Oldiesmann in Dezember 02, 2004, 09:57:24 VORMITTAG
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}')
Titel: Re: Disabling certain member's post count
Beitrag von: CapriSkye in Dezember 02, 2004, 03:28:16 NACHMITTAGS
thanks for the tips
Titel: Re: Disabling certain member's post count
Beitrag von: SeaOfSin in Juli 01, 2005, 03:10:18 VORMITTAG
Zitat von: CapriSkye in Dezember 02, 2004, 12:00:03 VORMITTAG
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
Titel: Re: is it possible to disable certain member's post count?
Beitrag von: SeaOfSin in Juli 10, 2005, 11:50:34 VORMITTAG
Zitat von: CapriSkye in August 27, 2004, 01:15:39 VORMITTAG
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'],

Titel: Re: Disabling certain member's post count
Beitrag von: psycho in Juli 11, 2005, 12:28:29 NACHMITTAGS
how do you disable everyone post count in 1.1 beta 3???   I am lost 

thanks in advance
Titel: Re: Disabling certain member's post count
Beitrag von: SeaOfSin in Juli 11, 2005, 02:37:39 NACHMITTAGS
Uncheck post count in admin/boards for every board would be one way!
Titel: Re: Disabling certain member's post count
Beitrag von: psycho in Juli 11, 2005, 02:46:33 NACHMITTAGS
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.
Titel: Re: Disabling certain member's post count
Beitrag von: JustJa in Juli 27, 2005, 12:18:50 NACHMITTAGS
How would I modify my code so that it would be disabled both post counts from admins and moderators?
Thanks!
Titel: Re: Disabling certain member's post count
Beitrag von: Saku in Oktober 30, 2005, 11:11:21 NACHMITTAGS
how can i do that for a Membergroup??
Titel: Re: Disabling certain member's post count
Beitrag von: junglecat in November 25, 2006, 02:04:33 NACHMITTAGS
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
Titel: Re: Disabling certain member's post count
Beitrag von: codenaught in November 25, 2006, 10:59:59 NACHMITTAGS
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.
Titel: Re: Disabling certain member's post count
Beitrag von: junglecat in November 26, 2006, 12:39:20 VORMITTAG
I need to do it for an added non-post based group.
Titel: Re: Disabling certain member's post count
Beitrag von: codenaught in November 26, 2006, 12:40:27 NACHMITTAGS
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.