Advertisement:

Author Topic: Disabling certain member's post count  (Read 27875 times)

Offline CapriSkye

  • Full Member
  • ***
  • Posts: 574
    • Open
Disabling certain member's post count
« 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.
« Last Edit: October 30, 2004, 02:49:19 PM by A.M.A »

Offline Metho

  • SMF Friend
  • Full Member
  • *
  • Posts: 564
  • Gender: Male
Re: is it possible to disable certain member's post count?
« Reply #1 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:
Code: [Select]
// Show how many posts they have made.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
<br />';
REPLACE WITH:
Code: [Select]
// 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:
Code: [Select]
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:
Code: [Select]
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>';
« Last Edit: August 27, 2004, 01:19:38 AM by Metho »
Joshua "Methonis" Frazer
Support Specialist
The Simple Machines Team

Offline CapriSkye

  • Full Member
  • ***
  • Posts: 574
    • Open
Re: is it possible to disable certain member's post count?
« Reply #2 on: August 27, 2004, 01:09:43 AM »
i will give it a try, thank you very much.

Offline CapriSkye

  • Full Member
  • ***
  • Posts: 574
    • Open
Re: is it possible to disable certain member's post count?
« Reply #3 on: August 27, 2004, 01:15:39 AM »
you have extra ' in
Code: [Select]
// 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.
« Last Edit: August 27, 2004, 01:19:22 AM by CapriSkye »

Offline CapriSkye

  • Full Member
  • ***
  • Posts: 574
    • Open
Re: Disabling certain member's post count
« Reply #4 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:
Code: [Select]
if (empty($pcounter))
{
++$user_info['posts'];
updateMemberData($ID_MEMBER, array('posts' => 'posts + 1'));
}

replace with:
Code: [Select]
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.
« Last Edit: December 03, 2004, 12:34:49 AM by CapriSkye »

Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Disabling certain member's post count
« Reply #5 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}')
Michael Eshom
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org

Offline CapriSkye

  • Full Member
  • ***
  • Posts: 574
    • Open
Re: Disabling certain member's post count
« Reply #6 on: December 02, 2004, 03:28:16 PM »
thanks for the tips
« Last Edit: December 03, 2004, 12:34:18 AM by CapriSkye »

SeaOfSin

  • Guest
Re: Disabling certain member's post count
« Reply #7 on: July 01, 2005, 03:10:18 AM »
i've found a solution to my last reply, just in case somebody's interested.

in Post.php,
find:
Code: [Select]
if (empty($pcounter))
{
++$user_info['posts'];
updateMemberData($ID_MEMBER, array('posts' => 'posts + 1'));
}

replace with:
Code: [Select]
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

  • Guest
Re: is it possible to disable certain member's post count?
« Reply #8 on: July 10, 2005, 11:50:34 AM »
you have extra ' in
Code: [Select]
// 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
Code: [Select]
'update_post_count' => !$user_info['is_guest'] && !isset($_REQUEST['msg']) && $board_info['posts_count'],

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

Offline psycho

  • Semi-Newbie
  • *
  • Posts: 14
Re: Disabling certain member's post count
« Reply #9 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

SeaOfSin

  • Guest
Re: Disabling certain member's post count
« Reply #10 on: July 11, 2005, 02:37:39 PM »
Uncheck post count in admin/boards for every board would be one way!

Offline psycho

  • Semi-Newbie
  • *
  • Posts: 14
Re: Disabling certain member's post count
« Reply #11 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.
« Last Edit: July 11, 2005, 03:04:43 PM by psycho »

Offline JustJa

  • Jr. Member
  • **
  • Posts: 274
  • Gender: Female
Re: Disabling certain member's post count
« Reply #12 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!

Offline Saku

  • Jr. Member
  • **
  • Posts: 305
  • Gender: Male
Re: Disabling certain member's post count
« Reply #13 on: October 30, 2005, 11:11:21 PM »
how can i do that for a Membergroup??

Offline junglecat

  • Full Member
  • ***
  • Posts: 439
  • Gender: Female
  • Geek Wannabe
Re: Disabling certain member's post count
« Reply #14 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
PM me for affordable hosting. I will install your SMF forum with your choice of a theme for FREE.
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
Join us at Christian Discussions 
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~

Offline codenaught

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,653
  • Gender: Male
  • Formerly Known As akabugeyes
Re: Disabling certain member's post count
« Reply #15 on: November 25, 2006, 10:59:59 PM »
For the Display.template.php, change this code given in the first reply of this topic:

Code: [Select]
if ($message['member']['name'] == 'CapriSkye')
To this:

Code: [Select]
if ($message['member']['group'] != ID_OF_GROUP)
Changing ID_OF_GROUP to the membergroup ID.

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

Code: [Select]
if ($context['member']['name'] != 'CapriSkye')
To this:

Code: [Select]
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

Offline junglecat

  • Full Member
  • ***
  • Posts: 439
  • Gender: Female
  • Geek Wannabe
Re: Disabling certain member's post count
« Reply #16 on: November 26, 2006, 12:39:20 AM »
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 
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~

Offline codenaught

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,653
  • Gender: Male
  • Formerly Known As akabugeyes
Re: Disabling certain member's post count
« Reply #17 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:

Code: [Select]
if ($message['member']['group'] != ID_OF_GROUP)
To this:

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

For Profile it would be a similar thing:

Code: [Select]
if ($context['member']['group_id'] != ID_OF_GROUP)
To this:

Code: [Select]
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