getArray("pm_prefs");
//pm_prefs record not found in core table, set to defaults and create record
if(!is_array($pm_prefs))
{
require_once(e_PLUGIN."pm/pm_default.php");
$pm_prefs = pm_set_default_prefs();
$sysprefs->setArray('pm_prefs');
$message = ADLAN_PM_3;
}
$lan_file = e_PLUGIN."pm/languages/admin/".e_LANGUAGE.".php";
include_once(is_readable($lan_file) ? $lan_file : e_PLUGIN."pm/languages/admin/English.php");
if (isset($_POST['update_prefs']))
{
foreach($_POST['option'] as $k => $v)
{
$pm_prefs[$k] = $v;
}
$sysprefs->setArray('pm_prefs');
$message = ADLAN_PM_4;
}
if(isset($_POST['addlimit']))
{
if($sql->db_Select('generic','gen_id',"gen_type = 'pm_limit' AND gen_datestamp = {$_POST['newlimit_class']}"))
{
$message = ADLAN_PM_5;
}
else
{
if($sql->db_Insert('generic',"0, 'pm_limit', '{$_POST['newlimit_class']}', '{$_POST['new_inbox_count']}', '{$_POST['new_outbox_count']}', '{$_POST['new_inbox_size']}', '{$_POST['new_outbox_size']}'"))
{
$message = ADLAN_PM_6;
}
else
{
$message = ADLAN_PM_7;
}
}
}
if(isset($_POST['updatelimits']))
{
if($pref['pm_limits'] != $_POST['pm_limits'])
{
$pref['pm_limits'] = $_POST['pm_limits'];
save_prefs();
$message .= ADLAN_PM_8."
";
}
foreach(array_keys($_POST['inbox_count']) as $id)
{
if($_POST['inbox_count'][$id] == "" && $_POST['outbox_count'][$id] == "" && $_POST['inbox_size'][$id] == "" && $_POST['outbox_size'][$id] == "")
{
//All entries empty - Remove record
if($sql->db_Delete('generic',"gen_id = {$id}"))
{
$message .= $id.ADLAN_PM_9."
";
}
else
{
$message .= $id.ADLAN_PM_10."
";
}
}
else
{
$sql->db_Update('generic',"gen_user_id = '{$_POST['inbox_count'][$id]}', gen_ip = '{$_POST['outbox_count'][$id]}', gen_intdata = '{$_POST['inbox_size'][$id]}', gen_chardata = '{$_POST['outbox_size'][$id]}' WHERE gen_id = {$id}");
$message .= $id.ADLAN_PM_11."
";
}
}
}
if(isset($message))
{
$ns->tablerender("", $message);
}
if($action == "main")
{
$ns->tablerender(ADLAN_PM_12, show_options());
}
if($action == "limits")
{
$ns->tablerender(ADLAN_PM_14, show_limits());
$ns->tablerender(ADLAN_PM_15, add_limit());
}
require_once(e_ADMIN."footer.php");
function yes_no($fname)
{
global $pm_prefs;
$ret =
form::form_radio("option[{$fname}]", "1", ($pm_prefs[$fname] ? "1" : "0"), "", "").LAN_YES." ".
form::form_radio("option[{$fname}]", "0", ($pm_prefs[$fname] ? "0" : "1"), "", "").LAN_NO;
return $ret;
}
function show_options()
{
global $pm_prefs;
$txt = "