View Full Version : Long Posts Edit.
Shana
02-26-2009, 04:17 PM
Hey, just wondering if I could somehow make it so if someones post is longer then 4 lines it adds something at th end like 'LONG POST'?
Lynne
02-26-2009, 04:20 PM
How would you count '4 lines'? If you open your browser window up, the line gets longer.
Shana
02-26-2009, 04:21 PM
I didn't think of that, would it be easier to do if it was x words or x letters? Like, if it's more then 200 words.
Lynne
02-26-2009, 04:51 PM
Probably. But, I now picture a long post having the words LONG POST at the bottom of the post and wonder what the purpose of that is except that it makes the post even longer. :confused:
Shana
02-26-2009, 05:40 PM
Any idea as to how I could do it? I just said 'LONG POST', it would be something else but I don't think it's appropriate for these forums <_<. Would be "disregard that ...." and if you know it you'll fill in the blank.
Lynne
02-26-2009, 09:06 PM
Well, you'll have to create a plugin which checks the length of the $post[message] and then if it's longer than xx, you would append "LONG POST" (keeping with the example) to the end.
if (strlen($post[message]) > '200')
$post[message] = $post[message] . "LONG POST";
I'm not sure of the plugin location or variable names (you can look them up in newpost.php file).
Dismounted
02-27-2009, 11:03 AM
// count lines -- see, it can be done!
$linecount = count(explode('<br />', $post['message']));
// check lines
if ($linecount > 4)
{
$post['message'] .= 'Long Post!';
}
Lynne
02-27-2009, 02:54 PM
But then you are counting on line breaks inserted by the user, no? So they can write a huge paragraph and it would just be considered one line? I guess the OP can try the code and see how it works.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.