Ignore:
Timestamp:
09/16/12 17:20:39 (7 years ago)
Author:
mistic100
Message:
  • stores emails in database (/!\ update only from published version, not from trunk)
  • allow emails to be categorized
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/ContactForm/include/contact_form.inc.php

    r17483 r17945  
    1515{ 
    1616  $contact = array( 
    17     'author' => trim($_POST['author']), 
    18     'email' => trim($_POST['email']), 
    19     'subject' =>   trim($_POST['subject']), 
    20     'content' =>   $_POST['content'], 
     17    'author' =>  trim($_POST['author']), 
     18    'email' =>   trim($_POST['email']), 
     19    'group' =>   @$_POST['group'], 
     20    'subject' => trim($_POST['subject']), 
     21    'content' => $_POST['content'], 
    2122   ); 
    2223   
     
    4748      'author' => $user['username'], 
    4849      'email' => $user['email'], 
     50      'group' => null, 
    4951      'subject' => l10n($conf['ContactForm']['cf_default_subject']), 
    5052      'content' => null, 
     
    6769} 
    6870 
     71$query = ' 
     72SELECT DISTINCT group_name 
     73  FROM '. CONTACT_FORM_TABLE .' 
     74  ORDER BY group_name 
     75;'; 
     76$result = pwg_query($query); 
     77 
     78$groups = array(); 
     79while ($data = pwg_db_fetch_assoc($result)) 
     80{ 
     81  $groups[ $data['group_name'] ] = !empty($data['group_name']) ? l10n($data['group_name']) : l10n('Default'); 
     82} 
     83 
     84if (count($groups) > 1) 
     85{ 
     86  $template->assign('GROUPS', $groups); 
     87} 
     88 
    6989$template->assign(array( 
    7090  'contact' => $contact, 
     
    7797  )); 
    7898 
    79 $template->set_filename('index', dirname(__FILE__).'/../template/contact_form.tpl'); 
     99$template->set_filename('index', realpath(CONTACT_FORM_PATH . 'template/contact_form.tpl')); 
    80100 
    81101?> 
Note: See TracChangeset for help on using the changeset viewer.