Ignore:
Timestamp:
Dec 14, 2012, 3:35:07 PM (11 years ago)
Author:
mistic100
Message:

change reload icon with color choice (dark or light), separate HTML and PHP

File:
1 edited

Legend:

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

    r17484 r19428  
    22if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    33
    4 load_language('plugin.lang', CRYPTO_PATH);
     4include(CRYPTO_PATH.'include/common.inc.php');
    55add_event_handler('loc_begin_index', 'add_crypto');
    66add_event_handler('contact_form_check', 'check_crypto', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
     
    99{
    1010  global $template;
    11 
    12   if (!is_a_guest()) return;
    13 
    1411  $template->set_prefilter('index', 'prefilter_crypto');
    1512}
     
    1714function prefilter_crypto($content, $smarty)
    1815{
    19   global $conf;
    20  
    2116  $search = '{$contact.content}</textarea></td>';
    22   $replace = $search.'
    23       </tr>     
    24       <tr>
    25         <td class="title">
    26           {\''.($conf['cryptographp']['captcha_type']=='string'?'Enter code':'Solve equation').'\'|@translate}
    27         </td>
    28         <td>
    29           <input type="text" name="captcha_code" id="captcha_code" size="'.($conf['cryptographp']['code_length']+1).'" maxlength="'.$conf['cryptographp']['code_length'].'" />
    30           <img id="captcha" src="{$ROOT_URL}'.CRYPTO_PATH.'securimage/securimage_show.php" alt="CAPTCHA Image" style="vertical-align:top;">
    31           <a href="#" id="captcha_refresh" onclick="document.getElementById(\'captcha\').src = \'{$ROOT_URL}'.CRYPTO_PATH.'securimage/securimage_show.php?\' + Math.random(); return false">
    32             <img src="{$ROOT_URL}'.CRYPTO_PATH.'template/refresh.png" style="vertical-align:bottom;"></a>
    33         </td>
    34        
    35 {footer_script}
    36 var captcha_code = new LiveValidation("captcha_code", {ldelim} onlyOnSubmit: true, insertAfterWhatNode: "captcha_refresh" });
    37 captcha_code.add(Validate.Presence, {ldelim} failureMessage: "{\'Invalid Captcha\'|@translate}" });
    38 {/footer_script}';
    39  
    40   return str_replace($search, $replace, $content);
     17  return str_replace($search, $search."\n{\$CRYPTOGRAPHP}", $content);
    4118}
    4219
Note: See TracChangeset for help on using the changeset viewer.