+
+
";
- $this->e107->ns->tablerender(LAN_MAILOUT_15, $text); // Render the complete form
+ $ns->tablerender(LAN_MAILOUT_15,$mes->render(). $text); // Render the complete form
}
diff --git a/e107_handlers/mailout_class.php b/e107_handlers/mailout_class.php
index 245a52707..e7c7f5d7e 100644
--- a/e107_handlers/mailout_class.php
+++ b/e107_handlers/mailout_class.php
@@ -9,9 +9,9 @@
* Administration - Site Maintenance
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/mailout_class.php,v $
- * $Revision: 1.6 $
- * $Date: 2009-12-01 20:05:53 $
- * $Author: e107steved $
+ * $Revision: 1.7 $
+ * $Date: 2010-01-10 03:56:28 $
+ * $Author: e107coders $
*
*/
@@ -47,11 +47,11 @@ class core_mailout
{
protected $mailCount = 0;
protected $mailRead = 0;
- protected $e107;
+ // protected $e107;
public $mailerSource = 'core'; // Plugin name (core mailer is special case) Must be directory for this file
public $mailerName = LAN_MAILOUT_68; // Text to identify the source of selector (displayed on left of admin page)
public $mailerEnabled = TRUE; // Mandatory - set to FALSE to disable this plugin (e.g. due to permissions restrictions)
- protected $adminHandler = NULL; // Filled in with the name of the admin handler on creation
+ // protected $adminHandler = NULL; // Filled in with the name of the admin handler on creation
// List of fields used by selectors
private $selectFields = array('email_to',
@@ -64,8 +64,9 @@ class core_mailout
// Constructor
public function __construct()
{
- $this->e107 = e107::getInstance();
- $this->adminHandler = e107::getRegistry('_mailout_admin'); // Get the mailer admin object - we want to use some of its functions
+ //FIXME Bad for Performance and causes data conflicts.
+ // $this->e107 = e107::getInstance();
+ // $this->adminHandler = e107::getRegistry('_mailout_admin'); // Get the mailer admin object - we want to use some of its functions
}
@@ -250,125 +251,58 @@ class core_mailout
*/
public function showSelect($allow_edit = FALSE, $selectVals = FALSE)
{
- $ret = "";
-
- $ret = "';
+ return $var;
+
}
}
diff --git a/e107_languages/English/admin/lan_mailout.php b/e107_languages/English/admin/lan_mailout.php
index 50e089332..7eb001416 100644
--- a/e107_languages/English/admin/lan_mailout.php
+++ b/e107_languages/English/admin/lan_mailout.php
@@ -9,9 +9,9 @@
* Administration - Site Maintenance
*
* $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_mailout.php,v $
- * $Revision: 1.15 $
- * $Date: 2009-12-01 20:05:54 $
- * $Author: e107steved $
+ * $Revision: 1.16 $
+ * $Date: 2010-01-10 03:56:28 $
+ * $Author: e107coders $
*
*/
@@ -85,7 +85,7 @@ define('LAN_MAILOUT_57', 'Send bulk SMTP emails in blocks'); // SMTP KeepAlive
//define('LAN_MAILOUT_65', 'seconds');
//define('LAN_MAILOUT_66', 'Cancelled Successfully');
define('LAN_MAILOUT_67', 'The email could not be sent. Please review your SMTP settings, or select another mailing method and try again.');
-define('LAN_MAILOUT_68','Include from registered users');
+define('LAN_MAILOUT_68','Registered Users');
define('LAN_MAILOUT_69','matches, after ');
define('LAN_MAILOUT_70',' duplicates stripped.');
define('LAN_MAILOUT_71','Total emails to send');
diff --git a/e107_plugins/calendar_menu/e_mailout.php b/e107_plugins/calendar_menu/e_mailout.php
index 42b4128f2..ad5ec09d8 100644
--- a/e107_plugins/calendar_menu/e_mailout.php
+++ b/e107_plugins/calendar_menu/e_mailout.php
@@ -9,9 +9,9 @@
* Administration - Site Maintenance
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/e_mailout.php,v $
- * $Revision: 1.8 $
- * $Date: 2009-12-20 22:47:28 $
- * $Author: e107steved $
+ * $Revision: 1.9 $
+ * $Date: 2010-01-10 03:56:28 $
+ * $Author: e107coders $
*
*/
@@ -20,7 +20,7 @@
*
* @package e107_plugins
* @subpackage event_calendar
- * @version $Id: e_mailout.php,v 1.8 2009-12-20 22:47:28 e107steved Exp $;
+ * @version $Id: e_mailout.php,v 1.9 2010-01-10 03:56:28 e107coders Exp $;
*/
if (!defined('e107_INIT')) { exit(); }
@@ -41,19 +41,15 @@ class calendar_menu_mailout
{
protected $mailCount = 0;
protected $mailRead = 0;
- protected $e107;
- public $mailerSource = 'calendar_menu'; // Plugin name (core mailer is special case) Must be directory for this file
+ public $mailerSource = 'calendar_menu'; //FIXME should be auto-detected // Plugin name (core mailer is special case) Must be directory for this file
public $mailerName = LAN_EC_MAIL_01; // Text to identify the source of selector (displayed on left of admin page)
public $mailerEnabled = TRUE; // Mandatory - set to FALSE to disable this plugin (e.g. due to permissions restrictions)
- protected $adminHandler = NULL; // Filled in with the name of the admin handler on creation
private $selectorActive = FALSE; // Set TRUE if we've got a valid selector to start returning entries
// Constructor
public function __construct()
{
- $this->e107 = e107::getInstance();
- $this->adminHandler = e107::getRegistry('_mailout_admin'); // Get the mailer admin object - we want to use some of its functions
}
@@ -90,6 +86,9 @@ class calendar_menu_mailout
*/
public function selectInit($selectVals = FALSE)
{
+
+ $sql = e107::getDb();
+
if (($selectVals === FALSE) || ($selectVals == ''))
{
return 0; // No valid selector - so no valid records
@@ -100,7 +99,7 @@ class calendar_menu_mailout
$qry .= ' LEFT JOIN `#user` AS u ON es.`event_subid` = u.`user_id` WHERE es.`event_cat` IN (\''.$selectVals.'\') AND u.`user_id` IS NOT NULL';
$qry .= ' GROUP BY u.`user_id`';
// echo "Selector query: ".$qry.' ';
- if (!( $this->mail_count = $this->e107->sql->db_Select_gen($qry))) return FALSE;
+ if (!( $this->mail_count = $sql->db_Select_gen($qry))) return FALSE;
$this->selectorActive = TRUE;
$this->mail_read = 0;
return $this->mail_count;
@@ -120,8 +119,10 @@ class calendar_menu_mailout
*/
public function selectAdd()
{
+ $sql = e107::getDb();
+
if (!$this->selectorActive) return FALSE;
- if (!($row = $this->e107->sql->db_Fetch(MYSQL_ASSOC))) return FALSE;
+ if (!($row = $sql->db_Fetch(MYSQL_ASSOC))) return FALSE;
$ret = array('mail_recipient_id' => $row['user_id'],
'mail_recipient_name' => $row['user_name'], // Should this use realname?
'mail_recipient_email' => $row['user_email'],
@@ -154,35 +155,49 @@ class calendar_menu_mailout
* @param boolean $allow_edit is TRUE to allow user to change the selection; FALSE to just display current settings
* @param string $selectVals is the current selection information - in the same format as returned by returnSelectors()
*
- * @return string Returns HTML which is displayed in a table cell. Typically we return a complete table
+ * @return array Returns array which is displayed in a table cell.
*/
public function showSelect($allow_edit = FALSE, $selectVals = FALSE)
{
- $ret = "";
+ $sql = e107::getDb();
+ $frm = e107::getForm();
+
+ // $ret = "";
$selects = array_flip(explode(',', $selectVals));
- if ($this->e107->sql->db_Select('event_cat', 'event_cat_id, event_cat_name', "event_cat_name != 'Default'"))
+ if ($sql->db_Select('event_cat', 'event_cat_id, event_cat_name', "event_cat_name != 'Default'"))
{
- while ($row = $this->e107->sql->db_Fetch(MYSQL_ASSOC))
+ $c=0;
+ while ($row = $sql->db_Fetch(MYSQL_ASSOC))
{
$checked = (isset($selects[$row['event_cat_id']])) ? " checked='checked'" : '';
if ($allow_edit)
{
- $ret .= " |
- ".$row['event_cat_name']." | ";
+ $var[$c]['caption'] = $row['event_cat_name'];
+ $var[$c]['html'] = $frm->checkbox('ec_category_sel[]',$row['event_cat_id'],$checked);
+
+ /*$ret .= " |
+ ".$row['event_cat_name']." | ";*/
}
elseif($checked)
{
- $ret .= "".LAN_EC_MAIL_03." |
- ".$row['event_cat_name']." | ";
+ $var[$c]['caption'] = $row['event_cat_name'];
+ $var[$c]['html'] = LAN_EC_MAIL_03;
+
+ /*$ret .= "".LAN_EC_MAIL_03." |
+ ".$row['event_cat_name']." | ";*/
}
+ $c++;
}
}
else
{
- $ret .= "".LAN_EC_MAIL_02.' | ';
+ $var[0]['caption'] = LAN_EC_MAIL_02;
+ $var[0]['html'] = '';
}
- return $ret.' ';
+
+ return $var;
+ // return $ret.' ';
}
}
diff --git a/e107_plugins/calendar_menu/languages/English_mailer.php b/e107_plugins/calendar_menu/languages/English_mailer.php
index a729592b4..3c315570a 100644
--- a/e107_plugins/calendar_menu/languages/English_mailer.php
+++ b/e107_plugins/calendar_menu/languages/English_mailer.php
@@ -9,13 +9,13 @@
* Event calendar - language file for mailout related routines
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/languages/English_mailer.php,v $
- * $Revision: 1.4 $
- * $Date: 2009-11-22 10:11:32 $
- * $Author: e107steved $
+ * $Revision: 1.5 $
+ * $Date: 2010-01-10 03:56:28 $
+ * $Author: e107coders $
*
*/
-define('LAN_EC_MAIL_01', 'Event calendar subscribers list');
+define('LAN_EC_MAIL_01', 'Event Calendar Subscribers');
define('LAN_EC_MAIL_02', 'No categories defined, or database error');
define('LAN_EC_MAIL_03', 'Category: ');
define('LAN_EC_MAIL_04', 'Calendar Subscriptions');
diff --git a/e107_plugins/newsletter/e_mailout.php b/e107_plugins/newsletter/e_mailout.php
index 1e1e4bb38..cfb7ce2e9 100644
--- a/e107_plugins/newsletter/e_mailout.php
+++ b/e107_plugins/newsletter/e_mailout.php
@@ -9,9 +9,9 @@
* Administration - Site Maintenance
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/newsletter/e_mailout.php,v $
- * $Revision: 1.2 $
- * $Date: 2009-12-01 20:05:54 $
- * $Author: e107steved $
+ * $Revision: 1.3 $
+ * $Date: 2010-01-10 03:56:28 $
+ * $Author: e107coders $
*
*/
@@ -34,11 +34,9 @@ class newsletter_mailout
{
protected $mailCount = 0;
protected $mailRead = 0;
- protected $e107;
public $mailerSource = 'newsletter'; // Plugin name (core mailer is special case) Must be directory for this file
public $mailerName = NLLAN_48; // Text to identify the source of selector (displayed on left of admin page)
public $mailerEnabled = TRUE; // Mandatory - set to FALSE to disable this plugin (e.g. due to permissions restrictions)
- protected $adminHandler = NULL; // Filled in with the name of the admin handler on creation
private $selectorActive = FALSE; // Set TRUE if we've got a valid selector to start returning entries
private $targets = array(); // Used to store potential recipients
private $ourDB;
@@ -47,8 +45,9 @@ class newsletter_mailout
// Constructor
public function __construct()
{
- $this->e107 = e107::getInstance();
- $this->adminHandler = e107::getRegistry('_mailout_admin'); // Get the mailer admin object - we want to use some of its functions
+ // BAD FOR PERFORMANCE
+ //$this->e107 = e107::getInstance();
+ //$this->adminHandler = e107::getRegistry('_mailout_admin'); // Get the mailer admin object - we want to use some of its functions
}
@@ -85,6 +84,9 @@ class newsletter_mailout
*/
public function selectInit($selectVals = FALSE)
{
+ $sql = e107::getDb();
+
+
if (($selectVals === FALSE) || ($selectVals == ''))
{
return 0; // No valid selector - so no valid records
@@ -92,7 +94,7 @@ class newsletter_mailout
$qry = "SELECT newsletter_id,newsletter_subscribers FROM `#newsletter` WHERE (`newsletter_parent`=0) AND (`newsletter_id` IN ({$selectVals}))";
// echo "Selector {$selectVals} query: ".$qry.' ';
- if (!($this->e107->sql->db_Select_gen($qry))) return FALSE;
+ if (!($sql->db_Select_gen($qry))) return FALSE;
$this->selectorActive = TRUE;
$this->mail_count = 1; // We have no idea of how many subscribers without reading all relevant DB records
$this->mail_read = 0;
@@ -114,13 +116,17 @@ class newsletter_mailout
*/
public function selectAdd()
{
+
+ $sql = e107::getDb();
+
+
if (!$this->selectorActive) return FALSE;
while ($this->selectorActive)
{
if (count($this->targets) == 0)
{ // Read in and process another newletter mailing list
- if (!($row = $this->e107->sql->db_Fetch(MYSQL_ASSOC)))
+ if (!($row = $sql->db_Fetch(MYSQL_ASSOC)))
{
$this->selectorActive = FALSE;
return FALSE; // Run out of DB records
@@ -173,35 +179,42 @@ class newsletter_mailout
* @param boolean $allow_edit is TRUE to allow user to change the selection; FALSE to just display current settings
* @param string $selectVals is the current selection information - in the same format as returned by returnSelectors()
*
- * @return string Returns HTML which is displayed in a table cell. Typically we return a complete table
+ * @return array Returns array which is displayed in a table cell
*/
public function showSelect($allow_edit = FALSE, $selectVals = FALSE)
{
- $ret = "";
+ $sql = e107::getDb();
+ $frm = e107::getForm();
+
$selects = array_flip(explode(',', $selectVals));
- if ($this->e107->sql->db_Select('newsletter', 'newsletter_id, newsletter_title', '`newsletter_parent`=0'))
+ if ($sql->db_Select('newsletter', 'newsletter_id, newsletter_title', '`newsletter_parent`=0'))
{
- while ($row = $this->e107->sql->db_Fetch(MYSQL_ASSOC))
+ $c=0;
+ while ($row = $sql->db_Fetch(MYSQL_ASSOC))
{
$checked = (isset($selects[$row['newsletter_id']])) ? " checked='checked'" : '';
+
if ($allow_edit)
{
- $ret .= " |
- ".$row['newsletter_title']." | ";
+ $var[$c]['caption'] = $row['newsletter_title'];
+ $var[$c]['html'] = $frm->checkbox('nl_category_sel[]',$row['newsletter_id'] ,$checked);
}
elseif($checked)
{
- $ret .= "".NLLAN_49." |
- ".$row['newsletter_title']." | ";
+ $var[$c]['caption'] = $row['newsletter_title'];
+ $var[$c]['html'] = NLLAN_49;
}
+ $c++;
}
}
else
{
- $ret .= "".NLLAN_50.' | ';
+ $var[$c]['caption'] = NLLAN_50;
+ $var[$c]['html'] = '';
}
- return $ret.' ';
+
+ return $var;
}
}
diff --git a/e107_plugins/newsletter/languages/English_admin_newsletter.php b/e107_plugins/newsletter/languages/English_admin_newsletter.php
index 70124a0de..b0799d209 100644
--- a/e107_plugins/newsletter/languages/English_admin_newsletter.php
+++ b/e107_plugins/newsletter/languages/English_admin_newsletter.php
@@ -9,9 +9,9 @@
* Plugin - newsfeeds
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/newsletter/languages/English_admin_newsletter.php,v $
- * $Revision: 1.1 $
- * $Date: 2009-11-19 20:24:21 $
- * $Author: e107steved $
+ * $Revision: 1.2 $
+ * $Date: 2010-01-10 03:56:28 $
+ * $Author: e107coders $
*
*/
@@ -65,7 +65,7 @@ define('NLLAN_44', 'Newsletter Front Page');
define('NLLAN_45', 'Create Newsletter');
define('NLLAN_46', 'Create mailing');
define('NLLAN_47', 'Newsletter Options');
-define('NLLAN_48', 'Subscribers to each newsletter');
+define('NLLAN_48', 'Newsletter Subscribers');
define('NLLAN_49', 'Newsletter: ');
define('NLLAN_54', 'Sending');
|