function onAcyProcessFilter_list(&$query, $filter, $num) { $otherconditions = ''; if (!empty($filter['subdateinf'])) { $filter['subdateinf'] = acymailing::replaceDate($filter['subdateinf']); if (!is_numeric($filter['subdateinf'])) { $filter['subdateinf'] = strtotime($filter['subdateinf']); } if (!empty($filter['subdateinf'])) { $otherconditions .= ' AND list' . $num . '.subdate > ' . $filter['subdateinf']; } } if (!empty($filter['subdatesup'])) { $filter['subdatesup'] = acymailing::replaceDate($filter['subdatesup']); if (!is_numeric($filter['subdatesup'])) { $filter['subdatesup'] = strtotime($filter['subdatesup']); } if (!empty($filter['subdatesup'])) { $otherconditions .= ' AND list' . $num . '.subdate < ' . $filter['subdatesup']; } } $query->leftjoin['list' . $num] = '#__acymailing_listsub AS list' . $num . ' ON sub.subid = list' . $num . '.subid AND list' . $num . '.listid = ' . intval($filter['selectedlist']) . $otherconditions; if ($filter['status'] == -2) { $query->where[] = 'list' . $num . '.listid IS NULL'; } else { $query->where[] = 'list' . $num . '.status = ' . intval($filter['status']); } }
function onAcyProcessAction_addqueue($cquery, $action, $num) { $action['mailid'] = intval($action['mailid']); if (empty($action['mailid'])) { return 'mailid not valid'; } $action['senddate'] = acymailing::replaceDate($action['senddate']); if (!is_numeric($action['senddate'])) { $action['senddate'] = acymailing::getTime($action['senddate']); } if (empty($action['senddate'])) { return 'send date not valid'; } $query = 'INSERT IGNORE INTO `#__acymailing_queue` (`mailid`,`subid`,`senddate`,`priority`) ' . $cquery->getQuery(array($action['mailid'], 'sub.`subid`', $action['senddate'], '3')); $db =& JFactory::getDBO(); $db->setQuery($query); $db->query(); return JText::sprintf('ADDED_QUEUE', $db->getAffectedRows()); }
function convertQuery($as, $column, $operator, $value) { if ($operator == 'CONTAINS') { $operator = 'LIKE'; $value = '%' . $value . '%'; } elseif ($operator == 'BEGINS') { $operator = 'LIKE'; $value = $value . '%'; } elseif ($operator == 'END') { $operator = 'LIKE'; $value = '%' . $value; } elseif (!in_array($operator, array('IS NULL', 'IS NOT NULL', 'NOT LIKE', 'LIKE', '=', '!=', '>', '<', '>=', '<='))) { die('Operator not safe : ' . $operator); } if (strpos($value, '{time}') !== false) { $value = acymailing::replaceDate($value); $value = strftime('%Y-%m-%d %H:%M:%S', $value); } $value = $this->db->Quote($value); if (in_array($operator, array('IS NULL', 'IS NOT NULL'))) { $value = ''; } return $as . '.`' . acymailing::secureField($column) . '` ' . $operator . ' ' . $value; }
function onAcyProcessFilter_acymailingfield(&$query, $filter, $num) { if ($filter['map'] == 'created' and !is_numeric($filter['value'])) { $filter['value'] = acymailing::replaceDate($filter['value']); if (!is_numeric($filter['value'])) { $filter['value'] = strtotime($filter['value']); } } $query->where[] = $query->convertQuery('sub', $filter['map'], $filter['operator'], $filter['value']); }
function onAcyProcessFilter_joomlafield(&$query, $filter, $num) { $query->leftjoin['joomlauser'] = '******'; if (in_array($filter['map'], array('registerDate', 'lastvisitDate'))) { $filter['value'] = acymailing::replaceDate($filter['value']); if (!is_numeric($filter['value'])) { $filter['value'] = strtotime($filter['value']); } $filter['value'] = strftime('%Y-%m-%d %H:%M:%S', $filter['value']); } $query->where[] = $query->convertQuery('joomlauser', $filter['map'], $filter['operator'], $filter['value']); }