Ignore:
Timestamp:
12/21/13 18:37:54 (5 years ago)
Author:
mistic100
Message:

try to simplify integration of captchas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/EasyCaptcha/include/contactform.inc.php

    r26068 r26069  
    22defined('EASYCAPTCHA_ID') or die('Hacking attempt!'); 
    33 
     4$conf['EasyCaptcha']['template'] = 'contactform'; 
    45include(EASYCAPTCHA_PATH.'include/common.inc.php'); 
    5 add_event_handler('loc_begin_index', 'add_easycaptcha'); 
     6 
    67add_event_handler('contact_form_check', 'check_easycaptcha', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 
    7  
    8 function add_easycaptcha() 
    9 { 
    10   global $template; 
    11   $template->set_prefilter('contactform', 'prefilter_easycaptcha'); 
    12 } 
    13  
    14 function prefilter_easycaptcha($content, $smarty) 
    15 { 
    16   $search = '{$contact.content}</textarea></td>'; 
    17   return str_replace($search, $search."\n{\$EASYCAPTCHA_CONTENT}", $content); 
    18 } 
    198 
    209function check_easycaptcha($action, $comment) 
Note: See TracChangeset for help on using the changeset viewer.