vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Freeze Users Postcounts (https://vborg.vbsupport.ru/showthread.php?t=79521)

ZombieAndy 04-06-2005 10:00 PM

Freeze Users Postcounts
 
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.
PHP Code:

$doposts 'posts = posts + 1,'

Replace with.
PHP Code:

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? ;)

PHP Code:

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

Quote:

Originally Posted by Boofo
Wouldn't this work just as well? ;)

PHP Code:

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:
PHP Code:

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

Quote:

Originally Posted by Acers
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

Quote:

Originally Posted by Boofo
Wouldn't this work just as well? ;)

PHP Code:

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
Code:

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

PHP Code:

$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 ???


All times are GMT. The time now is 02:58 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01044 seconds
  • Memory Usage 1,755KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (7)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (14)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete