Exemplo n.º 1
0
 function setUp()
 {
     parent::setUp();
     require_code('ocf_general_action');
     require_code('ocf_general_action2');
     $this->email_id = ocf_make_welcome_email('test_mail', "test subject", "test content", 1262671781, 0);
     // Test the forum was actually created
     $this->assertTrue('test_mail' == $GLOBALS['SITE_DB']->query_value('f_welcome_emails', 'w_name ', array('id' => $this->email_id)));
 }
Exemplo n.º 2
0
 /**
  * Standard import function.
  *
  * @param  object			The DB connection to import from
  * @param  string			The table prefix the target prefix is using
  * @param  PATH			The base directory we are importing from
  */
 function import_ocf_welcome_emails($db, $table_prefix, $file_base)
 {
     if ($this->on_same_msn($file_base)) {
         return;
     }
     $rows = $db->query('SELECT * FROM ' . $table_prefix . 'f_welcome_emails', NULL, NULL, true);
     if (is_null($rows)) {
         return;
     }
     foreach ($rows as $row) {
         if (import_check_if_imported('welcome_email', $row['w_name'])) {
             continue;
         }
         ocf_make_welcome_email($row['w_name'], $this->get_lang_string($db, $row['w_subject']), $this->get_lang_string($db, $row['w_text']), $row['w_send_time']);
         import_id_remap_put('welcome_email', $row['w_name'], 0);
     }
 }
 /**
  * Standard aed_module add actualiser.
  *
  * @return ID_TEXT		The entry added
  */
 function add_actualisation()
 {
     $name = post_param('name');
     $subject = post_param('subject');
     $text = post_param('text');
     $send_time = post_param_integer('send_time');
     if (get_value('welcome_nw_choice') === '1') {
         $newsletter = post_param_integer('newsletter', NULL);
     } else {
         $newsletter = post_param_integer('newsletter', 0);
     }
     $id = ocf_make_welcome_email($name, $subject, $text, $send_time, $newsletter);
     return strval($id);
 }