1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-07 15:16:30 +02:00

PM Message limits.

This commit is contained in:
Cameron
2016-04-24 19:40:01 -07:00
parent a24637eea5
commit 8762cf82ca
3 changed files with 16 additions and 2 deletions

View File

@@ -142,7 +142,7 @@ class private_msg_ui extends e_admin_ui
'attach_size' => array('title'=> ADLAN_PM_28, 'tab'=>1, 'type' => 'number', 'data' => 'int', 'help'=>'', 'writeParms'=>'tdClassRight=form-inline&post=Kb'),
'pm_max_send' => array('title'=> ADLAN_PM_81, 'tab'=>1, 'type' => 'number', 'data' => 'int', 'help'=>''),
'perpage' => array('title'=> ADLAN_PM_24, 'tab'=>0, 'type' => 'number', 'data' => 'int', 'help'=>''),
'maxlength' => array('title'=> ADLAN_PM_84, 'tab'=>1, 'type' => 'number', 'data' => 'int', 'help'=>ADLAN_PM_85, 'writeParms'=>array('post'=>'chars.')),
);

View File

@@ -76,6 +76,8 @@ define("ADLAN_PM_80", "Preference formats updated");
define("ADLAN_PM_81", "Maximum number of PMs to send immediately");
define("ADLAN_PM_82", "If sending more than this, they are added to a queue and sent out using the cron task");
define("ADLAN_PM_83", "Users may only send messages to users in this class");
define("ADLAN_PM_84", "Maximum message length");
define("ADLAN_PM_85", "0 = unlimited");
?>

View File

@@ -245,6 +245,9 @@ if(!class_exists('plugin_pm_pm_shortcodes'))
public function sc_pm_form_message()
{
$value = '';
$maxlength = '';
$placeholder = '';
if(vartrue($this->var['pm_text']))
{
if(isset($_POST['quote']))
@@ -253,7 +256,16 @@ if(!class_exists('plugin_pm_pm_shortcodes'))
$value = "\n\n\n\n\n\n\n[quote{$t}={$this->var['from_name']}]\n".trim($this->var['pm_text'])."[/quote{$t}]";
}
}
return "<textarea class='tbox form-control' name='pm_message' cols='60' rows='10' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>{$value}</textarea>";
if(!empty($this->pmPrefs['maxlength']))
{
$length = intval($this->pmPrefs['maxlength']);
$maxlength = "maxlength=".$length;
$placeholder = "placeholder='Max. ".$length." chars.'"; // TODO LAN
}
return "<textarea class='tbox form-control' ".$placeholder." name='pm_message' cols='60' rows='10' ".$maxlength." onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>{$value}</textarea>";
}