Disabling certain member's post count

Started by CapriSkye, August 26, 2004, 08:09:53 PM

Previous topic - Next topic

CapriSkye

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.

Metho

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>';
Joshua "Methonis" Frazer
Support Specialist
The Simple Machines Team

CapriSkye


CapriSkye

#3
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.

CapriSkye

#4
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.

Oldiesmann

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}')
Michael Eshom
Christian Metal Fans

CapriSkye

#6
thanks for the tips

SeaOfSin

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

SeaOfSin

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'],


psycho

how do you disable everyone post count in 1.1 beta 3???   I am lost 

thanks in advance

SeaOfSin

Uncheck post count in admin/boards for every board would be one way!

psycho

#11
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.

JustJa

How would I modify my code so that it would be disabled both post counts from admins and moderators?
Thanks!

Saku


junglecat

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
PM me for affordable hosting. I will install your SMF forum with your choice of a theme for FREE.
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
Join us at Christian Discussions 
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~

codenaught

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.
Dev Consultant
Former SMF Doc Coordinator

junglecat

I need to do it for an added non-post based group.
PM me for affordable hosting. I will install your SMF forum with your choice of a theme for FREE.
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
Join us at Christian Discussions 
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~

codenaught

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.
Dev Consultant
Former SMF Doc Coordinator

Advertisement: