当前位置: 首页>>代码示例>>PHP>>正文


PHP acymailing_replaceDate函数代码示例

本文整理汇总了PHP中acymailing_replaceDate函数的典型用法代码示例。如果您正苦于以下问题:PHP acymailing_replaceDate函数的具体用法?PHP acymailing_replaceDate怎么用?PHP acymailing_replaceDate使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了acymailing_replaceDate函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: convertQuery

 function convertQuery($as, $column, $operator, $value, $type = '')
 {
     $operator = str_replace(array('&lt;', '&gt;'), array('<', '>'), $operator);
     if ($operator == 'CONTAINS') {
         $operator = 'LIKE';
         $value = '%' . $value . '%';
     } elseif ($operator == 'BEGINS') {
         $operator = 'LIKE';
         $value = $value . '%';
     } elseif ($operator == 'END') {
         $operator = 'LIKE';
         $value = '%' . $value;
     } elseif ($operator == 'NOTCONTAINS') {
         $operator = 'NOT LIKE';
         $value = '%' . $value . '%';
     } elseif (!in_array($operator, array('REGEXP', 'NOT REGEXP', '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);
     }
     $replace = array('{year}', '{month}', '{weekday}', '{day}');
     $replaceBy = array(date('Y'), date('m'), date('N'), date('d'));
     $value = str_replace($replace, $replaceBy, $value);
     if (!is_numeric($value) or in_array($operator, array('REGEXP', 'NOT REGEXP', 'NOT LIKE', 'LIKE', '=', '!='))) {
         $value = $this->db->Quote($value);
     }
     if (in_array($operator, array('IS NULL', 'IS NOT NULL'))) {
         $value = '';
     }
     if ($type == 'datetime' && in_array($operator, array('=', '!='))) {
         return 'DATE_FORMAT(' . $as . '.`' . acymailing_secureField($column) . '`, "%Y-%m-%d") ' . $operator . ' ' . 'DATE_FORMAT(' . $value . ', "%Y-%m-%d")';
     }
     if ($type == 'timestamp' && in_array($operator, array('=', '!='))) {
         return 'FROM_UNIXTIME(' . $as . '.`' . acymailing_secureField($column) . '`, "%Y-%m-%d") ' . $operator . ' ' . 'FROM_UNIXTIME(' . $value . ', "%Y-%m-%d")';
     }
     return $as . '.`' . acymailing_secureField($column) . '` ' . $operator . ' ' . $value;
 }
开发者ID:ForAEdesWeb,项目名称:AEW1,代码行数:39,代码来源:filter.php

示例2: onAcyProcessAction_addqueue

 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'], '2'));
     $db = JFactory::getDBO();
     $db->setQuery($query);
     $db->query();
     return JText::sprintf('ADDED_QUEUE', $db->getAffectedRows());
 }
开发者ID:unrealprojects,项目名称:journal,代码行数:19,代码来源:managetext.php

示例3: onAcyProcessFilter_list

 function onAcyProcessFilter_list(&$query, $filter, $num)
 {
     $otherconditions = '';
     $field = empty($filter['dates']) ? 'subdate' : 'unsubdate';
     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 . '.' . $field . ' > ' . $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 . '.' . $field . ' < ' . $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']);
     }
 }
开发者ID:ForAEdesWeb,项目名称:AEW1,代码行数:29,代码来源:tagsubscription.php

示例4: acymailing_generateautonews


