PDA

View Full Version : Freeze Users Postcounts


ZombieAndy
04-06-2005, 10:00 PM
This is a tiny little hack that even the simplest folk should be able to install.

What it does
Allows you to freeze a user's postcount from the Admin CP.

How to install

First off, you need to make a new profile field on your forums.

Type: Single Selection Radio Buttons
Title: Post Count Frozen?
Description: Selecting "Yes" Will stop this user's postcount from increasing.
Options: No
Yes

Set Default: Yes
Field Required: No
Field Editable by user: No
Private Field: Yes
Searchable on members list: No
Show on members list: No
Display Page: Edit Profile (dont worry it wont show to your members)

Once you have done that, make a note of the field number (this is shown on the profile field manager as the "name"), then open includes/functions_newpost.php and make the following edit.

Find.
$doposts = 'posts = posts + 1,';

Replace with.
if ($bbuserinfo['fieldXX']=="Yes")
{
$doposts = 'posts = posts - 0,';
} else {
$doposts = 'posts = posts + 1,';
}

Replace XX with field number of the profile field you just made. save and upload. and voila. you now have the option to freeze users postcounts.

ive attached an image of where it will appear on the user manager screen.

Deaths
04-07-2005, 07:15 AM
Thats a pretty good idea, heh.

Acers
04-07-2005, 12:50 PM
good hack, Next time a person spams, you given me the tool to teach him a lesson :D

<clicks install>

TCattitude
04-07-2005, 04:31 PM
Really nice... really.
I have some user who will love this feature :)

Boofo
04-07-2005, 05:29 PM
Wouldn't this work just as well? ;)

if ($bbuserinfo['fieldXX']=="Yes")
{
$doposts = 'posts = posts,';
} else {
$doposts = 'posts = posts + 1,';
}

And can you please make a txt file for those that will need to readd it on an upgrade later? ;)

Marco van Herwaarden
04-07-2005, 05:57 PM
Wouldn't this work just as well? ;)

if ($bbuserinfo['fieldXX']=="Yes")
{
$doposts = 'posts = posts,';
} else {
$doposts = 'posts = posts + 1,';
}

And can you please make a txt file for those that will need to readd it on an upgrade later? ;)Well then the following would also work:
if ($bbuserinfo['fieldXX'] != "Yes")
{
$doposts = 'posts = posts + 1,';
}

Boofo
04-07-2005, 07:12 PM
Oh Sure! Show up the old guy. ;)

bigcurt
04-07-2005, 09:24 PM
lol out with the old in with the new LOL.

PHPGeek2k3
04-07-2005, 11:17 PM
Good Hack Thanks

good hack, Next time a person spams, you given me the tool to teach him a lesson :D

<clicks install>

@Acers Hey btw isnt this what banning is for?

Thanks
- James

ZombieAndy
04-08-2005, 09:14 AM
Wouldn't this work just as well? ;)

if ($bbuserinfo['fieldXX']=="Yes")
{
$doposts = 'posts = posts,';
} else {
$doposts = 'posts = posts + 1,';
}

And can you please make a txt file for those that will need to readd it on an upgrade later? ;)
ive made a text file :) sorry there probally are better ways of doing it but thats the way i did it on my forums and im not really a coder or anything.. i just thought it was a nice feature i'd share with you guys :p

and PHPGeek2k3... the idea with this and many other hacks is that its an alternative to banning.

twoseven
04-11-2005, 07:49 PM
hmm add mimimum posts of 0 to the forum then with this after a few spam msg's

if ($bbuserinfo['fieldXX']=="Yes")
{
$doposts = 'posts = posts -1 ,';
} else {
$doposts = 'posts = posts + 1,';
}

they could never post... just a thought

RichieBoy67
07-18-2005, 04:39 PM
Great hack but I think you should include that there are 2 instances of

$doposts = 'posts = posts + 1,';
that need to be replaced and not one...


Thanks :)

VaaKo
09-07-2005, 08:15 PM
it worked fine the way it is
thanks :)

RichieBoy67
12-22-2005, 07:37 PM
What is trick for doing this in 3.5.1 ???