From bff8345a5d50d0ff56cfd40453bf4ea22e10477b Mon Sep 17 00:00:00 2001 From: rica-carv Date: Mon, 3 Apr 2017 14:58:09 +0100 Subject: [PATCH 01/18] Update private_msg_menu.php --- e107_plugins/pm/private_msg_menu.php | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/e107_plugins/pm/private_msg_menu.php b/e107_plugins/pm/private_msg_menu.php index 0d9d72754..71cc07adc 100755 --- a/e107_plugins/pm/private_msg_menu.php +++ b/e107_plugins/pm/private_msg_menu.php @@ -97,28 +97,6 @@ $pmManager = new pmbox_manager($pm_prefs); //setScVar('pm_handler_shortcodes','pmManager', $pmManager); -define('PM_INBOX_ICON', "".LAN_PLUGIN_PM_INBOX.""); -define('PM_OUTBOX_ICON', "".LAN_PLUGIN_PM_OUTBOX.""); -define('PM_SEND_LINK', LAN_PLUGIN_PM_NEW); -define('NEWPM_ANIMATION', ""); - - -$sc_style['PM_SEND_PM_LINK']['pre'] = "

"; -$sc_style['PM_SEND_PM_LINK']['post'] = ""; - -$sc_style['PM_INBOX_FILLED']['pre'] = "["; -$sc_style['PM_INBOX_FILLED']['post'] = "%]"; - -$sc_style['PM_OUTBOX_FILLED']['pre'] = "["; -$sc_style['PM_OUTBOX_FILLED']['post'] = "%]"; - -$sc_style['PM_NEWPM_ANIMATE']['pre'] = ""; -$sc_style['PM_NEWPM_ANIMATE']['post'] = ""; - -$sc_style['PM_BLOCKED_SENDERS_MANAGE']['pre'] = "
[ "; -$sc_style['PM_BLOCKED_SENDERS_MANAGE']['post'] = ' ]'; - - if(!isset($pm_menu_template)) { //FIXME URL Breaks From 0878b72d4125baf4cfc6fa4e6515f29b23cde167 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Mon, 3 Apr 2017 15:01:22 +0100 Subject: [PATCH 02/18] Update pm_template.php --- e107_plugins/pm/pm_template.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/e107_plugins/pm/pm_template.php b/e107_plugins/pm/pm_template.php index 572b39881..7f3e4048e 100755 --- a/e107_plugins/pm/pm_template.php +++ b/e107_plugins/pm/pm_template.php @@ -38,6 +38,27 @@ else if (!defined('PM_UNREAD_ICON')) define('PM_UNREAD_ICON', "".LAN_PM_27.""); } +define('PM_INBOX_ICON', "".LAN_PLUGIN_PM_INBOX.""); +define('PM_OUTBOX_ICON', "".LAN_PLUGIN_PM_OUTBOX.""); +define('PM_SEND_LINK', LAN_PLUGIN_PM_NEW); +define('NEWPM_ANIMATION', ""); + + +$sc_style['PM_SEND_PM_LINK']['pre'] = "

"; +$sc_style['PM_SEND_PM_LINK']['post'] = ""; + +$sc_style['PM_INBOX_FILLED']['pre'] = "["; +$sc_style['PM_INBOX_FILLED']['post'] = "%]"; + +$sc_style['PM_OUTBOX_FILLED']['pre'] = "["; +$sc_style['PM_OUTBOX_FILLED']['post'] = "%]"; + +$sc_style['PM_NEWPM_ANIMATE']['pre'] = ""; +$sc_style['PM_NEWPM_ANIMATE']['post'] = ""; + +$sc_style['PM_BLOCKED_SENDERS_MANAGE']['pre'] = "
[ "; +$sc_style['PM_BLOCKED_SENDERS_MANAGE']['post'] = ' ]'; + $sc_style['PM_ATTACHMENT_ICON']['pre'] = " "; $sc_style['PM_ATTACHMENTS']['pre'] = "
"; $sc_style['PM_ATTACHMENTS']['post'] = "
"; From 35b53c73f28d626710ca45b552f29708686e579b Mon Sep 17 00:00:00 2001 From: rica-carv Date: Mon, 3 Apr 2017 15:03:18 +0100 Subject: [PATCH 03/18] Create pm_template.php --- e107_plugins/pm/templates/pm_template.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 e107_plugins/pm/templates/pm_template.php diff --git a/e107_plugins/pm/templates/pm_template.php b/e107_plugins/pm/templates/pm_template.php new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/e107_plugins/pm/templates/pm_template.php @@ -0,0 +1 @@ + From 8f2dd0377650da1a2aa49a69902d4c2b8f9b7f79 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Mon, 3 Apr 2017 15:03:33 +0100 Subject: [PATCH 04/18] Add files via upload --- e107_plugins/pm/templates/pm_template.php | 304 ++++++++++++++++++++++ 1 file changed, 304 insertions(+) diff --git a/e107_plugins/pm/templates/pm_template.php b/e107_plugins/pm/templates/pm_template.php index 8b1378917..7f3e4048e 100644 --- a/e107_plugins/pm/templates/pm_template.php +++ b/e107_plugins/pm/templates/pm_template.php @@ -1 +1,305 @@ +toGlyph('fa-envelope')); + define('PM_UNREAD_ICON', e107::getParser()->toGlyph('fa-envelope-o')); +} +else +{ + if (!defined('PM_READ_ICON')) define('PM_READ_ICON', "".LAN_PM_111.""); + if (!defined('PM_UNREAD_ICON')) define('PM_UNREAD_ICON', "".LAN_PM_27.""); +} + +define('PM_INBOX_ICON', "".LAN_PLUGIN_PM_INBOX.""); +define('PM_OUTBOX_ICON', "".LAN_PLUGIN_PM_OUTBOX.""); +define('PM_SEND_LINK', LAN_PLUGIN_PM_NEW); +define('NEWPM_ANIMATION', ""); + + +$sc_style['PM_SEND_PM_LINK']['pre'] = "

"; +$sc_style['PM_SEND_PM_LINK']['post'] = ""; + +$sc_style['PM_INBOX_FILLED']['pre'] = "["; +$sc_style['PM_INBOX_FILLED']['post'] = "%]"; + +$sc_style['PM_OUTBOX_FILLED']['pre'] = "["; +$sc_style['PM_OUTBOX_FILLED']['post'] = "%]"; + +$sc_style['PM_NEWPM_ANIMATE']['pre'] = ""; +$sc_style['PM_NEWPM_ANIMATE']['post'] = ""; + +$sc_style['PM_BLOCKED_SENDERS_MANAGE']['pre'] = "
[ "; +$sc_style['PM_BLOCKED_SENDERS_MANAGE']['post'] = ' ]'; + +$sc_style['PM_ATTACHMENT_ICON']['pre'] = " "; +$sc_style['PM_ATTACHMENTS']['pre'] = "
"; +$sc_style['PM_ATTACHMENTS']['post'] = "
"; + +//$sc_style['PM_NEXTPREV']['pre'] = " ".LAN_PM_59; +//$sc_style['PM_NEXTPREV']['post'] = ""; + +$sc_style['PM_EMOTES']['pre'] = " + + ".LAN_PM_7.": + +"; +$sc_style['PM_EMOTES']['post'] = ""; + +$sc_style['PM_ATTACHMENT']['pre'] = " + + ".LAN_PM_8.": + +"; +$sc_style['PM_ATTACHMENT']['post'] = ""; + +$sc_style['PM_RECEIPT']['pre'] = " + + ".LAN_PM_9.": + +"; +$sc_style['PM_RECEIPT']['post'] = ""; + +$sc_style['PM_REPLY']['pre'] = " + +"; + +$sc_style['PM_REPLY']['post'] = " + +"; + +$PM_SEND_PM = "
+ + + + + + + + + + + + + + + + + + +{PM_EMOTES} +{PM_ATTACHMENT} +{PM_RECEIPT} + + + +
".LAN_PLUGIN_PM_NEW.":
".LAN_PM_2.": {PM_FORM_TO}
".LAN_PM_5.": {PM_FORM_SUBJECT}
".LAN_PM_6.": {PM_FORM_MESSAGE}
{PM_POST_BUTTON}
+
+"; + +$PM_INBOX_HEADER = " + + + + + + + + + + + + +"; + +$PM_INBOX_TABLE = "{SETIMAGE: w=30&h=30&crop=1} + + + + + + + + + +"; + +$PM_INBOX_EMPTY = " + + + +"; + +$PM_INBOX_FOOTER = " + + + + + +
  ".LAN_PM_31."".LAN_PM_5."".LAN_PM_32."{PM_COMPOSE: class=block-level}
{PM_SELECT}{PM_ATTACHMENT_ICON}{PM_AVATAR: shape=circle} {PM_FROM=link}{PM_SUBJECT=link,inbox}{PM_DATE}{PM_DELETE=inbox} {PM_BLOCK_USER}
".LAN_PM_34."
+ + {PM_DELETE_SELECTED} + + {PM_NEXTPREV=inbox} +
+"; + +$PM_OUTBOX_HEADER = " + + + + + + + + + + + + +"; + +$PM_OUTBOX_TABLE = " + + + + + + + + +"; + +$PM_OUTBOX_EMPTY = " + + + +"; +/* +$PM_OUTBOX_FOOTER = " + + + +{PM_NEXTPREV=outbox} + +
  ".LAN_PM_5."".LAN_PM_2."".LAN_PM_33." 
{PM_SELECT}{PM_ATTACHMENT_ICON}{PM_SUBJECT=link,outbox}{PM_TO=link}{PM_DATE}{PM_DELETE=outbox}
".LAN_PM_34."
+ + {PM_DELETE_SELECTED} +
+";*/ + +$PM_OUTBOX_FOOTER = " + + + + {PM_DELETE_SELECTED} + + + {PM_NEXTPREV=inbox} + + + + +"; + + + +$PM_BLOCKED_HEADER = " + + + + + + + +"; + +$PM_BLOCKED_TABLE = " + + + + + + +"; + +$PM_BLOCKED_EMPTY = " + + + +"; + +$PM_BLOCKED_FOOTER = " + + + +
 ".LAN_PM_68."".LAN_PM_69." 
{PM_BLOCKED_SELECT}{PM_BLOCKED_USER=link}{PM_BLOCKED_DATE}{PM_BLOCKED_DELETE}
".LAN_PM_67."
+ {PM_DELETE_BLOCKED_SELECTED} +
+"; + + + +$PM_SHOW = +"
+ + + + + + + +{PM_REPLY} +
+

{PM_SUBJECT} {PM_DATE}

+ {PM_FROM_TO} + {PM_READ} {PM_DELETE}
+
{PM_MESSAGE}
+ {PM_ATTACHMENTS} +
+
+
+"; + + +$PM_NOTIFY = +"
+

".LAN_PM_101."{SITENAME}

+ + + + + +
".LAN_PM_102."{USERNAME}
".LAN_PM_103."{PM_SUBJECT}
".LAN_PM_108."{PM_DATE}
".LAN_PM_104."{PM_ATTACHMENTS}
+ +

+".LAN_PM_113."
+"; From 5e25b3bcb9bee682fbcf444f5416b9b0c0364891 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Mon, 3 Apr 2017 15:04:12 +0100 Subject: [PATCH 05/18] Delete pm_template.php --- e107_plugins/pm/pm_template.php | 305 -------------------------------- 1 file changed, 305 deletions(-) delete mode 100755 e107_plugins/pm/pm_template.php diff --git a/e107_plugins/pm/pm_template.php b/e107_plugins/pm/pm_template.php deleted file mode 100755 index 7f3e4048e..000000000 --- a/e107_plugins/pm/pm_template.php +++ /dev/null @@ -1,305 +0,0 @@ -toGlyph('fa-envelope')); - define('PM_UNREAD_ICON', e107::getParser()->toGlyph('fa-envelope-o')); -} -else -{ - if (!defined('PM_READ_ICON')) define('PM_READ_ICON', "".LAN_PM_111.""); - if (!defined('PM_UNREAD_ICON')) define('PM_UNREAD_ICON', "".LAN_PM_27.""); -} - -define('PM_INBOX_ICON', "".LAN_PLUGIN_PM_INBOX.""); -define('PM_OUTBOX_ICON', "".LAN_PLUGIN_PM_OUTBOX.""); -define('PM_SEND_LINK', LAN_PLUGIN_PM_NEW); -define('NEWPM_ANIMATION', ""); - - -$sc_style['PM_SEND_PM_LINK']['pre'] = "

"; -$sc_style['PM_SEND_PM_LINK']['post'] = ""; - -$sc_style['PM_INBOX_FILLED']['pre'] = "["; -$sc_style['PM_INBOX_FILLED']['post'] = "%]"; - -$sc_style['PM_OUTBOX_FILLED']['pre'] = "["; -$sc_style['PM_OUTBOX_FILLED']['post'] = "%]"; - -$sc_style['PM_NEWPM_ANIMATE']['pre'] = ""; -$sc_style['PM_NEWPM_ANIMATE']['post'] = ""; - -$sc_style['PM_BLOCKED_SENDERS_MANAGE']['pre'] = "
[ "; -$sc_style['PM_BLOCKED_SENDERS_MANAGE']['post'] = ' ]'; - -$sc_style['PM_ATTACHMENT_ICON']['pre'] = " "; -$sc_style['PM_ATTACHMENTS']['pre'] = "
"; -$sc_style['PM_ATTACHMENTS']['post'] = "
"; - -//$sc_style['PM_NEXTPREV']['pre'] = " ".LAN_PM_59; -//$sc_style['PM_NEXTPREV']['post'] = ""; - -$sc_style['PM_EMOTES']['pre'] = " - - ".LAN_PM_7.": - -"; -$sc_style['PM_EMOTES']['post'] = ""; - -$sc_style['PM_ATTACHMENT']['pre'] = " - - ".LAN_PM_8.": - -"; -$sc_style['PM_ATTACHMENT']['post'] = ""; - -$sc_style['PM_RECEIPT']['pre'] = " - - ".LAN_PM_9.": - -"; -$sc_style['PM_RECEIPT']['post'] = ""; - -$sc_style['PM_REPLY']['pre'] = " - -"; - -$sc_style['PM_REPLY']['post'] = " - -"; - -$PM_SEND_PM = "
- - - - - - - - - - - - - - - - - - -{PM_EMOTES} -{PM_ATTACHMENT} -{PM_RECEIPT} - - - -
".LAN_PLUGIN_PM_NEW.":
".LAN_PM_2.": {PM_FORM_TO}
".LAN_PM_5.": {PM_FORM_SUBJECT}
".LAN_PM_6.": {PM_FORM_MESSAGE}
{PM_POST_BUTTON}
-
-"; - -$PM_INBOX_HEADER = " - - - - - - - - - - - - -"; - -$PM_INBOX_TABLE = "{SETIMAGE: w=30&h=30&crop=1} - - - - - - - - - -"; - -$PM_INBOX_EMPTY = " - - - -"; - -$PM_INBOX_FOOTER = " - - - - - -
  ".LAN_PM_31."".LAN_PM_5."".LAN_PM_32."{PM_COMPOSE: class=block-level}
{PM_SELECT}{PM_ATTACHMENT_ICON}{PM_AVATAR: shape=circle} {PM_FROM=link}{PM_SUBJECT=link,inbox}{PM_DATE}{PM_DELETE=inbox} {PM_BLOCK_USER}
".LAN_PM_34."
- - {PM_DELETE_SELECTED} - - {PM_NEXTPREV=inbox} -
-"; - -$PM_OUTBOX_HEADER = " - - - - - - - - - - - - -"; - -$PM_OUTBOX_TABLE = " - - - - - - - - -"; - -$PM_OUTBOX_EMPTY = " - - - -"; -/* -$PM_OUTBOX_FOOTER = " - - - -{PM_NEXTPREV=outbox} - -
  ".LAN_PM_5."".LAN_PM_2."".LAN_PM_33." 
{PM_SELECT}{PM_ATTACHMENT_ICON}{PM_SUBJECT=link,outbox}{PM_TO=link}{PM_DATE}{PM_DELETE=outbox}
".LAN_PM_34."
- - {PM_DELETE_SELECTED} -
-";*/ - -$PM_OUTBOX_FOOTER = " - - - - {PM_DELETE_SELECTED} - - - {PM_NEXTPREV=inbox} - - - - -"; - - - -$PM_BLOCKED_HEADER = " - - - - - - - -"; - -$PM_BLOCKED_TABLE = " - - - - - - -"; - -$PM_BLOCKED_EMPTY = " - - - -"; - -$PM_BLOCKED_FOOTER = " - - - -
 ".LAN_PM_68."".LAN_PM_69." 
{PM_BLOCKED_SELECT}{PM_BLOCKED_USER=link}{PM_BLOCKED_DATE}{PM_BLOCKED_DELETE}
".LAN_PM_67."
- {PM_DELETE_BLOCKED_SELECTED} -
-"; - - - -$PM_SHOW = -"
- - - - - - - -{PM_REPLY} -
-

{PM_SUBJECT} {PM_DATE}

- {PM_FROM_TO} - {PM_READ} {PM_DELETE}
-
{PM_MESSAGE}
- {PM_ATTACHMENTS} -
-
-
-"; - - -$PM_NOTIFY = -"
-

".LAN_PM_101."{SITENAME}

- - - - - -
".LAN_PM_102."{USERNAME}
".LAN_PM_103."{PM_SUBJECT}
".LAN_PM_108."{PM_DATE}
".LAN_PM_104."{PM_ATTACHMENTS}
- -

-".LAN_PM_113."
-"; - From 23622b70f4b44763c9b897cf54908dfad9b1f336 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Mon, 3 Apr 2017 15:05:31 +0100 Subject: [PATCH 06/18] Add files via upload --- e107_plugins/pm/pm_menu.php | 151 ++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 e107_plugins/pm/pm_menu.php diff --git a/e107_plugins/pm/pm_menu.php b/e107_plugins/pm/pm_menu.php new file mode 100644 index 000000000..71cc07adc --- /dev/null +++ b/e107_plugins/pm/pm_menu.php @@ -0,0 +1,151 @@ + + + ".$pm_inbox['inbox']['new'].' '.LAN_PM_109." + + + + + + + +
+ --- ".LAN_PM." ---
".$pm_inbox['inbox']['new'].' '.LAN_PM_109."
".$pm_inbox['inbox']['unread'].' '.LAN_PM_37."

+
+ +
+
+ + "; + $popuptext = str_replace("\n", '', $popuptext); + $popuptext = str_replace("\t", '', $popuptext); + $text .= " + "; + return $text; + } +} + + +$pm_prefs = e107::getPlugPref('pm'); +//global $sysprefs, $pm_prefs; + + + +//if(!isset($pm_prefs['perpage'])) +//{ +// $pm_prefs = $sysprefs->getArray('pm_prefs'); + +//} + +require_once(e_PLUGIN.'pm/pm_func.php'); + +e107::getScParser(); + +require_once(e_PLUGIN.'pm/pm_shortcodes.php'); + +//setScVar('pm_handler_shortcodes','pmPrefs', $pm_prefs); +$pmManager = new pmbox_manager($pm_prefs); + +//setScVar('pm_handler_shortcodes','pmManager', $pmManager); + +if(!isset($pm_menu_template)) +{ + //FIXME URL Breaks + /* + $pm_menu_template = " + ".PM_INBOX_ICON." + ".LAN_PLUGIN_PM_INBOX." + {PM_NEWPM_ANIMATE} +
+ {PM_INBOX_TOTAL} ".LAN_PM_36.", {PM_INBOX_UNREAD} ".LAN_PM_37." {PM_INBOX_FILLED} +
+ ".PM_OUTBOX_ICON." + ".LAN_PLUGIN_PM_OUTBOX."
+ {PM_OUTBOX_TOTAL} ".LAN_PM_36.", {PM_OUTBOX_UNREAD} ".LAN_PM_37." {PM_OUTBOX_FILLED} + {PM_SEND_PM_LINK} + {PM_BLOCKED_SENDERS_MANAGE} + "; + */ + + $pm_menu_template = " + ".PM_INBOX_ICON." + ".LAN_PLUGIN_PM_INBOX." + {PM_NEWPM_ANIMATE} +
+ {PM_INBOX_TOTAL} ".LAN_PM_36.", {PM_INBOX_UNREAD} ".LAN_PM_37." {PM_INBOX_FILLED} +
+ ".PM_OUTBOX_ICON." + ".LAN_PLUGIN_PM_OUTBOX."
+ {PM_OUTBOX_TOTAL} ".LAN_PM_36.", {PM_OUTBOX_UNREAD} ".LAN_PM_37." {PM_OUTBOX_FILLED} + {PM_SEND_PM_LINK} + {PM_BLOCKED_SENDERS_MANAGE} + "; +} + + +if(check_class($pm_prefs['pm_class'])) +{ + $tp = e107::getParser(); + $sc = e107::getScBatch('pm',TRUE, 'pm'); + + $pm_inbox = $pmManager->pm_getInfo('inbox'); + + $txt = "\n".$tp->parseTemplate($pm_menu_template, TRUE, $sc); + + if($pm_inbox['inbox']['new'] > 0 && $pm_prefs['popup'] && strpos(e_SELF, 'pm.php') === FALSE && $_COOKIE['pm-alert'] != 'ON') + { + + $txt .= pm_show_popup($pm_inbox, $pm_prefs['popup_delay']); + } + + $ns->tablerender(LAN_PM, $txt, 'pm'); +} From d28101c59d2e41f53784a6441a30026d03074a9a Mon Sep 17 00:00:00 2001 From: rica-carv Date: Mon, 3 Apr 2017 15:05:57 +0100 Subject: [PATCH 07/18] Delete private_msg_menu.php --- e107_plugins/pm/private_msg_menu.php | 151 --------------------------- 1 file changed, 151 deletions(-) delete mode 100755 e107_plugins/pm/private_msg_menu.php diff --git a/e107_plugins/pm/private_msg_menu.php b/e107_plugins/pm/private_msg_menu.php deleted file mode 100755 index 71cc07adc..000000000 --- a/e107_plugins/pm/private_msg_menu.php +++ /dev/null @@ -1,151 +0,0 @@ - - - ".$pm_inbox['inbox']['new'].' '.LAN_PM_109." - - - - - - - -
- --- ".LAN_PM." ---
".$pm_inbox['inbox']['new'].' '.LAN_PM_109."
".$pm_inbox['inbox']['unread'].' '.LAN_PM_37."

-
- -
-
- - "; - $popuptext = str_replace("\n", '', $popuptext); - $popuptext = str_replace("\t", '', $popuptext); - $text .= " - "; - return $text; - } -} - - -$pm_prefs = e107::getPlugPref('pm'); -//global $sysprefs, $pm_prefs; - - - -//if(!isset($pm_prefs['perpage'])) -//{ -// $pm_prefs = $sysprefs->getArray('pm_prefs'); - -//} - -require_once(e_PLUGIN.'pm/pm_func.php'); - -e107::getScParser(); - -require_once(e_PLUGIN.'pm/pm_shortcodes.php'); - -//setScVar('pm_handler_shortcodes','pmPrefs', $pm_prefs); -$pmManager = new pmbox_manager($pm_prefs); - -//setScVar('pm_handler_shortcodes','pmManager', $pmManager); - -if(!isset($pm_menu_template)) -{ - //FIXME URL Breaks - /* - $pm_menu_template = " - ".PM_INBOX_ICON." - ".LAN_PLUGIN_PM_INBOX." - {PM_NEWPM_ANIMATE} -
- {PM_INBOX_TOTAL} ".LAN_PM_36.", {PM_INBOX_UNREAD} ".LAN_PM_37." {PM_INBOX_FILLED} -
- ".PM_OUTBOX_ICON." - ".LAN_PLUGIN_PM_OUTBOX."
- {PM_OUTBOX_TOTAL} ".LAN_PM_36.", {PM_OUTBOX_UNREAD} ".LAN_PM_37." {PM_OUTBOX_FILLED} - {PM_SEND_PM_LINK} - {PM_BLOCKED_SENDERS_MANAGE} - "; - */ - - $pm_menu_template = " - ".PM_INBOX_ICON." - ".LAN_PLUGIN_PM_INBOX." - {PM_NEWPM_ANIMATE} -
- {PM_INBOX_TOTAL} ".LAN_PM_36.", {PM_INBOX_UNREAD} ".LAN_PM_37." {PM_INBOX_FILLED} -
- ".PM_OUTBOX_ICON." - ".LAN_PLUGIN_PM_OUTBOX."
- {PM_OUTBOX_TOTAL} ".LAN_PM_36.", {PM_OUTBOX_UNREAD} ".LAN_PM_37." {PM_OUTBOX_FILLED} - {PM_SEND_PM_LINK} - {PM_BLOCKED_SENDERS_MANAGE} - "; -} - - -if(check_class($pm_prefs['pm_class'])) -{ - $tp = e107::getParser(); - $sc = e107::getScBatch('pm',TRUE, 'pm'); - - $pm_inbox = $pmManager->pm_getInfo('inbox'); - - $txt = "\n".$tp->parseTemplate($pm_menu_template, TRUE, $sc); - - if($pm_inbox['inbox']['new'] > 0 && $pm_prefs['popup'] && strpos(e_SELF, 'pm.php') === FALSE && $_COOKIE['pm-alert'] != 'ON') - { - - $txt .= pm_show_popup($pm_inbox, $pm_prefs['popup_delay']); - } - - $ns->tablerender(LAN_PM, $txt, 'pm'); -} From 9b9e534f4abf7c73c51831ca3836ac5b684cc048 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Mon, 3 Apr 2017 15:14:24 +0100 Subject: [PATCH 08/18] Update pm_menu.php --- e107_plugins/pm/pm_menu.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/e107_plugins/pm/pm_menu.php b/e107_plugins/pm/pm_menu.php index 71cc07adc..9b57a666e 100644 --- a/e107_plugins/pm/pm_menu.php +++ b/e107_plugins/pm/pm_menu.php @@ -78,7 +78,18 @@ if(!function_exists('pm_show_popup')) $pm_prefs = e107::getPlugPref('pm'); //global $sysprefs, $pm_prefs; - +if (file_exists(THEME."templates/pm_template.php")) + { + include(THEME."templates/pm_template.php"); + } + elseif (file_exists(THEME."pm_template.php")) + { + include(THEME."pm_template.php"); + } + else + { + include(e_CORE."templates/pm_template.php"); + } //if(!isset($pm_prefs['perpage'])) //{ @@ -97,7 +108,7 @@ $pmManager = new pmbox_manager($pm_prefs); //setScVar('pm_handler_shortcodes','pmManager', $pmManager); -if(!isset($pm_menu_template)) +if(!isset($PM_MENU)) { //FIXME URL Breaks /* @@ -116,7 +127,7 @@ if(!isset($pm_menu_template)) "; */ - $pm_menu_template = " + $PM_MENU = " ".PM_INBOX_ICON." ".LAN_PLUGIN_PM_INBOX." {PM_NEWPM_ANIMATE} @@ -139,7 +150,7 @@ if(check_class($pm_prefs['pm_class'])) $pm_inbox = $pmManager->pm_getInfo('inbox'); - $txt = "\n".$tp->parseTemplate($pm_menu_template, TRUE, $sc); + $txt = "\n".$tp->parseTemplate($PM_MENU, TRUE, $sc); if($pm_inbox['inbox']['new'] > 0 && $pm_prefs['popup'] && strpos(e_SELF, 'pm.php') === FALSE && $_COOKIE['pm-alert'] != 'ON') { From fabca2877379c5dd47e2ea03e11c469c8da75838 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Mon, 3 Apr 2017 15:14:44 +0100 Subject: [PATCH 09/18] Update pm_template.php --- e107_plugins/pm/templates/pm_template.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/e107_plugins/pm/templates/pm_template.php b/e107_plugins/pm/templates/pm_template.php index 7f3e4048e..eafd2de6c 100644 --- a/e107_plugins/pm/templates/pm_template.php +++ b/e107_plugins/pm/templates/pm_template.php @@ -59,6 +59,20 @@ $sc_style['PM_NEWPM_ANIMATE']['post'] = ""; $sc_style['PM_BLOCKED_SENDERS_MANAGE']['pre'] = "
[ "; $sc_style['PM_BLOCKED_SENDERS_MANAGE']['post'] = ' ]'; +$PM_MENU = " +".PM_INBOX_ICON." +".LAN_PLUGIN_PM_INBOX." +{PM_NEWPM_ANIMATE} +
+{PM_INBOX_TOTAL} ".LAN_PM_36.", {PM_INBOX_UNREAD} ".LAN_PM_37." {PM_INBOX_FILLED} +
+".PM_OUTBOX_ICON." +".LAN_PLUGIN_PM_OUTBOX."
+{PM_OUTBOX_TOTAL} ".LAN_PM_36.", {PM_OUTBOX_UNREAD} ".LAN_PM_37." {PM_OUTBOX_FILLED} +{PM_SEND_PM_LINK} +{PM_BLOCKED_SENDERS_MANAGE} +"; + $sc_style['PM_ATTACHMENT_ICON']['pre'] = " "; $sc_style['PM_ATTACHMENTS']['pre'] = "
"; $sc_style['PM_ATTACHMENTS']['post'] = "
"; From 46dd807788666854d99205cc675eb479833d34f3 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Mon, 3 Apr 2017 15:18:17 +0100 Subject: [PATCH 10/18] Update pm.php --- e107_plugins/pm/pm.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/e107_plugins/pm/pm.php b/e107_plugins/pm/pm.php index 7152941be..967d967d7 100755 --- a/e107_plugins/pm/pm.php +++ b/e107_plugins/pm/pm.php @@ -176,8 +176,8 @@ class pm_extended extends private_message { 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'); + $tpl_file = THEME.'templates/pm/pm_template.php'; + include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/templates/pm_template.php'); $enc = (check_class($this->pmPrefs['attach_class']) ? "enctype='multipart/form-data'" : ''); // setScVar('pm_handler_shortcodes','pmInfo', $pm_info); @@ -205,8 +205,8 @@ class pm_extended extends private_message { $tp = e107::getParser(); - $tpl_file = THEME.'pm_template.php'; - include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); + $tpl_file = THEME.'templates/pm/pm_template.php'; + include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/templates/pm_template.php'); $pm_blocks = $this->block_get(); $pmlist = $this->pm_get_inbox(USERID, $start, $this->pmPrefs['perpage']); @@ -257,8 +257,8 @@ class pm_extended extends private_message { $tp = e107::getParser(); - $tpl_file = THEME.'pm_template.php'; - include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); + $tpl_file = THEME.'templates/pm/pm_template.php'; + include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/templates/pm_template.php'); $pmlist = $this->pm_get_outbox(USERID, $start, $this->pmPrefs['perpage']); // setScVar('pm_handler_shortcodes', 'pmNextPrev', array('start' => $start, 'total' => $pmlist['total_messages'])); @@ -304,8 +304,8 @@ class pm_extended extends private_message { $ns = e107::getRender(); - $tpl_file = THEME.'pm_template.php'; - include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); + $tpl_file = THEME.'templates/pm/pm_template.php'; + include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/templates/pm_template.php'); $pm_info = $this->pm_get($pmid); $sc = e107::getScBatch('pm',true, 'pm'); @@ -373,8 +373,8 @@ class pm_extended extends private_message public function showBlocked($start = 0) { $tp = e107::getParser(); - $tpl_file = THEME.'pm_template.php'; - include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); + $tpl_file = THEME.'templates/pm/pm_template.php'; + include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/templates/pm_template.php'); $pmBlocks = $this->block_get_user(); // TODO - handle pagination, maybe (is it likely to be necessary?) $sc = e107::getScBatch('pm',TRUE, 'pm'); From d1c96113e738b748eb34942c0ad4d8542d72527a Mon Sep 17 00:00:00 2001 From: rica-carv Date: Mon, 3 Apr 2017 15:19:17 +0100 Subject: [PATCH 11/18] Update pm_class.php --- e107_plugins/pm/pm_class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/e107_plugins/pm/pm_class.php b/e107_plugins/pm/pm_class.php index 0b3106cad..0c86d1dbb 100755 --- a/e107_plugins/pm/pm_class.php +++ b/e107_plugins/pm/pm_class.php @@ -378,11 +378,11 @@ class private_message { // require_once(e_HANDLER.'mail.php'); - $tpl_file = THEME.'pm_template.php'; + $tpl_file = THEME.'templates/pm/pm_template.php'; $PM_NOTIFY = null; // loaded in template below. - include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); + include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/templates/pm_template.php'); $template = $PM_NOTIFY; @@ -921,4 +921,4 @@ class private_message } -} \ No newline at end of file +} From a34fe15675a210d50d4e83e62ec875960a0fab50 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Mon, 3 Apr 2017 15:20:51 +0100 Subject: [PATCH 12/18] Update pm_menu.php --- e107_plugins/pm/pm_menu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_plugins/pm/pm_menu.php b/e107_plugins/pm/pm_menu.php index 9b57a666e..111c2411b 100644 --- a/e107_plugins/pm/pm_menu.php +++ b/e107_plugins/pm/pm_menu.php @@ -88,7 +88,7 @@ if (file_exists(THEME."templates/pm_template.php")) } else { - include(e_CORE."templates/pm_template.php"); + include(e_PLUGIN.'pm/templates/pm_template.php'); } //if(!isset($pm_prefs['perpage'])) From ba122e58839defa14409dbbb956c8a3fd10e180c Mon Sep 17 00:00:00 2001 From: rica-carv Date: Sun, 9 Apr 2017 16:37:03 +0100 Subject: [PATCH 13/18] Add files via upload --- .../pm/templates/pm_menu_template.php | 68 ++++++++++++++ e107_plugins/pm/templates/pm_template.php | 92 ++++++++----------- 2 files changed, 108 insertions(+), 52 deletions(-) create mode 100644 e107_plugins/pm/templates/pm_menu_template.php diff --git a/e107_plugins/pm/templates/pm_menu_template.php b/e107_plugins/pm/templates/pm_menu_template.php new file mode 100644 index 000000000..0fb507213 --- /dev/null +++ b/e107_plugins/pm/templates/pm_menu_template.php @@ -0,0 +1,68 @@ +"); +define('PM_OUTBOX_ICON', "".LAN_PLUGIN_PM_OUTBOX.""); +define('PM_SEND_LINK', LAN_PLUGIN_PM_NEW); +define('NEWPM_ANIMATION', ""); +/* +$sc_style['PM_SEND_PM_LINK']['pre'] = "

"; +$sc_style['PM_SEND_PM_LINK']['post'] = ""; + +$sc_style['PM_INBOX_FILLED']['pre'] = "["; +$sc_style['PM_INBOX_FILLED']['post'] = "%]"; + +$sc_style['PM_OUTBOX_FILLED']['pre'] = "["; +$sc_style['PM_OUTBOX_FILLED']['post'] = "%]"; + +$sc_style['PM_NEWPM_ANIMATE']['pre'] = ""; +$sc_style['PM_NEWPM_ANIMATE']['post'] = ""; + +$sc_style['PM_BLOCKED_SENDERS_MANAGE']['pre'] = "
[ "; +$sc_style['PM_BLOCKED_SENDERS_MANAGE']['post'] = ' ]'; +*/ +$PM_MENU_WRAPPER['PM_SEND_PM_LINK']= "

{---}"; +$PM_MENU_WRAPPER['PM_INBOX_FILLED']=$PM_MENU_WRAPPER['PM_OUTBOX_FILLED']= "[{---}%]"; +$PM_MENU_WRAPPER['PM_NEWPM_ANIMATE']= "{---}"; +$PM_MENU_WRAPPER['PM_BLOCKED_SENDERS_MANAGE']= "
[ {---} ]"; + +// $pm_menu_template = " + $PM_MENU_TEMPLATE = " + ".PM_INBOX_ICON." + ".LAN_PLUGIN_PM_INBOX." + {PM_NEWPM_ANIMATE} +
+ {PM_INBOX_TOTAL} ".LAN_PM_36.", {PM_INBOX_UNREAD} ".LAN_PM_37." {PM_INBOX_FILLED} +
+ ".PM_OUTBOX_ICON." + ".LAN_PLUGIN_PM_OUTBOX."
+ {PM_OUTBOX_TOTAL} ".LAN_PM_36.", {PM_OUTBOX_UNREAD} ".LAN_PM_37." {PM_OUTBOX_FILLED} + {PM_SEND_PM_LINK} + {PM_BLOCKED_SENDERS_MANAGE} + "; + + diff --git a/e107_plugins/pm/templates/pm_template.php b/e107_plugins/pm/templates/pm_template.php index eafd2de6c..1d3b5eb38 100644 --- a/e107_plugins/pm/templates/pm_template.php +++ b/e107_plugins/pm/templates/pm_template.php @@ -25,7 +25,7 @@ if (!defined('e107_INIT')) { exit; } -global $sc_style; // Needed for the PM_REPLY shortcode! +//global $sc_style; // Needed for the PM_REPLY shortcode! if(deftrue('BOOTSTRAP') && deftrue('FONTAWESOME')) { @@ -37,42 +37,7 @@ else if (!defined('PM_READ_ICON')) define('PM_READ_ICON', "".LAN_PM_111.""); if (!defined('PM_UNREAD_ICON')) define('PM_UNREAD_ICON', "".LAN_PM_27.""); } - -define('PM_INBOX_ICON', "".LAN_PLUGIN_PM_INBOX.""); -define('PM_OUTBOX_ICON', "".LAN_PLUGIN_PM_OUTBOX.""); -define('PM_SEND_LINK', LAN_PLUGIN_PM_NEW); -define('NEWPM_ANIMATION', ""); - - -$sc_style['PM_SEND_PM_LINK']['pre'] = "

"; -$sc_style['PM_SEND_PM_LINK']['post'] = ""; - -$sc_style['PM_INBOX_FILLED']['pre'] = "["; -$sc_style['PM_INBOX_FILLED']['post'] = "%]"; - -$sc_style['PM_OUTBOX_FILLED']['pre'] = "["; -$sc_style['PM_OUTBOX_FILLED']['post'] = "%]"; - -$sc_style['PM_NEWPM_ANIMATE']['pre'] = ""; -$sc_style['PM_NEWPM_ANIMATE']['post'] = ""; - -$sc_style['PM_BLOCKED_SENDERS_MANAGE']['pre'] = "
[ "; -$sc_style['PM_BLOCKED_SENDERS_MANAGE']['post'] = ' ]'; - -$PM_MENU = " -".PM_INBOX_ICON." -".LAN_PLUGIN_PM_INBOX." -{PM_NEWPM_ANIMATE} -
-{PM_INBOX_TOTAL} ".LAN_PM_36.", {PM_INBOX_UNREAD} ".LAN_PM_37." {PM_INBOX_FILLED} -
-".PM_OUTBOX_ICON." -".LAN_PLUGIN_PM_OUTBOX."
-{PM_OUTBOX_TOTAL} ".LAN_PM_36.", {PM_OUTBOX_UNREAD} ".LAN_PM_37." {PM_OUTBOX_FILLED} -{PM_SEND_PM_LINK} -{PM_BLOCKED_SENDERS_MANAGE} -"; - +/* $sc_style['PM_ATTACHMENT_ICON']['pre'] = " "; $sc_style['PM_ATTACHMENTS']['pre'] = "
"; $sc_style['PM_ATTACHMENTS']['post'] = "
"; @@ -108,8 +73,21 @@ $sc_style['PM_REPLY']['pre'] = " $sc_style['PM_REPLY']['post'] = " "; +*/ -$PM_SEND_PM = "
+$PM_WRAPPER['PM_ATTACHMENT_ICON']= " {---}"; +$PM_WRAPPER['PM_ATTACHMENTS']= "
{---}
"; + +//$sc_style['PM_NEXTPREV']['pre'] = " ".LAN_PM_59; +//$sc_style['PM_NEXTPREV']['post'] = ""; + +$PM_WRAPPER['PM_EMOTES']= "".LAN_PM_7.": {---}"; +$PM_WRAPPER['PM_ATTACHMENT']= "".LAN_PM_8.": {---}"; +$PM_WRAPPER['PM_RECEIPT']= "".LAN_PM_9.": {---}"; +$PM_WRAPPER['PM_REPLY']= "{---}"; + +//$PM_SEND_PM = "
+$PM_TEMPLATE['send'] = "
@@ -138,7 +116,8 @@ $PM_SEND_PM = "
"; -$PM_INBOX_HEADER = " +//$PM_INBOX_HEADER = " +$PM_TEMPLATE['inbox']['start'] = "
@@ -153,7 +132,8 @@ $PM_INBOX_HEADER = " "; -$PM_INBOX_TABLE = "{SETIMAGE: w=30&h=30&crop=1} +//$PM_INBOX_TABLE = "{SETIMAGE: w=30&h=30&crop=1} +$PM_TEMPLATE['inbox']['item'] = "{SETIMAGE: w=30&h=30&crop=1} @@ -165,13 +145,15 @@ $PM_INBOX_TABLE = "{SETIMAGE: w=30&h=30&crop=1} "; -$PM_INBOX_EMPTY = " +//$PM_INBOX_EMPTY = " +$PM_TEMPLATE['inbox']['empty'] = " "; -$PM_INBOX_FOOTER = " +//$PM_INBOX_FOOTER = " +$PM_TEMPLATE['inbox']['end'] = "
{PM_SELECT} {PM_ATTACHMENT_ICON}
".LAN_PM_34."
@@ -185,7 +167,8 @@ $PM_INBOX_FOOTER = "
"; -$PM_OUTBOX_HEADER = " +//$PM_OUTBOX_HEADER = " +$PM_TEMPLATE['outbox']['start'] = " @@ -200,7 +183,8 @@ $PM_OUTBOX_HEADER = " "; -$PM_OUTBOX_TABLE = " +//$PM_OUTBOX_TABLE = " +$PM_TEMPLATE['outbox']['item'] = " @@ -211,7 +195,8 @@ $PM_OUTBOX_TABLE = " "; -$PM_OUTBOX_EMPTY = " +//$PM_OUTBOX_EMPTY = " +$PM_TEMPLATE['outbox']['empty'] = " @@ -229,7 +214,8 @@ $PM_OUTBOX_FOOTER = "
{PM_SELECT} {PM_ATTACHMENT_ICON}
".LAN_PM_34."
";*/ -$PM_OUTBOX_FOOTER = " +//$PM_OUTBOX_FOOTER = " +$PM_TEMPLATE['outbox']['end'] = " @@ -245,7 +231,7 @@ $PM_OUTBOX_FOOTER = " -$PM_BLOCKED_HEADER = " +$PM_TEMPLATE['blocked']['start'] = " @@ -255,7 +241,7 @@ $PM_BLOCKED_HEADER = " "; -$PM_BLOCKED_TABLE = " +$PM_TEMPLATE['blocked']['item'] = " @@ -264,13 +250,13 @@ $PM_BLOCKED_TABLE = " "; -$PM_BLOCKED_EMPTY = " +$PM_TEMPLATE['blocked']['empty'] = " "; -$PM_BLOCKED_FOOTER = " +$PM_TEMPLATE['blocked']['end'] = "
 
{PM_BLOCKED_SELECT} {PM_BLOCKED_USER=link}
".LAN_PM_67."
{PM_DELETE_BLOCKED_SELECTED} @@ -281,7 +267,8 @@ $PM_BLOCKED_FOOTER = " -$PM_SHOW = +//$PM_SHOW = +$PM_TEMPLATE['show'] = "
@@ -303,7 +290,8 @@ $PM_SHOW = "; -$PM_NOTIFY = +//$PM_NOTIFY = +$PM_TEMPLATE['notify'] = "

".LAN_PM_101."{SITENAME}

From 4490ea48bb351fc81ee9991a5dcd056f7d37d36e Mon Sep 17 00:00:00 2001 From: rica-carv Date: Sun, 9 Apr 2017 16:37:33 +0100 Subject: [PATCH 14/18] Add files via upload --- e107_plugins/pm/pm.php | 65 +++++++++++++++++++++++------------- e107_plugins/pm/pm_class.php | 10 +++--- e107_plugins/pm/pm_menu.php | 36 +++++++++----------- 3 files changed, 64 insertions(+), 47 deletions(-) diff --git a/e107_plugins/pm/pm.php b/e107_plugins/pm/pm.php index 967d967d7..33d8df939 100755 --- a/e107_plugins/pm/pm.php +++ b/e107_plugins/pm/pm.php @@ -176,13 +176,17 @@ class pm_extended extends private_message { return str_replace('{PERCENT}', $pm_outbox['outbox']['filled'], LAN_PM_13); } - $tpl_file = THEME.'templates/pm/pm_template.php'; - include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/templates/pm_template.php'); +// $tpl_file = THEME.'pm_template.php'; +// include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); + + $PM_SEND_PM = e107::getTemplate('pm', 'pm', 'send'); + $enc = (check_class($this->pmPrefs['attach_class']) ? "enctype='multipart/form-data'" : ''); // setScVar('pm_handler_shortcodes','pmInfo', $pm_info); $sc = e107::getScBatch('pm',true, 'pm'); $sc->setVars($pm_info); + $sc->wrapper('pm'); $PM_SEND_PM = $this->updateTemplate($PM_SEND_PM); @@ -205,8 +209,10 @@ class pm_extended extends private_message { $tp = e107::getParser(); - $tpl_file = THEME.'templates/pm/pm_template.php'; - include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/templates/pm_template.php'); +// $tpl_file = THEME.'pm_template.php'; +// include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); + + $PM_INBOX = e107::getTemplate('pm', 'pm', 'inbox'); $pm_blocks = $this->block_get(); $pmlist = $this->pm_get_inbox(USERID, $start, $this->pmPrefs['perpage']); @@ -215,12 +221,13 @@ class pm_extended extends private_message $sc = e107::getScBatch('pm',true, 'pm'); $sc->pmNextPrev = array('start' => $start, 'total' => $pmlist['total_messages']); + $sc->wrapper('pm'); - - $PM_INBOX_HEADER = $this->updateTemplate($PM_INBOX_HEADER); - $PM_INBOX_TABLE = $this->updateTemplate($PM_INBOX_TABLE); - $PM_INBOX_EMPTY = $this->updateTemplate($PM_INBOX_EMPTY); - $PM_INBOX_FOOTER = $this->updateTemplate($PM_INBOX_FOOTER); +// Is updateTemplate really necessary for v2.x templates? + $PM_INBOX_HEADER = $this->updateTemplate($PM_INBOX['start']); + $PM_INBOX_TABLE = $this->updateTemplate($PM_INBOX['item']); + $PM_INBOX_EMPTY = $this->updateTemplate($PM_INBOX['empty']); + $PM_INBOX_FOOTER = $this->updateTemplate($PM_INBOX['end']); $txt = "
"; $txt .= $tp->parseTemplate($PM_INBOX_HEADER, true, $sc); @@ -257,18 +264,23 @@ class pm_extended extends private_message { $tp = e107::getParser(); - $tpl_file = THEME.'templates/pm/pm_template.php'; - include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/templates/pm_template.php'); +// $tpl_file = THEME.'pm_template.php'; +// include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); + + $PM_OUTBOX = e107::getTemplate('pm', 'pm', 'outbox'); + $pmlist = $this->pm_get_outbox(USERID, $start, $this->pmPrefs['perpage']); // setScVar('pm_handler_shortcodes', 'pmNextPrev', array('start' => $start, 'total' => $pmlist['total_messages'])); $sc = e107::getScBatch('pm', true, 'pm'); $sc->pmNextPrev = array('start' => $start, 'total' => $pmlist['total_messages']); + $sc->wrapper('pm'); - $PM_OUTBOX_HEADER = $this->updateTemplate($PM_OUTBOX_HEADER); - $PM_OUTBOX_TABLE = $this->updateTemplate($PM_OUTBOX_TABLE); - $PM_OUTBOX_EMPTY = $this->updateTemplate($PM_OUTBOX_EMPTY); - $PM_OUTBOX_FOOTER = $this->updateTemplate($PM_OUTBOX_FOOTER); +// Is updateTemplate really necessary for v2.x templates? + $PM_OUTBOX_HEADER = $this->updateTemplate($PM_OUTBOX['start']); + $PM_OUTBOX_TABLE = $this->updateTemplate($PM_OUTBOX['item']); + $PM_OUTBOX_EMPTY = $this->updateTemplate($PM_OUTBOX['empty']); + $PM_OUTBOX_FOOTER = $this->updateTemplate($PM_OUTBOX['end']); $txt = ""; @@ -304,12 +316,15 @@ class pm_extended extends private_message { $ns = e107::getRender(); - $tpl_file = THEME.'templates/pm/pm_template.php'; - include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/templates/pm_template.php'); +// $tpl_file = THEME.'pm_template.php'; +// include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); + $PM_SHOW = e107::getTemplate('pm', 'pm', 'show'); + $pm_info = $this->pm_get($pmid); $sc = e107::getScBatch('pm',true, 'pm'); $sc->setVars($pm_info); + $sc->wrapper('pm'); if($pm_info['pm_to'] != USERID && $pm_info['pm_from'] != USERID) { @@ -373,17 +388,21 @@ class pm_extended extends private_message public function showBlocked($start = 0) { $tp = e107::getParser(); - $tpl_file = THEME.'templates/pm/pm_template.php'; - include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/templates/pm_template.php'); +// $tpl_file = THEME.'pm_template.php'; +// include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); + $PM_BLOCKED = e107::getTemplate('pm', 'pm', 'blocked'); + $pmBlocks = $this->block_get_user(); // TODO - handle pagination, maybe (is it likely to be necessary?) $sc = e107::getScBatch('pm',TRUE, 'pm'); $sc->pmBlocks = $pmBlocks; + $sc->wrapper('pm'); - $PM_BLOCKED_HEADER = $this->updateTemplate($PM_BLOCKED_HEADER); - $PM_BLOCKED_TABLE = $this->updateTemplate($PM_BLOCKED_TABLE); - $PM_BLOCKED_EMPTY = $this->updateTemplate($PM_BLOCKED_EMPTY); - $PM_BLOCKED_FOOTER = $this->updateTemplate($PM_BLOCKED_FOOTER); +// Is updateTemplate really necessary for v2.x templates? + $PM_BLOCKED_HEADER = $this->updateTemplate($PM_BLOCKED['start']); + $PM_BLOCKED_TABLE = $this->updateTemplate($PM_BLOCKED['item']); + $PM_BLOCKED_EMPTY = $this->updateTemplate($PM_BLOCKED['empty']); + $PM_BLOCKED_FOOTER = $this->updateTemplate($PM_BLOCKED['end']); $txt = ""; diff --git a/e107_plugins/pm/pm_class.php b/e107_plugins/pm/pm_class.php index 0c86d1dbb..581a73636 100755 --- a/e107_plugins/pm/pm_class.php +++ b/e107_plugins/pm/pm_class.php @@ -377,14 +377,16 @@ class private_message function pm_send_notify($uid, $pmInfo, $pmid, $attach_count = 0) { // require_once(e_HANDLER.'mail.php'); - - $tpl_file = THEME.'templates/pm/pm_template.php'; +/* + $tpl_file = THEME.'pm_template.php'; $PM_NOTIFY = null; // loaded in template below. - include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/templates/pm_template.php'); + include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); $template = $PM_NOTIFY; +*/ + $template = e107::getTemplate('pm', 'pm', 'notify'); if(empty($template)) // BC Fallback. { @@ -921,4 +923,4 @@ class private_message } -} +} \ No newline at end of file diff --git a/e107_plugins/pm/pm_menu.php b/e107_plugins/pm/pm_menu.php index 111c2411b..5f2bf05fa 100644 --- a/e107_plugins/pm/pm_menu.php +++ b/e107_plugins/pm/pm_menu.php @@ -22,7 +22,9 @@ * @subpackage pm * @version $Id$; */ - +$pm_prefs = e107::getPlugPref('pm'); +if(check_class($pm_prefs['pm_class'])) +{ if (!defined('e107_INIT')) { exit; } if (!e107::isInstalled('pm')) { return ''; } @@ -75,21 +77,10 @@ if(!function_exists('pm_show_popup')) } -$pm_prefs = e107::getPlugPref('pm'); +//$pm_prefs = e107::getPlugPref('pm'); //global $sysprefs, $pm_prefs; -if (file_exists(THEME."templates/pm_template.php")) - { - include(THEME."templates/pm_template.php"); - } - elseif (file_exists(THEME."pm_template.php")) - { - include(THEME."pm_template.php"); - } - else - { - include(e_PLUGIN.'pm/templates/pm_template.php'); - } + //if(!isset($pm_prefs['perpage'])) //{ @@ -108,7 +99,10 @@ $pmManager = new pmbox_manager($pm_prefs); //setScVar('pm_handler_shortcodes','pmManager', $pmManager); -if(!isset($PM_MENU)) +$template = e107::getTemplate('pm', 'pm_menu'); + +//if(!isset($pm_menu_template)) +if(!isset($PM_MENU_TEMPLATE)) { //FIXME URL Breaks /* @@ -127,7 +121,8 @@ if(!isset($PM_MENU)) "; */ - $PM_MENU = " +// $pm_menu_template = " + $PM_MENU_TEMPLATE = " ".PM_INBOX_ICON." ".LAN_PLUGIN_PM_INBOX." {PM_NEWPM_ANIMATE} @@ -142,15 +137,16 @@ if(!isset($PM_MENU)) "; } - -if(check_class($pm_prefs['pm_class'])) -{ +//if(check_class($pm_prefs['pm_class'])) +//{ $tp = e107::getParser(); $sc = e107::getScBatch('pm',TRUE, 'pm'); $pm_inbox = $pmManager->pm_getInfo('inbox'); + $sc->wrapper('pm_menu'); - $txt = "\n".$tp->parseTemplate($PM_MENU, TRUE, $sc); +// $txt = "\n".$tp->parseTemplate($pm_menu_template, TRUE, $sc); + $txt = "\n".$tp->parseTemplate($PM_MENU_TEMPLATE, TRUE, $sc); if($pm_inbox['inbox']['new'] > 0 && $pm_prefs['popup'] && strpos(e_SELF, 'pm.php') === FALSE && $_COOKIE['pm-alert'] != 'ON') { From 0191c3bda2ee96008f1a84c84e373c6faf3718af Mon Sep 17 00:00:00 2001 From: rica-carv Date: Tue, 11 Apr 2017 20:47:09 +0100 Subject: [PATCH 15/18] Update pm_class.php --- e107_plugins/pm/pm_class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/e107_plugins/pm/pm_class.php b/e107_plugins/pm/pm_class.php index 581a73636..126d6158d 100755 --- a/e107_plugins/pm/pm_class.php +++ b/e107_plugins/pm/pm_class.php @@ -386,7 +386,11 @@ class private_message $template = $PM_NOTIFY; */ - $template = e107::getTemplate('pm', 'pm', 'notify'); + if(THEME_LEGACY){ + include_once(THEME.'pm_template.php'); + $template = $PM_NOTIFY; + } + if (!$PM_NOTIFY){$template = e107::getTemplate('pm', 'pm', 'notify');} if(empty($template)) // BC Fallback. { @@ -923,4 +927,4 @@ class private_message } -} \ No newline at end of file +} From 163e2327da30d647bda953c8eeb5aada6fedcb18 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Tue, 11 Apr 2017 20:47:19 +0100 Subject: [PATCH 16/18] Update pm.php --- e107_plugins/pm/pm.php | 75 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 62 insertions(+), 13 deletions(-) diff --git a/e107_plugins/pm/pm.php b/e107_plugins/pm/pm.php index 33d8df939..871d81944 100755 --- a/e107_plugins/pm/pm.php +++ b/e107_plugins/pm/pm.php @@ -176,10 +176,10 @@ class pm_extended extends private_message { return str_replace('{PERCENT}', $pm_outbox['outbox']['filled'], LAN_PM_13); } -// $tpl_file = THEME.'pm_template.php'; + // $tpl_file = THEME.'pm_template.php'; // include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); - - $PM_SEND_PM = e107::getTemplate('pm', 'pm', 'send'); + if(THEME_LEGACY){include_once(THEME.'pm_template.php');} + if (!$PM_SEND_PM){$PM_SEND_PM = e107::getTemplate('pm', 'pm', 'send');} $enc = (check_class($this->pmPrefs['attach_class']) ? "enctype='multipart/form-data'" : ''); // setScVar('pm_handler_shortcodes','pmInfo', $pm_info); @@ -211,8 +211,23 @@ class pm_extended extends private_message // $tpl_file = THEME.'pm_template.php'; // include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); - - $PM_INBOX = e107::getTemplate('pm', 'pm', 'inbox'); + if(THEME_LEGACY){ + include_once(THEME.'pm_template.php'); + + $PM_INBOX_HEADER = $this->updateTemplate($PM_INBOX_HEADER); + $PM_INBOX_TABLE = $this->updateTemplate($PM_INBOX_TABLE); + $PM_INBOX_EMPTY = $this->updateTemplate($PM_INBOX_EMPTY); + $PM_INBOX_FOOTER = $this->updateTemplate($PM_INBOX_FOOTER); + } + if (!$PM_INBOX_TABLE){ + $PM_INBOX = e107::getTemplate('pm', 'pm', 'inbox'); + + // Is updateTemplate really necessary for v2.x templates? + $PM_INBOX_HEADER = $PM_INBOX['start']; + $PM_INBOX_TABLE = $PM_INBOX['item']; + $PM_INBOX_EMPTY = $PM_INBOX['empty']; + $PM_INBOX_FOOTER = $PM_INBOX['end']; + } $pm_blocks = $this->block_get(); $pmlist = $this->pm_get_inbox(USERID, $start, $this->pmPrefs['perpage']); @@ -224,11 +239,12 @@ class pm_extended extends private_message $sc->wrapper('pm'); // Is updateTemplate really necessary for v2.x templates? +/* $PM_INBOX_HEADER = $this->updateTemplate($PM_INBOX['start']); $PM_INBOX_TABLE = $this->updateTemplate($PM_INBOX['item']); $PM_INBOX_EMPTY = $this->updateTemplate($PM_INBOX['empty']); $PM_INBOX_FOOTER = $this->updateTemplate($PM_INBOX['end']); - +*/ $txt = ""; $txt .= $tp->parseTemplate($PM_INBOX_HEADER, true, $sc); @@ -266,8 +282,23 @@ class pm_extended extends private_message // $tpl_file = THEME.'pm_template.php'; // include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); - - $PM_OUTBOX = e107::getTemplate('pm', 'pm', 'outbox'); + if(THEME_LEGACY){ + include_once(THEME.'pm_template.php'); + + $PM_OUTBOX_HEADER = $this->updateTemplate($PM_OUTBOX_HEADER); + $PM_OUTBOX_TABLE = $this->updateTemplate($PM_OUTBOX_TABLE); + $PM_OUTBOX_EMPTY = $this->updateTemplate($PM_OUTBOX_EMPTY); + $PM_OUTBOX_FOOTER = $this->updateTemplate($PM_OUTBOX_FOOTER); + } + if (!$PM_OUTBOX_TABLE){ + $PM_OUTBOX = e107::getTemplate('pm', 'pm', 'outbox'); + + // Is updateTemplate really necessary for v2.x templates? + $PM_OUTBOX_HEADER = $PM_OUTBOX['start']; + $PM_OUTBOX_TABLE = $PM_OUTBOX['item']; + $PM_OUTBOX_EMPTY = $PM_OUTBOX['empty']; + $PM_OUTBOX_FOOTER = $PM_OUTBOX['end']; + } $pmlist = $this->pm_get_outbox(USERID, $start, $this->pmPrefs['perpage']); // setScVar('pm_handler_shortcodes', 'pmNextPrev', array('start' => $start, 'total' => $pmlist['total_messages'])); @@ -277,12 +308,12 @@ class pm_extended extends private_message $sc->wrapper('pm'); // Is updateTemplate really necessary for v2.x templates? +/* $PM_OUTBOX_HEADER = $this->updateTemplate($PM_OUTBOX['start']); $PM_OUTBOX_TABLE = $this->updateTemplate($PM_OUTBOX['item']); $PM_OUTBOX_EMPTY = $this->updateTemplate($PM_OUTBOX['empty']); $PM_OUTBOX_FOOTER = $this->updateTemplate($PM_OUTBOX['end']); - - +*/ $txt = ""; $txt .= $tp->parseTemplate($PM_OUTBOX_HEADER, true, $sc); if($pmlist['total_messages']) @@ -318,7 +349,8 @@ class pm_extended extends private_message // $tpl_file = THEME.'pm_template.php'; // include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); - $PM_SHOW = e107::getTemplate('pm', 'pm', 'show'); + if(THEME_LEGACY){include_once(THEME.'pm_template.php');} + if (!$PM_SHOW){$PM_SHOW = e107::getTemplate('pm', 'pm', 'show');} $pm_info = $this->pm_get($pmid); @@ -390,7 +422,23 @@ class pm_extended extends private_message $tp = e107::getParser(); // $tpl_file = THEME.'pm_template.php'; // include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); - $PM_BLOCKED = e107::getTemplate('pm', 'pm', 'blocked'); + if(THEME_LEGACY){ + include_once(THEME.'pm_template.php'); + + $PM_BLOCKED_HEADER = $this->updateTemplate($PM_BLOCKED_HEADER); + $PM_BLOCKED_TABLE = $this->updateTemplate($PM_BLOCKED_TABLE); + $PM_BLOCKED_EMPTY = $this->updateTemplate($PM_BLOCKED_EMPTY); + $PM_BLOCKED_FOOTER = $this->updateTemplate($PM_BLOCKED_FOOTER); + } + if (!$PM_BLOCKED_TABLE){ + $PM_BLOCKED = e107::getTemplate('pm', 'pm', 'blocked'); + + // Is updateTemplate really necessary for v2.x templates? + $PM_BLOCKED_HEADER = $PM_BLOCKED['start']; + $PM_BLOCKED_TABLE = $PM_BLOCKED['item']; + $PM_BLOCKED_EMPTY = $PM_BLOCKED['empty']; + $PM_BLOCKED_FOOTER = $PM_BLOCKED['end']; + } $pmBlocks = $this->block_get_user(); // TODO - handle pagination, maybe (is it likely to be necessary?) @@ -399,11 +447,12 @@ class pm_extended extends private_message $sc->wrapper('pm'); // Is updateTemplate really necessary for v2.x templates? +/* $PM_BLOCKED_HEADER = $this->updateTemplate($PM_BLOCKED['start']); $PM_BLOCKED_TABLE = $this->updateTemplate($PM_BLOCKED['item']); $PM_BLOCKED_EMPTY = $this->updateTemplate($PM_BLOCKED['empty']); $PM_BLOCKED_FOOTER = $this->updateTemplate($PM_BLOCKED['end']); - +*/ $txt = ""; $txt .= $tp->parseTemplate($PM_BLOCKED_HEADER, true, $sc); From 88b5c75a3ef301e5cef440a4b8a6261a43f4649f Mon Sep 17 00:00:00 2001 From: rica-carv Date: Tue, 11 Apr 2017 21:50:13 +0100 Subject: [PATCH 17/18] Update pm.php --- e107_plugins/pm/pm.php | 95 ++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 55 deletions(-) diff --git a/e107_plugins/pm/pm.php b/e107_plugins/pm/pm.php index 871d81944..00dda193c 100755 --- a/e107_plugins/pm/pm.php +++ b/e107_plugins/pm/pm.php @@ -178,7 +178,10 @@ class pm_extended extends private_message } // $tpl_file = THEME.'pm_template.php'; // include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); - if(THEME_LEGACY){include_once(THEME.'pm_template.php');} + if(THEME_LEGACY){ + include_once(THEME.'pm_template.php'); + $PM_SEND_PM = $this->updateTemplate($PM_SEND_PM); + } if (!$PM_SEND_PM){$PM_SEND_PM = e107::getTemplate('pm', 'pm', 'send');} $enc = (check_class($this->pmPrefs['attach_class']) ? "enctype='multipart/form-data'" : ''); @@ -188,7 +191,7 @@ class pm_extended extends private_message $sc->setVars($pm_info); $sc->wrapper('pm'); - $PM_SEND_PM = $this->updateTemplate($PM_SEND_PM); +// $PM_SEND_PM = $this->updateTemplate($PM_SEND_PM); $text = "
". @@ -214,20 +217,13 @@ class pm_extended extends private_message if(THEME_LEGACY){ include_once(THEME.'pm_template.php'); - $PM_INBOX_HEADER = $this->updateTemplate($PM_INBOX_HEADER); - $PM_INBOX_TABLE = $this->updateTemplate($PM_INBOX_TABLE); - $PM_INBOX_EMPTY = $this->updateTemplate($PM_INBOX_EMPTY); - $PM_INBOX_FOOTER = $this->updateTemplate($PM_INBOX_FOOTER); - } - if (!$PM_INBOX_TABLE){ - $PM_INBOX = e107::getTemplate('pm', 'pm', 'inbox'); - - // Is updateTemplate really necessary for v2.x templates? - $PM_INBOX_HEADER = $PM_INBOX['start']; - $PM_INBOX_TABLE = $PM_INBOX['item']; - $PM_INBOX_EMPTY = $PM_INBOX['empty']; - $PM_INBOX_FOOTER = $PM_INBOX['end']; + // Is updateTemplate really necessary for v2.x templates? + $PM_INBOX['start'] = $this->updateTemplate($PM_INBOX_HEADER); + $PM_INBOX['item'] = $this->updateTemplate($PM_INBOX_TABLE); + $PM_INBOX['empty'] = $this->updateTemplate($PM_INBOX_EMPTY); + $PM_INBOX['end'] = $this->updateTemplate($PM_INBOX_FOOTER); } + if (!$PM_INBOX){$PM_INBOX = e107::getTemplate('pm', 'pm', 'inbox');} $pm_blocks = $this->block_get(); $pmlist = $this->pm_get_inbox(USERID, $start, $this->pmPrefs['perpage']); @@ -246,7 +242,7 @@ class pm_extended extends private_message $PM_INBOX_FOOTER = $this->updateTemplate($PM_INBOX['end']); */ $txt = ""; - $txt .= $tp->parseTemplate($PM_INBOX_HEADER, true, $sc); + $txt .= $tp->parseTemplate($PM_INBOX['start'], true, $sc); if($pmlist['total_messages']) { @@ -254,15 +250,15 @@ class pm_extended extends private_message { if(trim($rec['pm_subject']) == '') { $rec['pm_subject'] = '['.LAN_PM_61.']'; } $sc->setVars($rec); - $txt .= $tp->parseTemplate($PM_INBOX_TABLE, true, $sc); + $txt .= $tp->parseTemplate($PM_INBOX['item'], true, $sc); } } else { - $txt .= $tp->parseTemplate($PM_INBOX_EMPTY, true, $sc); + $txt .= $tp->parseTemplate($PM_INBOX['empty'], true, $sc); } - $txt .= $tp->parseTemplate($PM_INBOX_FOOTER, true, $sc); + $txt .= $tp->parseTemplate($PM_INBOX['end'], true, $sc); $txt .= ""; @@ -285,20 +281,13 @@ class pm_extended extends private_message if(THEME_LEGACY){ include_once(THEME.'pm_template.php'); - $PM_OUTBOX_HEADER = $this->updateTemplate($PM_OUTBOX_HEADER); - $PM_OUTBOX_TABLE = $this->updateTemplate($PM_OUTBOX_TABLE); - $PM_OUTBOX_EMPTY = $this->updateTemplate($PM_OUTBOX_EMPTY); - $PM_OUTBOX_FOOTER = $this->updateTemplate($PM_OUTBOX_FOOTER); - } - if (!$PM_OUTBOX_TABLE){ - $PM_OUTBOX = e107::getTemplate('pm', 'pm', 'outbox'); - - // Is updateTemplate really necessary for v2.x templates? - $PM_OUTBOX_HEADER = $PM_OUTBOX['start']; - $PM_OUTBOX_TABLE = $PM_OUTBOX['item']; - $PM_OUTBOX_EMPTY = $PM_OUTBOX['empty']; - $PM_OUTBOX_FOOTER = $PM_OUTBOX['end']; + // Is updateTemplate really necessary for v2.x templates? + $PM_OUTBOX['start'] = $this->updateTemplate($PM_OUTBOX_HEADER); + $PM_OUTBOX['item'] = $this->updateTemplate($PM_OUTBOX_TABLE); + $PM_OUTBOX['empty'] = $this->updateTemplate($PM_OUTBOX_EMPTY); + $PM_OUTBOX['end'] = $this->updateTemplate($PM_OUTBOX_FOOTER); } + if (!$PM_OUTBOX){$PM_OUTBOX = e107::getTemplate('pm', 'pm', 'outbox');} $pmlist = $this->pm_get_outbox(USERID, $start, $this->pmPrefs['perpage']); // setScVar('pm_handler_shortcodes', 'pmNextPrev', array('start' => $start, 'total' => $pmlist['total_messages'])); @@ -315,7 +304,7 @@ class pm_extended extends private_message $PM_OUTBOX_FOOTER = $this->updateTemplate($PM_OUTBOX['end']); */ $txt = "
"; - $txt .= $tp->parseTemplate($PM_OUTBOX_HEADER, true, $sc); + $txt .= $tp->parseTemplate($PM_OUTBOX['start'], true, $sc); if($pmlist['total_messages']) { foreach($pmlist['messages'] as $rec) @@ -323,14 +312,14 @@ class pm_extended extends private_message if(trim($rec['pm_subject']) == '') { $rec['pm_subject'] = '['.LAN_PM_61.']'; } // setScVar('pm_handler_shortcodes','pmInfo', $rec); $sc->setVars($rec); - $txt .= $tp->parseTemplate($PM_OUTBOX_TABLE, true, $sc); + $txt .= $tp->parseTemplate($PM_OUTBOX['item'], true, $sc); } } else { - $txt .= $tp->parseTemplate($PM_OUTBOX_EMPTY, true, $sc); + $txt .= $tp->parseTemplate($PM_OUTBOX['empty'], true, $sc); } - $txt .= $tp->parseTemplate($PM_OUTBOX_FOOTER, true, $sc); + $txt .= $tp->parseTemplate($PM_OUTBOX['end'], true, $sc); $txt .= ''; return $txt; } @@ -349,7 +338,10 @@ class pm_extended extends private_message // $tpl_file = THEME.'pm_template.php'; // include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); - if(THEME_LEGACY){include_once(THEME.'pm_template.php');} + if(THEME_LEGACY){ + include_once(THEME.'pm_template.php'); + $PM_SHOW = $this->updateTemplate($PM_SHOW); + } if (!$PM_SHOW){$PM_SHOW = e107::getTemplate('pm', 'pm', 'show');} $pm_info = $this->pm_get($pmid); @@ -374,7 +366,7 @@ class pm_extended extends private_message $sc->pmMode = $comeFrom; - $PM_SHOW = $this->updateTemplate($PM_SHOW); +// $PM_SHOW = $this->updateTemplate($PM_SHOW); $txt = e107::getParser()->parseTemplate($PM_SHOW, true, $sc); @@ -425,20 +417,13 @@ class pm_extended extends private_message if(THEME_LEGACY){ include_once(THEME.'pm_template.php'); - $PM_BLOCKED_HEADER = $this->updateTemplate($PM_BLOCKED_HEADER); - $PM_BLOCKED_TABLE = $this->updateTemplate($PM_BLOCKED_TABLE); - $PM_BLOCKED_EMPTY = $this->updateTemplate($PM_BLOCKED_EMPTY); - $PM_BLOCKED_FOOTER = $this->updateTemplate($PM_BLOCKED_FOOTER); - } - if (!$PM_BLOCKED_TABLE){ - $PM_BLOCKED = e107::getTemplate('pm', 'pm', 'blocked'); - - // Is updateTemplate really necessary for v2.x templates? - $PM_BLOCKED_HEADER = $PM_BLOCKED['start']; - $PM_BLOCKED_TABLE = $PM_BLOCKED['item']; - $PM_BLOCKED_EMPTY = $PM_BLOCKED['empty']; - $PM_BLOCKED_FOOTER = $PM_BLOCKED['end']; + // Is updateTemplate really necessary for v2.x templates? + $PM_BLOCKED['start'] = $this->updateTemplate($PM_BLOCKED_HEADER); + $PM_BLOCKED['item'] = $this->updateTemplate($PM_BLOCKED_TABLE); + $PM_BLOCKED['empty'] = $this->updateTemplate($PM_BLOCKED_EMPTY); + $PM_BLOCKED['end'] = $this->updateTemplate($PM_BLOCKED_FOOTER); } + if (!$PM_BLOCKED){$PM_BLOCKED = e107::getTemplate('pm', 'pm', 'blocked');} $pmBlocks = $this->block_get_user(); // TODO - handle pagination, maybe (is it likely to be necessary?) @@ -455,21 +440,21 @@ class pm_extended extends private_message */ $txt = "
"; - $txt .= $tp->parseTemplate($PM_BLOCKED_HEADER, true, $sc); + $txt .= $tp->parseTemplate($PM_BLOCKED['start'], true, $sc); if($pmTotalBlocked = count($pmBlocks)) { foreach($pmBlocks as $pmBlocked) { $sc->pmBlocked = $pmBlocked; // setScVar('pm_handler_shortcodes','pmBlocked', $pmBlocked); - $txt .= $tp->parseTemplate($PM_BLOCKED_TABLE, true, $sc); + $txt .= $tp->parseTemplate($PM_BLOCKED['item'], true, $sc); } } else { - $txt .= $tp->parseTemplate($PM_BLOCKED_EMPTY, true, $sc); + $txt .= $tp->parseTemplate($PM_BLOCKED['empty'], true, $sc); } - $txt .= $tp->parseTemplate($PM_BLOCKED_FOOTER, true, $sc); + $txt .= $tp->parseTemplate($PM_BLOCKED['end'], true, $sc); $txt .= ''; return $txt; } From c6bc61e1fe0c6aa87c3ddd5c54cda9efb675ab0b Mon Sep 17 00:00:00 2001 From: rica-carv Date: Tue, 11 Apr 2017 21:52:09 +0100 Subject: [PATCH 18/18] Update pm_class.php --- e107_plugins/pm/pm_class.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/e107_plugins/pm/pm_class.php b/e107_plugins/pm/pm_class.php index 126d6158d..914cd0550 100755 --- a/e107_plugins/pm/pm_class.php +++ b/e107_plugins/pm/pm_class.php @@ -386,16 +386,13 @@ class private_message $template = $PM_NOTIFY; */ - if(THEME_LEGACY){ - include_once(THEME.'pm_template.php'); - $template = $PM_NOTIFY; - } - if (!$PM_NOTIFY){$template = e107::getTemplate('pm', 'pm', 'notify');} + if(THEME_LEGACY){include_once(THEME.'pm_template.php');} + if (!$PM_NOTIFY){$PM_NOTIFY = e107::getTemplate('pm', 'pm', 'notify');} - if(empty($template)) // BC Fallback. + if(empty($PM_NOTIFY)) // BC Fallback. { - $template = + $PM_NOTIFY = "

".LAN_PM_101."{SITENAME}

@@ -422,7 +419,7 @@ class private_message $data['PM_URL'] = $url;// e107::url('pm','index', null, array('mode'=>'full')).'?show.'.$pmid; $data['PM_BUTTON'] = "".LAN_PM_113."";// e107::url('pm','index', null, array('mode'=>'full')).'?show.'.$pmid; - $text = e107::getParser()->simpleParse($template, $data); + $text = e107::getParser()->simpleParse($PM_NOTIFY, $data); $eml = array(); $eml['email_subject'] = LAN_PM_100.USERNAME;