Changeset 26072
- Timestamp:
- Dec 21, 2013, 6:39:06 PM (10 years ago)
- Location:
- extensions/CryptograPHP
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/CryptograPHP/admin.php
r26041 r26072 20 20 21 21 $conf['cryptographp'] = array( 22 'activate_on' 22 'activate_on' => array( 23 23 'picture' => in_array('picture', $_POST['activate_on']), 24 24 'category' => in_array('category', $_POST['activate_on']) || !$loaded['category'], -
extensions/CryptograPHP/include/category.inc.php
r26041 r26072 2 2 defined('CRYPTO_ID') or die('Hacking attempt!'); 3 3 4 $conf['cryptographp']['template'] = 'comment'; 4 5 include(CRYPTO_PATH.'include/common.inc.php'); 6 5 7 add_event_handler('loc_begin_index', 'add_crypto'); 6 8 add_event_handler('user_comment_check_albums', 'check_crypto', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); … … 15 17 { 16 18 $search = '{$comment_add.CONTENT}</textarea></p>'; 17 return str_replace($search, $search."\n{\$CRYPTO GRAPHP}", $content);19 return str_replace($search, $search."\n{\$CRYPTO.parsed_content}", $content); 18 20 } 19 21 -
extensions/CryptograPHP/include/common.inc.php
r26041 r26072 15 15 'CRYPTO_PATH' => get_absolute_root_url().CRYPTO_PATH, 16 16 )); 17 17 18 18 $template->set_filename('cryptographp', realpath(CRYPTO_PATH.'template/'.$conf['cryptographp']['template'].'.tpl')); 19 $template->a ssign_var_from_handle('CRYPTOGRAPHP', 'cryptographp');19 $template->append('CRYPTO', array('parsed_content' => $template->parse('cryptographp', true)), true); -
extensions/CryptograPHP/include/contactform.inc.php
r26066 r26072 2 2 defined('CRYPTO_ID') or die('Hacking attempt!'); 3 3 4 $conf['cryptographp']['template'] = 'contactform'; 4 5 include(CRYPTO_PATH.'include/common.inc.php'); 5 add_event_handler('loc_begin_index', 'add_crypto'); 6 6 7 add_event_handler('contact_form_check', 'check_crypto', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 7 8 function add_crypto()9 {10 global $template;11 $template->set_prefilter('contactform', 'prefilter_crypto');12 }13 14 function prefilter_crypto($content, $smarty)15 {16 $search = '{$contact.content}</textarea></td>';17 return str_replace($search, $search."\n{\$CRYPTOGRAPHP}", $content);18 }19 8 20 9 function check_crypto($action, $comment) -
extensions/CryptograPHP/include/guestbook.inc.php
r26066 r26072 2 2 defined('CRYPTO_ID') or die('Hacking attempt!'); 3 3 4 $conf['cryptographp']['template'] = 'guestbook'; 4 5 include(CRYPTO_PATH.'include/common.inc.php'); 5 add_event_handler('loc_begin_index', 'add_crypto'); 6 6 7 add_event_handler('user_comment_check', 'check_crypto', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 7 8 function add_crypto()9 {10 global $template;11 $template->set_prefilter('guestbook', 'prefilter_crypto');12 }13 14 function prefilter_crypto($content, $smarty)15 {16 $search = '{$comment_add.CONTENT}</textarea>';17 return str_replace($search, $search."\n{\$CRYPTOGRAPHP}", $content);18 }19 8 20 9 function check_crypto($action, $comment) -
extensions/CryptograPHP/include/picture.inc.php
r26041 r26072 2 2 defined('CRYPTO_ID') or die('Hacking attempt!'); 3 3 4 $conf['cryptographp']['template'] = 'comment'; 4 5 include(CRYPTO_PATH.'include/common.inc.php'); 6 5 7 add_event_handler('loc_end_picture', 'add_crypto'); 6 8 add_event_handler('user_comment_check', 'check_crypto', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); … … 15 17 { 16 18 $search = '{$comment_add.CONTENT}</textarea></p>'; 17 return str_replace($search, $search."\n{\$CRYPTO GRAPHP}", $content);19 return str_replace($search, $search."\n{\$CRYPTO.parsed_content}", $content); 18 20 } 19 21 -
extensions/CryptograPHP/include/register.inc.php
r26041 r26072 2 2 defined('CRYPTO_ID') or die('Hacking attempt!'); 3 3 4 $conf['cryptographp']['template'] = 'register'; 4 5 include(CRYPTO_PATH.'include/common.inc.php'); 6 5 7 add_event_handler('loc_end_page_header', 'add_crypto'); 6 8 add_event_handler('register_user_check', 'check_crypto'); … … 14 16 function prefilter_crypto($content, $smarty) 15 17 { 16 $search = '#\(\{\'useful when password forgotten\'\| @translate\}\)(\s*)((\{/if\})?)#i';17 $replace = '({\'useful when password forgotten\'| @translate})$1$2'."\n".'{\$CRYPTOGRAPHP}';18 $search = '#\(\{\'useful when password forgotten\'\|(@?)translate\}\)(\s*)((?:\{/if\})?)#i'; 19 $replace = '({\'useful when password forgotten\'|$1translate})$2$3'."\n".'{\$CRYPTO.parsed_content}'; 18 20 return preg_replace($search, $replace, $content); 19 21 } -
extensions/CryptograPHP/main.inc.php
r26067 r26072 38 38 { 39 39 add_event_handler('loc_end_section_init', 'crypto_document_init', EVENT_HANDLER_PRIORITY_NEUTRAL+30); 40 add_event_handler('loc_begin_register', 'crypto_register_init', EVENT_HANDLER_PRIORITY_NEUTRAL+30); 40 41 } 41 42 … … 64 65 return; 65 66 } 66 67 if (script_basename() == ' register' and $conf['cryptographp']['activate_on']['register'])67 68 if (script_basename() == 'picture' and $conf['cryptographp']['activate_on']['picture']) 68 69 { 69 $conf['cryptographp']['template'] = 'register';70 include(CRYPTO_PATH . 'include/register.inc.php');71 }72 else if (script_basename() == 'picture' and $conf['cryptographp']['activate_on']['picture'])73 {74 $conf['cryptographp']['template'] = 'comment';75 70 include(CRYPTO_PATH . 'include/picture.inc.php'); 76 71 } … … 84 79 ) 85 80 { 86 $conf['cryptographp']['template'] = 'comment';87 81 include(CRYPTO_PATH . 'include/category.inc.php'); 88 82 } 89 83 else if ($page['section'] == 'contact' && $conf['cryptographp']['activate_on']['contactform']) 90 84 { 91 $conf['cryptographp']['template'] = 'contactform';92 85 include(CRYPTO_PATH . 'include/contactform.inc.php'); 93 86 } 94 87 else if ($page['section'] == 'guestbook' && $conf['cryptographp']['activate_on']['guestbook']) 95 88 { 96 $conf['cryptographp']['template'] = 'guestbook';97 89 include(CRYPTO_PATH . 'include/guestbook.inc.php'); 98 90 } 91 } 92 } 93 function crypto_register_init() 94 { 95 global $conf; 96 97 if (!is_a_guest()) 98 { 99 return; 100 } 101 102 if ($conf['cryptographp']['activate_on']['register']) 103 { 104 include(CRYPTO_PATH . 'include/register.inc.php'); 99 105 } 100 106 } -
extensions/CryptograPHP/maintain.inc.php
r26041 r26072 8 8 function install($plugin_version, &$errors=array()) 9 9 { 10 global $conf; 11 10 12 if (isset($conf['cryptograph_theme'])) 11 13 { -
extensions/CryptograPHP/template/contactform.tpl
r26041 r26072 1 </tr>2 1 <tr> 3 2 <td class="title"> … … 11 10 </td> 12 11 13 {footer_script} 14 var captcha_code = new LiveValidation("captcha_code", {ldelim} onlyOnSubmit: true, insertAfterWhatNode: "captcha_refresh" }); 15 captcha_code.add(Validate.Presence, {ldelim} failureMessage: "{'Invalid Captcha'|translate}" }); 16 {/footer_script} 12 {footer_script} 13 var captcha_code = new LiveValidation("captcha_code", {ldelim} onlyOnSubmit: true, insertAfterWhatNode: "captcha_refresh" }); 14 captcha_code.add(Validate.Presence, {ldelim} failureMessage: "{'Invalid Captcha'|translate}" }); 15 {/footer_script} 16 </tr> -
extensions/CryptograPHP/template/guestbook.tpl
r26041 r26072 1 </td>2 </tr>3 1 <tr> 4 2 <td> … … 10 8 <a href="#" id="captcha_refresh" onclick="document.getElementById('captcha').src = '{$CRYPTO_PATH}securimage/securimage_show.php?'+Math.random(); return false;"> 11 9 <img src="{$CRYPTO_PATH}template/refresh_{$CRYPTO.button_color}.png" style="vertical-align:bottom;"></a> 10 </td> 12 11 13 {footer_script} 14 var captcha_code = new LiveValidation("captcha_code", {ldelim} onlyOnSubmit: true }); 15 captcha_code.add(Validate.Presence, {ldelim} failureMessage: "{'Invalid Captcha'|translate}" }); 16 {/footer_script} 12 {footer_script} 13 var captcha_code = new LiveValidation("captcha_code", {ldelim} onlyOnSubmit: true }); 14 captcha_code.add(Validate.Presence, {ldelim} failureMessage: "{'Invalid Captcha'|translate}" }); 15 {/footer_script} 16 </tr>
Note: See TracChangeset
for help on using the changeset viewer.