comparison notify/ad_notify.module @ 2:e5584a19768b ad

maj module ad
author sly
date Wed, 15 Apr 2009 07:58:32 +0000
parents 948362c2a207
children
comparison
equal deleted inserted replaced
1:948362c2a207 2:e5584a19768b
1 <?php 1 <?php
2 // $Id: ad_notify.module,v 1.1.2.2.2.13.2.6.2.6 2009/03/29 20:17:21 jeremy Exp $ 2 // $Id: ad_notify.module,v 1.1.2.2.2.13.2.6.2.7 2009/04/02 14:11:50 jeremy Exp $
3 3
4 /** 4 /**
5 * @file 5 * @file
6 * Automatically generate email notifications. 6 * Automatically generate email notifications.
7 * 7 *
549 $mail = module_invoke_all('adnotifyapi', 'mail_text', $form_state['values']['event']); 549 $mail = module_invoke_all('adnotifyapi', 'mail_text', $form_state['values']['event']);
550 if ($mail == array()) { 550 if ($mail == array()) {
551 // Default message text. 551 // Default message text.
552 $mail = array( 552 $mail = array(
553 'subject' => t('[%site-name ad] %event notification'), 553 'subject' => t('[%site-name ad] %event notification'),
554 'body' => t("Hello %owner_name,\n\n This is an automatically generated notification about your advertisement \"%title\" that is being displayed on the %site-name website.\n\n Your advertisement has been viewed %today_views times and clicked %today_clicks times today. It was viewed %yesterday_views times and clicked %yesterday_clicks times yesterday. It has been viewed %global_views times and clicked %global_clicks times since it was activated on %activated_large.\n\n You will receive this %frequency You can view additional statistics about this advertisement or update this notification at the following url:\n %url\n\nRegards,\n The %site-name Team\n\n-\n%site-url"), 554 'body' => t("Hello %owner_name,\n\n This is an automatically generated notification about your advertisement \"%title\" that is being displayed on the %site-name website.\n\n Your advertisement has been viewed %today_impressions times and clicked %today_clicks times today. It was viewed %yesterday_impressions times and clicked %yesterday_clicks times yesterday. It has been viewed %global_impressions times and clicked %global_clicks times since it was activated on %activated_large.\n\n You will receive this %frequency You can view additional statistics about this advertisement or update this notification at the following url:\n %url\n\nRegards,\n The %site-name Team\n\n-\n%site-url"),
555 ); 555 );
556 } 556 }
557 db_query("INSERT INTO {ad_notify} (aid, oid, event, delay, expire, locked, status, address, subject, body, roles) VALUES(%d, %d, '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s')", $form_state['values']['aid'], $form_state['values']['oid'], $form_state['values']['event'], $form_state['values']['delay'], $form_state['values']['expire'], $form_state['values']['locked'], AD_NOTIFY_ENABLED, isset($form_state['values']['address']) ? $form_state['values']['address'] : '', $mail['subject'], $mail['body'], isset($form_state['values']['roles']) ? serialize($form_state['values']['roles']) : ''); 557 db_query("INSERT INTO {ad_notify} (aid, oid, event, delay, expire, locked, status, address, subject, body, roles) VALUES(%d, %d, '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s')", $form_state['values']['aid'], $form_state['values']['oid'], $form_state['values']['event'], $form_state['values']['delay'], $form_state['values']['expire'], $form_state['values']['locked'], AD_NOTIFY_ENABLED, isset($form_state['values']['address']) ? $form_state['values']['address'] : '', $mail['subject'], $mail['body'], isset($form_state['values']['roles']) ? serialize($form_state['values']['roles']) : '');
558 558
559 // Clone new template notification for all ad owners. 559 // Clone new template notification for all ad owners.