diff --git a/e107_plugins/pm/languages/English_admin_pm.php b/e107_plugins/pm/languages/English_admin_pm.php
index 47cffe043..539ef4ab0 100755
--- a/e107_plugins/pm/languages/English_admin_pm.php
+++ b/e107_plugins/pm/languages/English_admin_pm.php
@@ -30,7 +30,7 @@ define('ADLAN_PM_27', "Allow posting of attachments");
define('ADLAN_PM_28', "Maximum attachment size");
define('ADLAN_PM_29', "Allow sending to all members");
define('ADLAN_PM_30', "Allow sending to multiple recipients");
-define('ADLAN_PM_31', "Enable sending to userclass");
+define('ADLAN_PM_31', 'Userclass allowed to send to userclass');
define('ADLAN_PM_32', "Update Settings");
define('ADLAN_PM_33', "Inactive (no limits)");
define('ADLAN_PM_34', "PM counts");
@@ -83,6 +83,9 @@ define('ADLAN_PM_76', 'No changes made - nothing logged');
define('ADLAN_PM_77', '(Empty all fields and Update to delete a limit)');
define('ADLAN_PM_78', 'Check attachments');
define('ADLAN_PM_79', '--ORPHANS-- unused attachments deleted. --MISSING-- missing attachments noted');
-define('ADLAN_PM_80', '');
+define('ADLAN_PM_80', 'Preference formats updated');
+define('ADLAN_PM_81', '');
+define('ADLAN_PM_82', '');
+define('ADLAN_PM_83', '');
?>
diff --git a/e107_plugins/pm/pm.php b/e107_plugins/pm/pm.php
index a5de2e89f..7de654fbb 100755
--- a/e107_plugins/pm/pm.php
+++ b/e107_plugins/pm/pm.php
@@ -9,22 +9,20 @@
*
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/pm/pm.php,v $
- * $Revision: 1.13 $
- * $Date: 2009-12-10 20:40:38 $
+ * $Revision: 1.14 $
+ * $Date: 2009-12-16 20:23:32 $
* $Author: e107steved $
*/
+/*
+TODO:
+4. Check 'to' field - can sometimes be text
+
+*/
$retrieve_prefs[] = 'pm_prefs';
require_once('../../class2.php');
- if($_POST['keyword'])
- {
- pm_user_lookup();
- }
-
-
-
if (!e107::isInstalled('pm'))
{
@@ -32,9 +30,20 @@ if (!e107::isInstalled('pm'))
exit;
}
+
+
+if($_POST['keyword'])
+{
+ pm_user_lookup();
+}
+
+
+
require_once(e_PLUGIN.'pm/pm_class.php');
require_once(e_PLUGIN.'pm/pm_func.php');
include_lan(e_PLUGIN.'pm/languages/'.e_LANGUAGE.'.php');
+e107::getScParser();
+require_once(e_PLUGIN.'pm/pm_shortcodes.php');
define('ATTACHMENT_ICON', "");
@@ -46,6 +55,13 @@ $pm_proc_id = intval(varset($qs[1],0));
$pm_prefs = $sysprefs->getArray('pm_prefs');
+
+$pm_prefs['perpage'] = intval($pm_prefs['perpage']);
+if($pm_prefs['perpage'] == 0)
+{
+ $pm_prefs['perpage'] = 10;
+}
+
if(!isset($pm_prefs['pm_class']) || !check_class($pm_prefs['pm_class']))
{
require_once(HEADERF);
@@ -54,13 +70,404 @@ if(!isset($pm_prefs['pm_class']) || !check_class($pm_prefs['pm_class']))
exit;
}
-$pm =& new private_message;
-$message = '';
-$pm_prefs['perpage'] = intval($pm_prefs['perpage']);
-if($pm_prefs['perpage'] == 0)
+setScVar('pm_handler_shortcodes','pmPrefs', $pm_prefs);
+
+
+
+
+
+
+
+
+
+
+
+class pm_extended extends private_message
{
- $pm_prefs['perpage'] = 10;
+ protected $e107;
+ protected $pmPrefs;
+
+
+ /**
+ * Constructor
+ *
+ * @param array $prefs - pref settings for PM plugin
+ * @return none
+ */
+ public function __construct($prefs)
+ {
+ $this->e107 = e107::getInstance();
+ $this->pmPrefs = $prefs;
+ }
+
+
+
+ /**
+ * Show the 'Send to' form
+ * @param array|int $to_uid - a PM block of message to reply to, or UID of user to send to
+ *
+ * @return string text for display
+ */
+ function show_send($to_uid)
+ {
+ $pm_outbox = pm_getInfo('outbox');
+ if (is_array($to_uid))
+ {
+ $pm_info = $to_uid; // We've been passed a 'reply to' PM
+ $to_uid = $pm_info['pm_from'];
+ }
+ if($to_uid)
+ {
+ $sql2 =& new db;
+ if($sql2->db_Select('user', 'user_name', 'user_id = '.intval($to_uid)))
+ {
+ $row=$sql2->db_Fetch();
+ $pm_info['from_name'] = $row['user_name'];
+ }
+ }
+ echo "Show_send: {$to_uid} from {$pm_info['from_name']} is happening
";
+
+ if($pm_outbox['outbox']['filled'] >= 100)
+ {
+ return str_replace('{PERCENT}', $pm_outbox['outbox']['filled'], LAN_PM_13);
+ }
+ $tpl_file = THEME.'pm_template.php';
+ include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php');
+ $enc = (check_class($this->pmPrefs['attach_class']) ? "enctype='multipart/form-data'" : '');
+ setScVar('pm_handler_shortcodes','pmInfo', $pm_info);
+ $text = "