//.........这里部分代码省略.........
                 $where[] = implode(' OR ', $selectedArea);
             } else {
                 $filter_cat = '`catid` IN (' . implode(',', $selectedArea) . ')';
                 if (file_exists(JPATH_SITE . DS . 'components' . DS . 'com_multicats')) {
                     $filter_cat = '`catid` REGEXP "^([0-9]+,)*' . implode('(,[0-9]+)*$" OR `catid` REGEXP "^([0-9]+,)*', $selectedArea) . '(,[0-9]+)*$"';
                 }
                 $where[] = $filter_cat;
             }
         }
         if (!empty($parameter->excludedcats)) {
             $excludedCats = explode('-', $parameter->excludedcats);
             JArrayHelper::toInteger($excludedCats);
             $filter_cat = '`catid` NOT IN ("' . implode('","', $excludedCats) . '")';
             if (file_exists(JPATH_SITE . DS . 'components' . DS . 'com_multicats')) {
                 $filter_cat = '`catid` NOT REGEXP "^([0-9]+,)*' . implode('(,[0-9]+)*$" AND `catid` NOT REGEXP "^([0-9]+,)*', $excludedCats) . '(,[0-9]+)*$"';
             }
             $where[] = $filter_cat;
         }
         if (!empty($parameter->filter) && !empty($email->params['lastgenerateddate'])) {
             $condition = '(`publish_up` > \'' . date('Y-m-d H:i:s', $email->params['lastgenerateddate'] - date('Z')) . '\' AND `publish_up` < \'' . date('Y-m-d H:i:s', $time - date('Z')) . '\')';
             $condition .= ' OR (`created` > \'' . date('Y-m-d H:i:s', $email->params['lastgenerateddate'] - date('Z')) . '\' AND `created` < \'' . date('Y-m-d H:i:s', $time - date('Z')) . '\')';
             if ($parameter->filter == 'modify') {
                 $modify = '(`modified` > \'' . date('Y-m-d H:i:s', $email->params['lastgenerateddate'] - date('Z')) . '\' AND `modified` < \'' . date('Y-m-d H:i:s', $time - date('Z')) . '\')';
                 if (!empty($parameter->maxpublished)) {
                     $modify = '(' . $modify . ' AND `publish_up` > \'' . date('Y-m-d H:i:s', time() - date('Z') - (int) $parameter->maxpublished * 60 * 60 * 24) . '\')';
                 }
                 $condition .= ' OR ' . $modify;
             }
             $where[] = $condition;
         }
         if (!empty($parameter->maxcreated)) {
             $date = $parameter->maxcreated;
             if (strpos($parameter->maxcreated, '[time]') !== false) {
                 $date = acymailing_replaceDate(str_replace('[time]', '{time}', $parameter->maxcreated));
             }
             if (!is_numeric($date)) {
                 $date = strtotime($parameter->maxcreated);
             }
             if (empty($date)) {
                 acymailing_display('Wrong date format (' . $parameter->maxcreated . ' in ' . $oneTag . '), please use YYYY-MM-DD', 'warning');
             }
             $where[] = '`created` < ' . $this->db->Quote(date('Y-m-d H:i:s', $date)) . ' OR `publish_up` < ' . $this->db->Quote(date('Y-m-d H:i:s', $date));
         } else {
             $where[] = '`publish_up` < \'' . date('Y-m-d H:i:s', $time - date('Z')) . '\'';
         }
         if (!empty($parameter->mincreated)) {
             $date = $parameter->mincreated;
             if (strpos($parameter->mincreated, '[time]') !== false) {
                 $date = acymailing_replaceDate(str_replace('[time]', '{time}', $parameter->mincreated));
             }
             if (!is_numeric($date)) {
                 $date = strtotime($parameter->mincreated);
             }
             if (empty($date)) {
                 acymailing_display('Wrong date format (' . $parameter->mincreated . ' in ' . $oneTag . '), please use YYYY-MM-DD', 'warning');
             }
             $where[] = '`created` > ' . $this->db->Quote(date('Y-m-d H:i:s', $date)) . ' OR `publish_up` > ' . $this->db->Quote(date('Y-m-d H:i:s', $date));
         }
         if (!empty($parameter->meta)) {
             $allMetaTags = explode(',', $parameter->meta);
             $metaWhere = array();
             foreach ($allMetaTags as $oneMeta) {
                 if (empty($oneMeta)) {
                     continue;
                 }
                 $metaWhere[] = "`metakey` LIKE '%" . acymailing_getEscaped($oneMeta, true) . "%'";
开发者ID:proyectoseb,项目名称:ShoppyStore,代码行数:67,代码来源:tagcontent.php

示例5: replaceDate

 static function replaceDate($mydate)
 {
     return acymailing_replaceDate($mydate);
 }
开发者ID:ForAEdesWeb,项目名称:AEW1,代码行数:4,代码来源:helper.php

示例6: onAcyProcessFilter_acymailingfield

 function onAcyProcessFilter_acymailingfield(&$query, $filter, $num)
 {
     if (empty($filter['map'])) {
         return;
     }
     $type = '';
     $value = acymailing_replaceDate($filter['value']);
     if (strpos($filter['value'], '{time}') !== false && !in_array($filter['map'], array('created', 'confirmed_date', 'lastclick_date', 'lastopen_date', 'lastsent_date'))) {
         $value = strftime('%Y-%m-%d', $value);
     }
     if (in_array($filter['map'], array('created', 'confirmed_date', 'lastclick_date', 'lastopen_date', 'lastsent_date'))) {
         if (!is_numeric($value)) {
             $value = strtotime($value);
         }
         $type = 'timestamp';
     }
     $query->where[] = $query->convertQuery('sub', $filter['map'], $filter['operator'], $value, $type);
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:18,代码来源:tagsubscriber.php

示例7: onAcyProcessFilter_joomlafield

 function onAcyProcessFilter_joomlafield(&$query, $filter, $num)
 {
     if (strpos($filter['map'], 'customfield_') !== false) {
         $query->leftjoin['joomlauserprofiles' . $num] = '#__user_profiles AS joomlauserprofiles' . $num . ' ON joomlauserprofiles' . $num . '.user_id = sub.userid AND joomlauserprofiles' . $num . '.profile_key = ' . $query->db->Quote(str_replace('customfield_', '', $filter['map']));
         $val = trim($filter['value'], '"');
         if (in_array($filter['operator'], array('=', '!=', '<', '>', '<=', '>=', 'BEGINS', 'LIKE', 'NOT LIKE'))) {
             $val = '"' . $val;
         }
         if (in_array($filter['operator'], array('=', '!=', '<', '>', '<=', '>=', 'END', 'LIKE', 'NOT LIKE'))) {
             $val = $val . '"';
         }
         $query->where[] = $query->convertQuery('joomlauserprofiles' . $num, 'profile_value', $filter['operator'], $val);
     } else {
         $query->leftjoin['joomlauser'] = '#__users AS joomlauser ON joomlauser.id = sub.userid';
         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']);
     }
 }
开发者ID:juanferden,项目名称:adoperp,代码行数:24,代码来源:taguser.php

示例8: onAcyProcessFilter_acymailingfield

 function onAcyProcessFilter_acymailingfield(&$query, $filter, $num)
 {
     $value = acymailing_replaceDate($filter['value']);
     if (strpos($filter['value'], '{time}') !== false && $filter['map'] != 'created') {
         $value = strftime('%Y-%m-%d', $value);
     }
     if (!is_numeric($value) && $filter['map'] == 'created') {
         $value = strtotime($value);
     }
     $query->where[] = $query->convertQuery('sub', $filter['map'], $filter['operator'], $value);
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:11,代码来源:tagsubscriber.php

示例9: onAcyProcessFilter_joomlafield

 function onAcyProcessFilter_joomlafield(&$query, $filter, $num)
 {
     $query->leftjoin['joomlauser'] = '#__users AS joomlauser ON joomlauser.id = sub.userid';
     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']);
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:12,代码来源:taguser.php

示例10: onAcyProcessFilter_hikaorder

 function onAcyProcessFilter_hikaorder(&$query, $filter, $num)
 {
     if (!$this->loadAcymailing()) {
         return;
     }
     $config =& hikashop_config();
     $statuses = explode(',', $config->get('invoice_order_statuses', 'confirmed,shipped'));
     $condition = array();
     foreach ($statuses as $status) {
         $condition[] = $query->db->Quote($status);
     }
     $myquery = "SELECT DISTINCT b.user_email\r\n\t\t\t\t\tFROM #__hikashop_order_product AS a\r\n\t\t\t\t\tLEFT JOIN #__hikashop_order AS c ON a.order_id = c.order_id\r\n\t\t\t\t\tLEFT JOIN #__hikashop_user AS b on c.order_user_id = b.user_id\r\n\t\t\t\t\tWHERE c.order_status IN (" . implode(',', $condition) . ")";
     if (!empty($filter['product']) and is_numeric($filter['product'])) {
         $myquery .= " AND a.product_id = " . (int) $filter['product'];
     } elseif (!empty($filter['cat']) and is_numeric($filter['cat'])) {
         $myquery .= " AND a.product_id IN (SELECT product_id FROM #__hikashop_product_category WHERE category_id = " . $filter['cat'] . ")";
     }
     $datesVar = array('creationdatesup', 'creationdateinf');
     foreach ($datesVar as $oneDate) {
         if (empty($filter[$oneDate])) {
             continue;
         }
         $filter[$oneDate] = acymailing_replaceDate($filter[$oneDate]);
         if (!is_numeric($filter[$oneDate])) {
             $filter[$oneDate] = strtotime($filter[$oneDate]);
         }
     }
     if (empty($filter['datefield'])) {
         $filter['datefield'] = 'order_created';
     }
     if (!empty($filter['creationdateinf'])) {
         $myquery .= ' AND c.`' . $filter['datefield'] . '` > ' . $filter['creationdateinf'];
     }
     if (!empty($filter['creationdatesup'])) {
         $myquery .= ' AND c.`' . $filter['datefield'] . '` < ' . $filter['creationdatesup'];
     }
     $query->db->setQuery($myquery);
     $allEmails = acymailing_loadResultArray($query->db);
     if (empty($allEmails)) {
         $allEmails[] = 'none';
     }
     if (empty($filter['type'])) {
         $query->where[] = "sub.email NOT IN ('" . implode("','", $allEmails) . "')";
     } else {
         $query->where[] = "sub.email IN ('" . implode("','", $allEmails) . "')";
     }
 }
开发者ID:q0821,项目名称:esportshop,代码行数:47,代码来源:hikashop.php

示例11: convertQuery

 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('REGEXP', 'NOT REGEXP', '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);
     }
     if (!is_numeric($value) or in_array($operator, array('REGEXP', 'NOT REGEXP', 'NOT LIKE', 'LIKE'))) {
         $value = $this->db->Quote($value);
     }
     if (in_array($operator, array('IS NULL', 'IS NOT NULL'))) {
         $value = '';
     }
     return $as . '.`' . acymailing_secureField($column) . '` ' . $operator . ' ' . $value;
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:26,代码来源:filter.php

示例12: onAcyProcessFilterCount_list

 function onAcyProcessFilterCount_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'];
         }
     }
     if ($filter['status'] == -2) {
         $myquery = 'SELECT COUNT(sub.subid) FROM #__acymailing_subscriber as sub LEFT JOIN #__acymailing_listsub AS list' . $num . ' ON sub.subid = list' . $num . '.subid AND list' . $num . '.listid = ' . intval($filter['selectedlist']) . $otherconditions . ' WHERE list' . $num . '.listid IS NULL';
     } else {
         $myquery = 'SELECT COUNT(list' . $num . '.subid) FROM #__acymailing_listsub as list' . $num . ' WHERE list' . $num . '.listid = ' . intval($filter['selectedlist']) . $otherconditions . ' AND list' . $num . '.status = ' . intval($filter['status']);
     }
     $db =& JFactory::getDBO();
     $db->setQuery($myquery);
     $nbSubscribers = $db->loadResult();
     return JText::sprintf('SELECTED_USERS', $nbSubscribers);
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:31,代码来源:tagsubscription.php


注:本文中的acymailing_replaceDate函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。