PDA

View Full Version : Stop to post long quotes


GenSec
15 Oct 2001, 19:25
A small addition to prevent members to post long messages wich have no new information, but just long quotes and "Cool!" at the end.

Database Changes:

INSERT INTO setting (settingid,settinggroupid,title,varname,value,description,optioncode,displayorde r) VALUES (NULL,'8','Maximum Characters per quote','quotemaxchars','250','The maximum number of characters that you want to allow per quote. Set this to 0 to disable it','','8')

Open newreply.php
Find $pagetext=htmlspecialchars($postinfo[pagetext]);
Replace with
$pagetext=$postinfo[pagetext];
$getquote=$DB_site->query_first("SELECT value FROM setting WHERE varname='quotemaxchars'");
$quotemaxchars=$getquote[value];
if (strlen($pagetext) > $quotemaxchars and $quotemaxchars!=0) {
$pagetext = substr($pagetext,0,$quotemaxchars);
$pagetext .= "...";
}

$pagetext=bbcodeparse($pagetext,0,1);


Then use admin CP to set the maximum size of the quote

cyrus
23 Oct 2001, 14:31
nice one

thatl come in handy

thanks GenSec

Chen
23 Oct 2001, 14:39
This will just stop from posting long messages, not quotes.

GenSec
23 Oct 2001, 14:53
Originally posted by FireFly
This will just stop from posting long messages, not quotes. Messages which are long because include long quotes
It limits not message but size of quotes in it

Chen
23 Oct 2001, 15:08
Limiting posts length is already standard with vBulletin.
Your hack does the exact same thing.

GenSec
23 Oct 2001, 15:30
Sorry, it doesn't
Limiting posts length is already standard with vBulletin. Right.
If it's limit is 1000 for example and someone post long message with 1000 simbols. Then next replies can look like
" bla bla = 990 simbols + Cool!"

It's only repeat previous one! I hate it and limited in addition the size of quote to 10% of the max post size.

Chen
23 Oct 2001, 15:48
You are right.

DarkReaper
23 Oct 2001, 16:35
Ok...now I'm confused :confused:

Chen
23 Oct 2001, 16:43
He's right, I didn't understand it. :)
Sorry GenSec.