PDA

View Full Version : Minimum characters needed for a new post


FlyingDutchman
04-03-2003, 10:00 PM
What does this hack do?
If you post a new thread or a new reply and the message is too short (shorter than a number of characters you specify), you'll recieve an error. This *might* stop spamming.



Requested by
https://vborg.vbsupport.ru/showthread.php?postid=377468



Screenshots
-Admin CP Options -> [Thread Display Options] (https://vborg.vbsupport.ru/attachment.php?postid=377474)
-The actual error page (https://vborg.vbsupport.ru/attachment.php?postid=377476)



Installation
See attached text file
Approx. install time: 5 min or so
After installation, remember to set the 'Minimum Characters per post' option to a suitable value (for example 50)


Updates
-fixed lil typo in the install file :) (template name was wrong)
-thanks to Zelda-King for pointing me on editpost.php ;)





Please click the install button if you installed this hack!!!

FlyingDutchman
04-04-2003, 12:07 PM
Screenshot
Admin options [Thread Display Options]

FlyingDutchman
04-04-2003, 12:08 PM
Screenshot
The actual error page

Boofo
04-04-2003, 12:33 PM
Nice little addition. I will make it so Admins and Mods are exempt, though. ;)

Dean C
04-04-2003, 12:34 PM
Nice idea - vB users are really hitting down on spammers nowadays ;)

- miSt

FlyingDutchman
04-04-2003, 01:40 PM
Today at 03:33 PM Boofo said this in Post #4 (https://vborg.vbsupport.ru/showthread.php?postid=377491#post377491)
Nice little addition. I will make it so Admins and Mods are exempt, though. ;)

this code will do this job i think:

$minmod = array("1", "2", "3", "4");
if (strlen($message)<$postminchars and $postminchars!=0 and in_array("$bbuserinfo[usergroupid]", $minmod)) {
eval("standarderror(\"".gettemplate("error_tooshort")."\");");
}



not tested though!
please tell me if it works ;)






btw, anyone know if there's a similar function to in_array, but that returns FALSE where in_array returns TRUE (like checking if something is NOT in an array...)

Boofo
04-04-2003, 01:55 PM
Here's the code I was going to use.

if (strlen($message)<$postminchars and $postminchars!=0 AND !in_array($bbuserinfo[usergroupid], array(5, 6, 7))) {
eval("standarderror(\"".gettemplate("error_tooshort")."\");");
}

Zelda-King
04-04-2003, 03:46 PM
I recommend the code be inserted into editpost.php as well. Also, in the text file you said to make a template called 'error_toolong'. Surely you mean 'error_tooshort'.

sabret00the
04-04-2003, 09:12 PM
great work, i saw this on vb3, altho it's more a little pop up like the pm thing but blah, this is great!

Spitfireisgod
04-04-2003, 10:09 PM
this is nice, im gonna install

ZiRu$
04-04-2003, 11:48 PM
i think i'll install too

McDohl
04-05-2003, 05:59 AM
Haha, first ever hack dedicated to me! -Punches air-

Thanks for this, i'm grateful. Good job! :)

-Clicks Install-

ga.net
05-07-2003, 10:23 PM
I cant understand this one:

now, run this query:
--------------------
INSERT INTO setting VALUES ('', 8, 'Minimum Characters per post', 'postminchars', '0', 'The minimum number of characters that you want to require per post. Set this to 0 to disable it.', '', 7);
--------------------

Koutaru
05-09-2003, 08:42 PM
Run it in PHPmyadmin

(SQL)

ga.net
05-11-2003, 12:38 AM
You mean Ill put everything that's inside the parenthesis?? :) I have PHPadmin running but how do I do it? What are the procedures for this?? :)

ga.net
05-12-2003, 11:33 AM
bump

Boofo
05-12-2003, 12:05 PM
You run the whole query, just like it is written:

INSERT INTO setting VALUES ('', 8, 'Minimum Characters per post', 'postminchars', '0', 'The minimum number of characters that you want to require per post. Set this to 0 to disable it.', '', 7);

in phpmyadmin, which you should be able to get to from your server. If not, talk to your host and they will tell you how to get to phpmyadmin. ;)

ga.net
05-12-2003, 09:41 PM
Yesterday at 10:05 PM Boofo said this in Post #17 (https://vborg.vbsupport.ru/showthread.php?postid=394126#post394126)
You run the whole query, just like it is written:

INSERT INTO setting VALUES ('', 8, 'Minimum Characters per post', 'postminchars', '0', 'The minimum number of characters that you want to require per post. Set this to 0 to disable it.', '', 7);

in phpmyadmin, which you should be able to get to from your server. If not, talk to your host and they will tell you how to get to phpmyadmin. ;)


I know how to get to phpmyadmin, in fact i was the one who installed it. I just dont know how to run this query, what should I click and what are the fields that I should fill up? Is it ok to provide me the steps? :)

Boofo
05-13-2003, 02:43 AM
Ok, let's try this one last time. ;)

Before you do anything, backup your database!

Go to phpmyadmnin and click on the database name (at the top) in the left window. You will see 5 options in the right hand window. They are:

Structure
SQL
Export
Search
Query

Click on the SQL option and enter this in the big box (just copy and paste):

INSERT INTO setting VALUES ('', 8, 'Minimum Characters per post', 'postminchars', '0', 'The minimum number of characters that you want to require per post. Set this to 0 to disable it.', '', 7);

Hit go and you are done.

ga.net
05-13-2003, 12:19 PM
Wow! That was easy! thanks :)

ga.net
05-15-2003, 09:23 AM
Ei, what if I dont want this hack anymore, how do I uninstall it?? :)

Dankinit
06-04-2003, 01:47 AM
Why not just set the min characters to 0 to disallow?

brauner
07-23-2003, 12:24 PM
Leider ist die .txt Datei nicht mehr vollständig.
Könnte das vielleicht nochmal jemand anhängen?

DuffMan
12-13-2003, 08:51 PM
This hack is exactly what I was looking for! It works great, thanks a lot!

tm21
12-14-2003, 08:49 PM
I installed the hack, works fine. One of my mods asked if it would be possible to make a different limit based on post count? We basicially want newbies to post more information than our regular members, so we want a higher minimum for the newbs.