Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Anti-spam post decrementer Details »»
Anti-spam post decrementer
Version: 1.00, by Kier Kier is offline
Developer Last Online: May 2011 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 07-15-2002 Last Update: Never Installs: 5
 
No support by the author.

This is a bit of a silly hack, but a few of my moderators wanted it, so I thought I'd share it with you people.

What it does is when a user posts, the system checks against a list of user IDs, and if the user is in that list, their post count goes down by one, rather than going up by one post. Very silly I know, but anyway...

1) run the following query:
Code:
INSERT INTO setting (settinggroupid, title, varname, description, displayorder) VALUES
(6, 'Users with inverse post counters', 'decrementusers',
'Users in this list will have their post count decremented when they post. Separate user IDs with a comma', 100)
2) in functions.php, add the following code somewhere near the bottom of the file:
Code:
function incrementposts($userid) {
        static $decrementusers;
        if (!is_array($decrementusers)) {
                $decrementusers = explode(',', $GLOBALS['decrementusers']);
        }
        if (in_array($userid, $decrementusers)) {
                return 'posts=posts-1,';
        } else {
                return 'posts=posts+1,';
        }
}
3) in newreply.php and newthread.php, find this code:
Code:
".iif ($foruminfo[countposts],"posts=posts+1,","")."
and replace with this:
Code:
".iif ($foruminfo[countposts], incrementposts($bbuserinfo['userid']), '')."
Then go into your control panel and edit the new setting, inserting something like 1001,2544 to set users 1001 and 2544 to have inverse post counters.

Have fun :classic:

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 07-16-2002, 11:45 AM
Raz's Avatar
Raz Raz is offline
 
Join Date: Oct 2001
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by FireFly

It will not go below 0. If you want it to, run this query:
[sql]ALTER TABLE user CHANGE posts posts SMALLINT DEFAULT 0 NOT NULL;[/sql]
Remember, doing this will reduce your very maximum post count to 32767.
Reply With Quote
  #13  
Old 07-16-2002, 12:02 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where is LongINT when you need it?

Quote:
Originally posted by Raz
Remember, doing this will reduce your very maximum post count to 32767.
Reply With Quote
  #14  
Old 07-16-2002, 12:08 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Raz
Remember, doing this will reduce your very maximum post count to 32767.
True, heh, if you have spamme- err active posters use this...
[sql]ALTER TABLE user CHANGE posts posts MEDIUMINT DEFAULT 0 NOT NULL;[/sql]
Reply With Quote
  #15  
Old 07-16-2002, 12:18 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Which will do what?
Reply With Quote
  #16  
Old 07-16-2002, 12:30 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you don't have any users with more than 32,000 posts, use the first one. If you do, use the second one.
Reply With Quote
  #17  
Old 07-16-2002, 12:37 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't have very many users with 32 posts let alone 32,000 posts. I think I'll be safe with the first one (for now, anyway.)

Quote:
Originally posted by FireFly
If you don't have any users with more than 32,000 posts, use the first one. If you do, use the second one.
Reply With Quote
  #18  
Old 07-25-2002, 05:53 PM
trilOByte's Avatar
trilOByte trilOByte is offline
 
Join Date: Nov 2001
Location: England
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What would be very cool, is if somehow this hack could be tied into the posting timelimit. If a user posts more than XX seconds apart, then the post count increments, if less than XX seconds, then the post count decrements. We have some *very* prolific posters who tend to spam threads a lot, but we don't want to penalise regular users with a 90 second posting limit.
Reply With Quote
  #19  
Old 04-19-2003, 03:52 AM
Leah's Avatar
Leah Leah is offline
 
Join Date: Aug 2002
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'd like to install this hack, but I have one problem with it.
In my newreply.php, it says:

Quote:
".iif ($foruminfo[countposts],"posts=posts+1,storep=storep+'$fool',","")."
I can't seem to get it right when trying to change this one.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:57 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04358 seconds
  • Memory Usage 2,291KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete