Changeset 17945 for extensions/ContactForm/include/install.inc.php
- Timestamp:
- Sep 16, 2012, 5:20:39 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ContactForm/include/install.inc.php
r17658 r17945 4 4 function contact_form_install() 5 5 { 6 global $conf; 6 global $conf, $prefixeTable; 7 8 // email table 9 $query = ' 10 CREATE TABLE IF NOT EXISTS `'. $prefixeTable .'contact_form` ( 11 `id` smallint(5) NOT NULL AUTO_INCREMENT, 12 `name` varchar(128) NOT NULL, 13 `email` varchar(128) NOT NULL, 14 `active` enum("true","false") NOT NULL DEFAULT "true", 15 `group_name` varchar(128) DEFAULT NULL, 16 PRIMARY KEY (`id`), 17 UNIQUE KEY `UNIQUE` (`email`,`group_name`) 18 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;'; 19 pwg_query($query); 7 20 8 21 // configuration … … 19 32 'cf_redirect_delay' => 5, 20 33 'cf_mail_type' => 'text/html', 21 'cf_admin_mails' => array(),22 34 )); 23 35 … … 37 49 if (!isset($new_conf['cf_must_initialize'])) 38 50 { 51 // new params 39 52 $new_conf['cf_must_initialize'] = false; 40 53 $new_conf['cf_default_subject'] = 'A comment on your site'; 41 54 $new_conf['cf_mail_type'] = 'text/html'; 42 unset($new_conf['comment'], $new_conf['cf_redirect_delay'], $new_conf['cf_separator'], $new_conf['cf_separator_length']);43 55 56 // move emails to database 57 $email = array(); 44 58 foreach ($new_conf['cf_admin_mails'] as $email => $data) 45 59 { 46 $new_conf['cf_admin_mails'][] =array(60 array_push($emails, array( 47 61 'email' => $email, 48 62 'name' => $data['NAME'], 49 'active' => $data['ACTIVE'], 50 ); 51 unset($new_conf['cf_admin_mails'][ $email ]); 63 'active' => boolean_to_string($data['ACTIVE']), 64 )); 52 65 } 53 66 67 mass_inserts( 68 $prefixeTable .'contact_form', 69 array('name','email','active'), 70 $emails 71 ); 72 73 // old params 74 unset( 75 $new_conf['comment'], $new_conf['cf_redirect_delay'], 76 $new_conf['cf_separator'], $new_conf['cf_separator_length'], 77 $new_conf['cf_admin_mails'] 78 ); 79 80 // save config 54 81 $conf['ContactForm'] = serialize($new_conf); 55 82 $conf['ContactForm_before'] = stripslashes($conf['persoformtop']);
Note: See TracChangeset
for help on using the changeset viewer.