1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-18 04:12:00 +02:00

More Admin->Mailout fixes and form inline fix for apostrophes.

This commit is contained in:
Cameron
2014-10-14 02:12:13 -07:00
parent f644b7b8a3
commit ca3be14770
3 changed files with 48 additions and 14 deletions

View File

@@ -113,11 +113,10 @@ class core_mailout
$where = array();
$incExtended = array();
if ($selectVals === FALSE)
{
$selectVals = array('email_to' => 'all');
}
switch (varset($selectVals['email_to'], 'all'))
$emailTo = vartrue($selectVals['email_to'], false);
switch ($emailTo)
{
// Build the query for the user database
case 'all' :
@@ -137,7 +136,7 @@ class core_mailout
{
$where[] = "u.`user_class` REGEXP concat('(^|,)',{$selectVals['email_to']},'(,|$)')";
}
$where[] = "u.`user_ban`=0";
}
if (vartrue($selectVals['extended_1_name']) && vartrue($selectVals['extended_1_value']))
@@ -183,8 +182,19 @@ class core_mailout
}
}
}
if(empty($where) && empty($incExtended))
{
$this->mail_read = 0;
$this->mail_count = 0;
return $this->mail_count;
}
$where[] = "u.`user_email` != ''"; // Ignore all records with empty email address
// Now assemble the query from the pieces
// Determine which fields we actually need (u.user_sess is the signup link)
$qry = 'SELECT u.user_id, u.user_name, u.user_email, u.user_loginname, u.user_sess, u.user_lastvisit';
@@ -203,6 +213,9 @@ class core_mailout
$qry .= ' WHERE '.implode(' AND ',$where).' ORDER BY u.user_name';
// echo "Selector query: ".$qry.'<br />';
e107::getMessage()->addDebug("Selector query: ".$qry);
if (!( $this->mail_count = $sql->db_Select_gen($qry))) return FALSE;
$this->mail_read = 0;
return $this->mail_count;