PDA

View Full Version : Stop to post long quotes


GenSec
Mon 15th Oct '01, 4:25pm
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,desc ription,optioncode,displayorder) 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
Tue 23rd Oct '01, 11:31am
nice one

thatl come in handy

thanks GenSec

Chen
Tue 23rd Oct '01, 11:39am
This will just stop from posting long messages, not quotes.

GenSec
Tue 23rd Oct '01, 11:53am
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
Tue 23rd Oct '01, 12:08pm
Limiting posts length is already standard with vBulletin.
Your hack does the exact same thing.

GenSec
Tue 23rd Oct '01, 12:30pm
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
Tue 23rd Oct '01, 12:48pm
You are right.

DarkReaper
Tue 23rd Oct '01, 1:35pm
Ok...now I'm confused :confused:

Chen
Tue 23rd Oct '01, 1:43pm
He's right, I didn't understand it. :)
Sorry GenSec.