2013-12-26, 08:04 AM
Create limitsign.php in Notepad ++
and copy (or you can use attached file)
Change "350000" with value you want...
350000 is same 350 kb
100000 is same 100 kb.....
Change "The sum of the size of the images exceeds the allowed limit of 350kb." with error message you want.
upload limitsign.php to plugin folder and activate.
it´s all.
and copy (or you can use attached file)
<?php
// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
// Plugin info
function limitsign_info ()
{
return array(
"name" => "limitsign",
"description" => "limitsign",
"website" => "limitsign",
"author" => "limitsign",
"authorsite" => "limitsign",
"version" => "limitsign",
"guid" => "limitsign",
"compatibility" => "16*"
);
}
$plugins->add_hook('usercp_start', 'signsize');
function signsize()
{
global $mybb, $error;
preg_match_all("/\[img(.*?)\](.*?)\[\/img\]/i", $mybb->input['signature'], $matches, PREG_SET_ORDER);
$kbsizetot = 0;
foreach ($matches as $img)
{
$kbsize = strlen(@file_get_contents($img[2]));
$kbsizetot += $kbsize;
}
if (($kbsizetot > 350000) && ($mybb->input['action'] == "do_editsig")) {
$error = inline_error("The sum of the size of the images exceeds the allowed limit of 350kb.");
}
}
?>
Change "350000" with value you want...
350000 is same 350 kb
100000 is same 100 kb.....
Change "The sum of the size of the images exceeds the allowed limit of 350kb." with error message you want.
upload limitsign.php to plugin folder and activate.
it´s all.