Ignore:
Timestamp:
Oct 30, 2012, 12:17:34 AM (11 years ago)
Author:
mistic100
Message:

remove minimum characters limit, don't display user ip by default

Location:
extensions/ContactForm
Files:
2 edited

Legend:

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

    r18331 r18814  
    1212  {
    1313    $page['section'] = 'contact';
    14     $page['title'] = '<a href="'.get_absolute_root_url().'">'.l10n('Home').'</a>'.$conf['level_separator'].'<a href="'.CONTACT_FORM_PUBLIC.'">'.l10n('Contact').'</a>';
     14    $page['title'] = $page['section_title'] = '<a href="'.get_absolute_root_url().'">'.l10n('Home').'</a>'.$conf['level_separator'].'<a href="'.CONTACT_FORM_PUBLIC.'">'.l10n('Contact').'</a>';
    1515  }
    1616}
     
    160160    $comment_action='reject';
    161161  }
    162   else if (strlen($comm['subject']) < 4)
    163   {
    164     array_push($page['errors'], sprintf(l10n('%s must not be less than %d characters long'), l10n('Subject'), 4));
    165     $comment_action='reject';
    166   }
    167162  else if (strlen($comm['subject']) > 100)
    168163  {
     
    183178  {
    184179    array_push($page['errors'], l10n('Please enter a message'));
    185     $comment_action='reject';
    186   }
    187   else if (strlen($comm['content']) < 20)
    188   {
    189     array_push($page['errors'], sprintf(l10n('%s must not be less than %d characters long'), l10n('Message'), 20));
    190180    $comment_action='reject';
    191181  }
     
    260250    }
    261251   
    262     $comm['show_ip'] = isset($conf['contact_form_show_ip']) ? $conf['contact_form_show_ip'] : true;
     252    $comm['show_ip'] = isset($conf['contact_form_show_ip']) ? $conf['contact_form_show_ip'] : false;
    263253   
    264254    $template->assign(array(
  • extensions/ContactForm/template/contact_form.tpl

    r17945 r18814  
    2121var subject = new LiveValidation('subject', {ldelim} onlyOnSubmit: true });
    2222subject.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a subject'|@translate}" });
    23 subject.add(Validate.Length, {ldelim} minimum: 4, maximum: 100,
    24   tooShortMessage: "{'%s must not be less than %d characters long'|@translate|@sprintf:'':4}",
     23subject.add(Validate.Length, {ldelim} maximum: 100,
    2524  tooLongMessage: "{'%s must not be more than %d characters long'|@translate|@sprintf:'':100}"
    2625  });
     
    2827var content = new LiveValidation('cf_content', {ldelim} onlyOnSubmit: true });
    2928content.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a message'|@translate}" });
    30 content.add(Validate.Length, {ldelim} minimum: 20, maximum: 2000,
    31   tooShortMessage: "{'%s must not be less than %d characters long'|@translate|@sprintf:'':20}",
     29content.add(Validate.Length, {ldelim} maximum: 2000,
    3230  tooLongMessage: "{'%s must not be more %d characters long'|@translate|@sprintf:'':2000}",
    3331  });
Note: See TracChangeset for help on using the changeset viewer.