Changeset 24347
- Timestamp:
- Sep 5, 2013, 11:34:16 AM (11 years ago)
- Location:
- extensions/ContactForm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ContactForm/admin/config.php
r23375 r24347 5 5 if (isset($_POST['save_config'])) 6 6 { 7 $was_ready = $conf['ContactForm']['cf_ready'];8 9 7 $conf['ContactForm'] = array( 8 'cf_ready' => $conf['ContactForm']['cf_ready'], 10 9 'cf_must_initialize' => false, 11 10 'cf_menu_link' => isset($_POST['cf_menu_link']), … … 26 25 conf_update_param('ContactForm_after', $conf['ContactForm_after']); 27 26 28 $conf['ContactForm']['cf_ready'] = $was_ready;29 30 27 array_push($page['infos'], l10n('Information data registered in database')); 31 28 } -
extensions/ContactForm/include/functions.inc.php
r23375 r24347 65 65 function contact_form_footer_link($content, &$smarty) 66 66 { 67 global $conf;68 if ( !@$conf['ContactForm']['cf_ready'] ) return $content;69 70 67 $search = '<a href="mailto:{$CONTACT_MAIL}?subject={\'A comment on your site\'|@translate|@escape:url}">'; 71 68 $replace = '<a href="'.CONTACT_FORM_PUBLIC.'">'; … … 87 84 JOIN '.USER_INFOS_TABLE.' AS i 88 85 ON i.user_id = u.'.$conf['user_fields']['id'].' 89 WHERE i.status in(\'webmaster\', \'admin\')86 WHERE i.status IN (\'webmaster\', \'admin\') 90 87 AND '.$conf['user_fields']['email'].' IS NOT NULL 91 88 ORDER BY username -
extensions/ContactForm/include/install.inc.php
r23205 r24347 23 23 { 24 24 $contact_form_default_config = serialize(array( 25 'cf_ready' => false, 25 26 'cf_must_initialize' => true, 26 27 'cf_menu_link' => true, … … 51 52 { 52 53 // new params 53 $new_conf['cf_must_initialize'] = false;54 54 $new_conf['cf_default_subject'] = 'A comment on your site'; 55 55 $new_conf['cf_mail_type'] = 'text/html'; … … 98 98 } 99 99 100 if (!isset($new_conf['cf_ready'])) 101 { 102 $new_conf['cf_ready'] = false; 103 } 104 100 105 // save config 101 106 $conf['ContactForm'] = serialize($new_conf); -
extensions/ContactForm/main.inc.php
r23375 r24347 81 81 $conf['ContactForm']['cf_ready'] = count(get_contact_emails()); 82 82 83 $template->set_prefilter('tail', 'contact_form_footer_link'); 83 if ($conf['ContactForm']['cf_ready'] && (!is_a_guest() || $conf['ContactForm']['cf_allow_guest'])) 84 { 85 $template->assign('CONTACT_MAIL', true); 86 $template->set_prefilter('tail', 'contact_form_footer_link'); 87 } 84 88 } 85 89
Note: See TracChangeset
for help on using the changeset viewer.