コード例 #1
0
ファイル: func.php プロジェクト: ambient-lounge/site
function fn_em_exim_sync($primary_object_ids, $import_data, $auth)
{
    foreach ($import_data as $data) {
        $data = array_pop($data);
        // remove index with language code
        if (empty($data['timestamp'])) {
            $data['timestamp'] = fn_timestamp_to_date(time());
        }
        EmailSync::instance()->batchAdd(array('email' => $data['email'], 'name' => $data['name'], 'timestamp' => fn_date_to_timestamp($data['timestamp']), 'lang_code' => !empty($data['lang_code']) ? $data['lang_code'] : CART_LANGUAGE, 'ip_address' => !empty($data['ip_address']) ? $data['ip_address'] : ''));
    }
    EmailSync::instance()->batchSubscribe();
}
コード例 #2
0
/**
 * Prepares DB timestamp field to export. Empty timestamp (i.e. 0) will be converted to empty string.
 *
 * @param string $timestamp
 *
 * @return string Exported timestamp value
 */
function fn_exim_get_optional_timestamp($timestamp)
{
    if (empty($timestamp)) {
        return '';
    } else {
        return fn_timestamp_to_date($timestamp);
    }
}