Changeset 26025
- Timestamp:
- Dec 18, 2013, 6:48:06 PM (10 years ago)
- Location:
- extensions/EasyCaptcha
- Files:
-
- 2 added
- 1 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/EasyCaptcha/admin.php
r24234 r26025 20 20 21 21 $conf['EasyCaptcha'] = 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'], … … 49 49 'sel' => check_color($_POST['tictac']['sel']), 50 50 ), 51 'lastmod' => time(), 51 52 ); 52 53 53 54 conf_update_param('EasyCaptcha', serialize($conf['EasyCaptcha'])); 54 array_push($page['infos'], l10n('Information data registered in database'));55 $page['infos'][] = l10n('Information data registered in database'); 55 56 } 56 57 … … 63 64 while (($item = readdir($dh)) !== false ) 64 65 { 65 if ($item!=='.' && $item!=='..' && is_dir($dir.'/'.$item) && file_exists($dir.'/'.$item.'/conf.inc.php')) 66 if ($item!=='.' && $item!=='..' && 67 is_dir($dir.'/'.$item) && file_exists($dir.'/'.$item.'/conf.inc.php') 68 ) 66 69 { 67 70 $drag_images = include($dir.'/'.$item.'/conf.inc.php'); … … 80 83 'easycaptcha' => $conf['EasyCaptcha'], 81 84 'loaded' => $loaded, 82 'THEMES' => list_themes(EASYCAPTCHA_PATH .'drag'),85 'THEMES' => list_themes(EASYCAPTCHA_PATH . 'drag'), 83 86 'EASYCAPTCHA_PATH' => EASYCAPTCHA_PATH, 84 'EASYCAPTCHA_ABS_PATH' => realpath(EASYCAPTCHA_PATH).'/', 87 'EASYCAPTCHA_ABS_PATH' => realpath(EASYCAPTCHA_PATH) . '/', 88 'DRAG_CSS' => file_get_contents(EASYCAPTCHA_PATH . 'template/drag.css'), 85 89 )); 86 90 87 $template->set_filename('plugin_admin_content', realpath(EASYCAPTCHA_PATH .'template/admin.tpl'));91 $template->set_filename('plugin_admin_content', realpath(EASYCAPTCHA_PATH . 'template/admin.tpl')); 88 92 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 89 93 … … 101 105 else if (strlen($hex) != 6) 102 106 { 103 $page['errors'][] = sprintf(l10n('Invalid color code <i>%s</i>'), '#'.$hex);107 $page['errors'][] = l10n('Invalid color code <i>%s</i>', '#'.$hex); 104 108 $hex = '000000'; 105 109 } -
extensions/EasyCaptcha/include/category.inc.php
r24215 r26025 15 15 { 16 16 $search = '{$comment_add.CONTENT}</textarea></p>'; 17 return str_replace($search, $search."\n{\$EASYCAPTCHA }", $content);17 return str_replace($search, $search."\n{\$EASYCAPTCHA_CONTENT}", $content); 18 18 } 19 19 -
extensions/EasyCaptcha/include/common.inc.php
r24215 r26025 28 28 $conf['EasyCaptcha']['drag']['selected'] = array_rand($conf['EasyCaptcha']['drag']['selection']); 29 29 $conf['EasyCaptcha']['drag']['text'] = l10n($drag_images[ $conf['EasyCaptcha']['drag']['selected'] ]); 30 $conf['EasyCaptcha']['drag']['key'] = $conf['EasyCaptcha']['challenge'] .'-'. pwg_password_hash($conf['secret_key'] . $conf['EasyCaptcha']['drag']['selected']); 31 32 $template->assign('EASYCAPTCHA_CONF', $conf['EasyCaptcha']['drag']); 30 $conf['EasyCaptcha']['key'] = $conf['EasyCaptcha']['challenge'] .'-'. pwg_password_hash($conf['secret_key'] . $conf['EasyCaptcha']['drag']['selected']); 33 31 } 34 32 // Tic-tac-toe 35 33 else if ($conf['EasyCaptcha']['challenge'] == 'tictac') 36 34 { 37 $conf['EasyCaptcha']['tictac']['key'] = $conf['EasyCaptcha']['challenge'] .'-0'; 38 $template->assign('EASYCAPTCHA_CONF', $conf['EasyCaptcha']['tictac']); 35 $conf['EasyCaptcha']['key'] = $conf['EasyCaptcha']['challenge'] .'-0'; 39 36 } 40 37 else … … 46 43 47 44 $template->assign(array( 48 'EASYCAPTCHA _CHALLENGE' => $conf['EasyCaptcha']['challenge'],45 'EASYCAPTCHA' => $conf['EasyCaptcha'], 49 46 'EASYCAPTCHA_PATH' => EASYCAPTCHA_PATH, 50 47 'EASYCAPTCHA_ABS_PATH' => realpath(EASYCAPTCHA_PATH).'/', … … 52 49 53 50 $template->set_filename('EasyCaptcha', realpath(EASYCAPTCHA_PATH.'template/'.$conf['EasyCaptcha']['template'].'.tpl')); 54 $template->assign_var_from_handle('EASYCAPTCHA ', 'EasyCaptcha');51 $template->assign_var_from_handle('EASYCAPTCHA_CONTENT', 'EasyCaptcha'); 55 52 56 53 -
extensions/EasyCaptcha/include/contactform.inc.php
r24215 r26025 15 15 { 16 16 $search = '{$contact.content}</textarea></td>'; 17 return str_replace($search, $search."\n{\$EASYCAPTCHA }", $content);17 return str_replace($search, $search."\n{\$EASYCAPTCHA_CONTENT}", $content); 18 18 } 19 19 -
extensions/EasyCaptcha/include/guestbook.inc.php
r24215 r26025 15 15 { 16 16 $search = '#{\$comment_add\.CONTENT}</textarea>(\s*)</td>(\s*)</tr>#'; 17 $replace = '{\$comment_add.CONTENT}</textarea>$1</td>$2</tr>'."\n".'{\$EASYCAPTCHA }';17 $replace = '{\$comment_add.CONTENT}</textarea>$1</td>$2</tr>'."\n".'{\$EASYCAPTCHA_CONTENT}'; 18 18 return preg_replace($search, $replace, $content); 19 19 } -
extensions/EasyCaptcha/include/picture.inc.php
r24215 r26025 15 15 { 16 16 $search = '{$comment_add.CONTENT}</textarea></p>'; 17 return str_replace($search, $search."\n{\$EASYCAPTCHA }", $content);17 return str_replace($search, $search."\n{\$EASYCAPTCHA_CONTENT}", $content); 18 18 } 19 19 -
extensions/EasyCaptcha/include/register.inc.php
r24215 r26025 15 15 { 16 16 $search = '<input type="checkbox" name="send_password_by_mail" id="send_password_by_mail" value="1" checked="checked">'; 17 return str_replace($search, $search."\n{\$EASYCAPTCHA }", $content);17 return str_replace($search, $search."\n{\$EASYCAPTCHA_CONTENT}", $content); 18 18 } 19 19 -
extensions/EasyCaptcha/language/en_UK/plugin.lang.php
r24340 r26025 35 35 $lang['This challenge requires that JavaScript is enabled on the visitor browser. About 1% of Internet users have Javascript disabled.'] = 'This challenge requires that JavaScript is enabled in the visitor\'s browser. About 1% of Internet users have JavaScript disabled.'; 36 36 $lang['We detected that Crypto Captcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'We detected that Crypto Captcha plugin is available in your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'; 37 $lang['Nowhere'] = 'Nowhere'; 37 38 ?> -
extensions/EasyCaptcha/language/fr_FR/plugin.lang.php
r24972 r26025 35 35 $lang['This challenge requires that JavaScript is enabled on the visitor browser. About 1% of Internet users have Javascript disabled.'] = 'Ce test requiert que JavaScript soit activé sur le navigateur du visiteur. Environ 1% des utilisateurs d\'Internet ont JavaScript désactivé.'; 36 36 $lang['We detected that Crypto Captcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'Nous avons détecté que Crypto Captcha est activé sur votre galerie. Les deux plugins peuvent fonctionner en même temps, mais sous aucun prétexte ils ne doivent être activés sur les mêmes pages.'; 37 $lang['Nowhere'] = 'Nulle part'; 37 38 ?> -
extensions/EasyCaptcha/main.inc.php
r24234 r26025 11 11 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 12 12 13 // TODO : teston mobile13 // TODO : captcha on mobile 14 14 if (mobile_theme()) 15 15 { … … 17 17 } 18 18 19 define d('EASYCAPTCHA_ID') or define('EASYCAPTCHA_ID',basename(dirname(__FILE__)));20 define('EASYCAPTCHA_PATH' , PHPWG_PLUGINS_PATH . EASYCAPTCHA_ID . '/');21 define('EASYCAPTCHA_ADMIN', get_root_url() . 'admin.php?page=plugin-' . EASYCAPTCHA_ID);19 define('EASYCAPTCHA_ID', basename(dirname(__FILE__))); 20 define('EASYCAPTCHA_PATH' , PHPWG_PLUGINS_PATH . EASYCAPTCHA_ID . '/'); 21 define('EASYCAPTCHA_ADMIN', get_root_url() . 'admin.php?page=plugin-' . EASYCAPTCHA_ID); 22 22 define('EASYCAPTCHA_VERSION', 'auto'); 23 23 … … 40 40 global $conf, $pwg_loaded_plugins; 41 41 42 if ( 43 EASYCAPTCHA_VERSION == 'auto' or 44 $pwg_loaded_plugins[EASYCAPTCHA_ID]['version'] == 'auto' or 45 version_compare($pwg_loaded_plugins[EASYCAPTCHA_ID]['version'], EASYCAPTCHA_VERSION, '<') 46 ) 47 { 48 include_once(EASYCAPTCHA_PATH . 'include/install.inc.php'); 49 easycaptcha_install(); 50 51 if ( $pwg_loaded_plugins[EASYCAPTCHA_ID]['version'] != 'auto' && EASYCAPTCHA_VERSION != 'auto' ) 52 { 53 $query = ' 54 UPDATE '. PLUGINS_TABLE .' 55 SET version = "'. EASYCAPTCHA_VERSION .'" 56 WHERE id = "'. EASYCAPTCHA_ID .'"'; 57 pwg_query($query); 58 59 $pwg_loaded_plugins[EASYCAPTCHA_ID]['version'] = EASYCAPTCHA_VERSION; 60 } 61 } 42 include_once(EASYCAPTCHA_PATH . 'maintain.inc.php'); 43 $maintain = new EasyCaptcha_maintain(EASYCAPTCHA_ID); 44 $maintain->autoUpdate(EASYCAPTCHA_VERSION, 'install'); 62 45 63 46 load_language('plugin.lang', EASYCAPTCHA_PATH); … … 71 54 global $conf, $pwg_loaded_plugins, $page; 72 55 73 if (!is_a_guest()) return; 56 if (!is_a_guest()) 57 { 58 return; 59 } 74 60 75 if ( script_basename() == 'register' && $conf['EasyCaptcha']['activate_on']['register'])61 if (script_basename() == 'register' && $conf['EasyCaptcha']['activate_on']['register']) 76 62 { 77 63 $conf['EasyCaptcha']['template'] = 'register'; 78 64 include(EASYCAPTCHA_PATH . 'include/register.inc.php'); 79 65 } 80 else if ( script_basename() == 'picture' && $conf['EasyCaptcha']['activate_on']['picture'])66 else if (script_basename() == 'picture' && $conf['EasyCaptcha']['activate_on']['picture']) 81 67 { 82 68 $conf['EasyCaptcha']['template'] = 'comment'; … … 95 81 include(EASYCAPTCHA_PATH . 'include/category.inc.php'); 96 82 } 97 else if ( $page['section'] == 'contact' && $conf['EasyCaptcha']['activate_on']['contactform'])83 else if ($page['section'] == 'contact' && $conf['EasyCaptcha']['activate_on']['contactform']) 98 84 { 99 85 $conf['EasyCaptcha']['template'] = 'contactform'; 100 86 include(EASYCAPTCHA_PATH . 'include/contactform.inc.php'); 101 87 } 102 else if ( $page['section'] == 'guestbook' && $conf['EasyCaptcha']['activate_on']['guestbook'])88 else if ($page['section'] == 'guestbook' && $conf['EasyCaptcha']['activate_on']['guestbook']) 103 89 { 104 90 $conf['EasyCaptcha']['template'] = 'guestbook'; … … 112 98 function easycaptcha_plugin_admin_menu($menu) 113 99 { 114 array_push($menu,array(100 $menu[] = array( 115 101 'NAME' => 'Easy Captcha', 116 102 'URL' => EASYCAPTCHA_ADMIN, 117 ) );103 ); 118 104 return $menu; 119 105 } -
extensions/EasyCaptcha/maintain.inc.php
r24215 r26025 2 2 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 3 3 4 defined('EASYCAPTCHA_ID') or define('EASYCAPTCHA_ID', basename(dirname(__FILE__))); 5 include_once(PHPWG_PLUGINS_PATH . EASYCAPTCHA_ID . '/include/install.inc.php'); 4 class EasyCaptcha_maintain extends PluginMaintain 5 { 6 private $installed = false; 6 7 7 function plugin_install() 8 { 9 easycaptcha_install(); 10 define('easycaptcha_installed', true); 11 } 8 function install($plugin_version, &$errors=array()) 9 { 10 global $conf; 12 11 13 function plugin_activate() 14 { 15 if (!defined('easycaptcha_installed')) 12 if (empty($conf['EasyCaptcha'])) 13 { 14 $default_config = array( 15 'activate_on' => array( 16 'picture' => true, 17 'category' => true, 18 'register' => true, 19 'contactform' => true, 20 'guestbook' => true, 21 ), 22 'comments_action' => 'reject', 23 'challenge' => 'random', 24 'drag' => array( 25 'theme' => 'icons', 26 'size' => 50, 27 'nb' => 5, 28 'bg1' => '#F7F7F7', 29 'bg2' => '#E5E5E5', 30 'obj' => '#FFFFFF', 31 'sel' => '#C8FF96', 32 'bd1' => '#DDDDDD', 33 'bd2' => '#555555', 34 'txt' => '#222222', 35 ), 36 'tictac' => array( 37 'size' => 128, 38 'bg1' => '#F7F7F7', 39 'bg2' => '#E5E5E5', 40 'bd' => '#DDDDDD', 41 'obj' => '#00B4F7', 42 'sel' => '#F7B400', 43 ), 44 'lastmod' => time(), 45 ); 46 47 $conf['EasyCaptcha'] = serialize($default_config); 48 conf_update_param('EasyCaptcha', $conf['EasyCaptcha']); 49 } 50 else 51 { 52 $old_conf = is_string($conf['EasyCaptcha']) ? unserialize($conf['EasyCaptcha']) : $conf['EasyCaptcha']; 53 54 if (empty($old_conf['lastmod'])) 55 { 56 $old_conf['lastmod'] = time(); 57 } 58 59 $conf['EasyCaptcha'] = serialize($old_conf); 60 conf_update_param('EasyCaptcha', $conf['EasyCaptcha']); 61 } 62 63 $this->installed = true; 64 } 65 66 function activate($plugin_version, &$errors=array()) 16 67 { 17 easycaptcha_install(); 68 if (!$this->installed) 69 { 70 $this->install($plugin_version, $errors); 71 } 72 } 73 74 function deactivate() 75 { 76 } 77 78 function uninstall() 79 { 80 conf_delete_param('EasyCaptcha'); 18 81 } 19 82 } 20 21 function plugin_uninstall()22 {23 pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param="EasyCaptcha" LIMIT 1');24 } -
extensions/EasyCaptcha/template/admin.tpl
r24234 r26025 1 {combine_css path=$EASYCAPTCHA_PATH| @cat:"template/style.css"}2 3 {combine_css path= "themes/default/js/plugins/chosen.css"}1 {combine_css path=$EASYCAPTCHA_PATH|cat:'template/style.css'} 2 3 {combine_css path='themes/default/js/plugins/chosen.css'} 4 4 {combine_script id='jquery.chosen' load='footer' path='themes/default/js/plugins/chosen.jquery.min.js'} 5 5 … … 8 8 9 9 {assign var="spectrum_language" value=$EASYCAPTCHA_PATH|cat:'template/bgrins-spectrum/i18n/jquery.spectrum-'|cat:$lang_info.code|cat:'.js'} 10 {if 'PHPWG_ROOT_PATH'| @constant|@cat:$spectrum_language|file_exists}10 {if 'PHPWG_ROOT_PATH'|constant|cat:$spectrum_language|file_exists} 11 11 {combine_script id='jquery.spectrum.'|cat:$lang_info.code load='footer' require='jquery.spectrum' path=$spectrum_language} 12 12 {/if} 13 13 14 14 15 {footer_script} {literal}15 {footer_script} 16 16 // multiselect 17 17 $("select").css({ 18 "width":"700px"18 width: 300 19 19 }).chosen({ 20 20 disable_search:true, 21 placeholder_text_multiple: '{'Nowhere'|translate}' 21 22 }); 22 23 … … 33 34 $('.preview-tictac').on('change', function() { 34 35 var inputs = ['size','bg1','bg2','bd','obj','sel'], 35 url = '{ /literal}{$EASYCAPTCHA_PATH}{literal}' + 'tictac/gen_admin.php?t='+ new Date().getTime();36 url = '{$EASYCAPTCHA_PATH}' + 'tictac/gen_admin.php?t='+ new Date().getTime(); 36 37 37 38 for (var i=0; i<inputs.length; i++) { … … 44 45 45 46 // Drag & drop preview 46 {/literal} 47 var themes = {ldelim} 47 var themes = { 48 48 {foreach from=$THEMES key=theme item=params} 49 49 '{$theme}': '{$EASYCAPTCHA_PATH}drag/{$theme}/{$params.image}', 50 50 {/foreach} 51 51 }; 52 {literal}53 52 54 53 $('.preview-drag').on('change', function() { … … 59 58 60 59 for (var i=0; i<inputs.length; i++) { 61 search = '{ \\$EASYCAPTCHA_CONF\\.'+ inputs[i] +'}';60 search = '{ldelim}\\$EASYCAPTCHA.drag\\.'+ inputs[i] +'}'; 62 61 replace = $('input[name="drag['+ inputs[i] +']"]').val(); 63 62 style = style.replace(new RegExp(search, 'g'), replace); … … 67 66 y = parseInt($('input[name="drag[nb]"]').val()); 68 67 69 search = '{ dat_equation}',68 search = '{ldelim}math equation=\'15+(x+5)*y\' x=$EASYCAPTCHA.drag.size y=$EASYCAPTCHA.drag.nb}', 70 69 replace = 15+(x+5)*y; 71 style = style.replace( new RegExp(search, 'g'), replace);70 style = style.replace(search, replace); 72 71 73 72 $('#drag_style').text(style); … … 107 106 $(this).nextAll('.preview').slideDown(); 108 107 }); 109 {/ literal}{/footer_script}108 {/footer_script} 110 109 111 110 … … 233 232 <a class="buttonLike">{'Preview'|translate}</a> 234 233 <div class="preview"> 235 {include file=$EASYCAPTCHA_ABS_PATH|cat:'template/common.inc.tpl' EASYCAPTCHA_CHALLENGE='drag' EASYCAPTCHA_CONF=$easycaptcha.drag} 234 {$easycaptcha.challenge = 'drag'} 235 {include file=$EASYCAPTCHA_ABS_PATH|cat:'template/common.inc.tpl' EASYCAPTCHA=$easycaptcha} 236 236 {$smarty.capture.easycaptcha} 237 237 </div> … … 251 251 [<a href="https://www.iconfinder.com/iconsets/ie_Bright" class="externalLink">#4</a>] 252 252 | Libraries 253 [<a href="http://bgrins.github.io/spectrum" class="externalLink">Spectrum.js</a>]254 [<a href="http://threedubmedia.com" class="externalLink">jQuery.events</a>]253 [<a href="http://bgrins.github.io/spectrum" class="externalLink">Spectrum.js</a>] 254 [<a href="http://threedubmedia.com" class="externalLink">jQuery.events</a>] 255 255 </div> 256 256 257 257 258 258 {* <!-- weird thing to update bunch of CSS --> *} 259 {html_head} {literal}259 {html_head} 260 260 <style id="drag_style"></style> 261 261 <script type="text/template" id="drag_style_src"> 262 #easycaptcha, #easycaptcha_noscript { 263 background: {$EASYCAPTCHA_CONF.bg1}; 264 background: -webkit-linear-gradient(top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 265 background: -moz-linear-gradient(top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 266 background: -ms-linear-gradient(top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 267 background: -o-linear-gradient(top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 268 background: linear-gradient(to bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 269 color:{$EASYCAPTCHA_CONF.txt}; 270 } 271 #easycaptcha .drag_item { 272 width:{$EASYCAPTCHA_CONF.size}px; 273 height:{$EASYCAPTCHA_CONF.size}px; 274 border:1px solid {$EASYCAPTCHA_CONF.bd1}; 275 background:{$EASYCAPTCHA_CONF.obj}; 276 } 277 #easycaptcha .drag_item img { 278 width:{$EASYCAPTCHA_CONF.size}px; 279 height:{$EASYCAPTCHA_CONF.size}px; 280 } 281 #easycaptcha .drop_zone { 282 width:{$EASYCAPTCHA_CONF.size}px; 283 height:{$EASYCAPTCHA_CONF.size}px; 284 margin-left:{dat_equation}px; 285 line-height:{$EASYCAPTCHA_CONF.size}px; 286 background: {$EASYCAPTCHA_CONF.bg1}; 287 background: -webkit-linear-gradient(bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 288 background: -moz-linear-gradient(bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 289 background: -ms-linear-gradient(bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 290 background: -o-linear-gradient(bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 291 background: linear-gradient(to top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 292 border:1px dotted {$EASYCAPTCHA_CONF.bd2}; 293 color:{$EASYCAPTCHA_CONF.txt}; 294 } 295 #easycaptcha .drop_zone.active { 296 background:{$EASYCAPTCHA_CONF.sel}; 297 } 298 #easycaptcha .drop_zone.valid { 299 background:{$EASYCAPTCHA_CONF.sel}; 300 box-shadow:0 0 0 2px {$EASYCAPTCHA_CONF.sel}; 301 } 262 {$DRAG_CSS} 302 263 </script> 303 {/ literal}{/html_head}264 {/html_head} -
extensions/EasyCaptcha/template/comment.tpl
r24234 r26025 2 2 3 3 {* <!-- DRAG & DROP --> *} 4 {if $EASYCAPTCHA _CHALLENGE== 'drag'}5 <p><label>{'To verify you are a human, please place the <b>%s</b> in the most right box bellow.'|translate |sprintf:$EASYCAPTCHA_CONF.text}</label></p>4 {if $EASYCAPTCHA.challenge == 'drag'} 5 <p><label>{'To verify you are a human, please place the <b>%s</b> in the most right box bellow.'|translate:$EASYCAPTCHA.drag.text}</label></p> 6 6 7 7 {* <!-- TIC TAC TOE --> *} 8 {else if $EASYCAPTCHA _CHALLENGE== 'tictac'}8 {else if $EASYCAPTCHA.challenge == 'tictac'} 9 9 <p><label>{'You are player X, click on the right case to complete the line.'|translate}</label></p> 10 10 -
extensions/EasyCaptcha/template/common.inc.tpl
r24234 r26025 1 1 {* <!-- DRAG & DROP --> *} 2 {if $EASYCAPTCHA _CHALLENGE== 'drag'}2 {if $EASYCAPTCHA.challenge == 'drag'} 3 3 {combine_script id='jquery.event.drag' load='footer' require='jquery' path=$EASYCAPTCHA_PATH|cat:'template/jquery.events/jquery.event.drag-2.2.js'} 4 4 {combine_script id='jquery.event.drop' load='footer' require='jquery' path=$EASYCAPTCHA_PATH|cat:'template/jquery.events/jquery.event.drop-2.2.js'} 5 5 6 6 {combine_script id='easycaptcha.drag' load='footer' require='jquery.event.drag,jquery.event.drop' path=$EASYCAPTCHA_PATH|cat:'template/drag.js'} 7 8 {html_style} 9 #easycaptcha, #easycaptcha_noscript {ldelim} 10 display:inline-block; 11 position:relative; 12 padding:10px; 13 border-radius:8px; 14 background: {$EASYCAPTCHA_CONF.bg1}; 15 background: -webkit-linear-gradient(top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 16 background: -moz-linear-gradient(top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 17 background: -ms-linear-gradient(top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 18 background: -o-linear-gradient(top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 19 background: linear-gradient(to bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 20 color:{$EASYCAPTCHA_CONF.txt}; 21 } 22 #easycaptcha .drag_item {ldelim} 23 position:absolute; 24 top:15px; 25 width:{$EASYCAPTCHA_CONF.size}px; 26 height:{$EASYCAPTCHA_CONF.size}px; 27 border-radius:5px; 28 border:1px solid {$EASYCAPTCHA_CONF.bd1}; 29 background:{$EASYCAPTCHA_CONF.obj}; 30 z-index:10; 31 cursor:move; 32 } 33 #easycaptcha .drag_item.active {ldelim} 34 z-index:100; 35 opacity:0.75; 36 } 37 #easycaptcha .drag_item img {ldelim} 38 width:{$EASYCAPTCHA_CONF.size}px; 39 height:{$EASYCAPTCHA_CONF.size}px; 40 border-radius:5px; 41 } 42 #easycaptcha .drop_zone {ldelim} 43 -moz-box-sizing:borderbox; 44 box-sizing:borderbox; 45 padding:5px; 46 width:{$EASYCAPTCHA_CONF.size}px; 47 height:{$EASYCAPTCHA_CONF.size}px; 48 margin-left:{math equation='15+(x+5)*y' x=$EASYCAPTCHA_CONF.size y=$EASYCAPTCHA_CONF.nb}px; 49 line-height:{$EASYCAPTCHA_CONF.size}px; 50 background: {$EASYCAPTCHA_CONF.bg1}; 51 background: -webkit-linear-gradient(bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 52 background: -moz-linear-gradient(bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 53 background: -ms-linear-gradient(bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 54 background: -o-linear-gradient(bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 55 background: linear-gradient(to top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 56 border:1px dotted {$EASYCAPTCHA_CONF.bd2}; 57 border-radius:5px; 58 text-align:center; 59 text-transform:uppercase; 60 color:{$EASYCAPTCHA_CONF.txt}; 61 } 62 #easycaptcha .drop_zone.active {ldelim} 63 background:{$EASYCAPTCHA_CONF.sel}; 64 } 65 #easycaptcha .drop_zone.valid {ldelim} 66 background:{$EASYCAPTCHA_CONF.sel}; 67 box-shadow:0 0 0 2px {$EASYCAPTCHA_CONF.sel}; 68 } 69 {/html_style} 7 {combine_css id='easycaptcha.drag' path=$EASYCAPTCHA_PATH|cat:'template/drag.css' template=true version=$EASYCAPTCHA.lastmod} 70 8 71 9 {capture name=easycaptcha} … … 76 14 <div id="easycaptcha" style="display:none;"> 77 15 {counter start=0 assign=i} 78 {foreach from=$EASYCAPTCHA _CONF.selection item=image}79 <div class="drag_item" style="left:{math equation='10+(x+5)*y' x=$EASYCAPTCHA _CONF.size y=$i}px;" data-id="{$image}">80 <img src="{$ROOT_URL}{$EASYCAPTCHA_PATH}drag/get.php?{$EASYCAPTCHA _CONF.theme}&{$image}">16 {foreach from=$EASYCAPTCHA.drag.selection item=image} 17 <div class="drag_item" style="left:{math equation='10+(x+5)*y' x=$EASYCAPTCHA.drag.size y=$i}px;" data-id="{$image}"> 18 <img src="{$ROOT_URL}{$EASYCAPTCHA_PATH}drag/get.php?{$EASYCAPTCHA.drag.theme}&{$image}"> 81 19 </div> 82 20 {counter} … … 87 25 {* <!-- fields are not type "hidden" for LiveValidation in GuestBook and ContactForm --> *} 88 26 <input type="text" name="easycaptcha" value="" style="display:none;"> 89 <input type="text" name="easycaptcha_key" value="{$EASYCAPTCHA _CONF.key}" style="display:none;">27 <input type="text" name="easycaptcha_key" value="{$EASYCAPTCHA.key}" style="display:none;"> 90 28 {/capture} 91 29 92 30 93 31 {* <!-- TIC TAC TOE --> *} 94 {else if $EASYCAPTCHA_CHALLENGE == 'tictac'} 95 {html_style} 96 #easycaptcha table {ldelim} 97 width:{$EASYCAPTCHA_CONF.size}px; 98 height:{$EASYCAPTCHA_CONF.size}px; 99 border-collapse:collapse; 100 display:inline-block; 101 margin:0; 102 background:url('{$ROOT_URL}{$EASYCAPTCHA_PATH}tictac/gen.php?t={$smarty.now}') no-repeat; 103 } 104 #easycaptcha td {ldelim} 105 border:none; 106 padding:0; 107 } 108 #easycaptcha label {ldelim} 109 display:block; 110 width:{math equation="floor(x/3)" x=$EASYCAPTCHA_CONF.size}px; 111 height:{math equation="floor(x/3)" x=$EASYCAPTCHA_CONF.size}px; 112 cursor:url('{$ROOT_URL}{$EASYCAPTCHA_PATH}tictac/gen.php?cross=96') 16 16, pointer; 113 } 114 #easycaptcha input {ldelim} 115 display:none; 116 } 117 #easycaptcha label.selected {ldelim} 118 background:url('{$ROOT_URL}{$EASYCAPTCHA_PATH}tictac/gen.php?cross={$EASYCAPTCHA_CONF.size}') no-repeat; 119 } 120 {/html_style} 32 {else if $EASYCAPTCHA.challenge == 'tictac'} 33 {combine_css id='easycaptcha.tictac' path=$EASYCAPTCHA_PATH|cat:'template/tictac.css' template=true version=$EASYCAPTCHA.lastmod} 121 34 122 {footer_script require='jquery'} {literal}35 {footer_script require='jquery'} 123 36 (function($){ 124 37 $('#easycaptcha input').on('change', function() { … … 127 40 }); 128 41 }(jQuery)); 129 {/ literal}{/footer_script}42 {/footer_script} 130 43 131 44 {capture name=easycaptcha} … … 150 63 </div> 151 64 152 <input type="text" name="easycaptcha_key" value="{$EASYCAPTCHA _CONF.key}" style="display:none;">65 <input type="text" name="easycaptcha_key" value="{$EASYCAPTCHA.key}" style="display:none;"> 153 66 {/capture} 154 67 -
extensions/EasyCaptcha/template/contactform.tpl
r24234 r26025 4 4 5 5 {* <!-- DRAG & DROP --> *} 6 {if $EASYCAPTCHA _CHALLENGE== 'drag'}7 <td class="title">{'To verify you are a human, please place the <b>%s</b> in the most right box bellow.'|translate |sprintf:$EASYCAPTCHA_CONF.text}</td>6 {if $EASYCAPTCHA.challenge == 'drag'} 7 <td class="title">{'To verify you are a human, please place the <b>%s</b> in the most right box bellow.'|translate:$EASYCAPTCHA.drag.text}</td> 8 8 9 9 {footer_script} … … 13 13 14 14 {* <!-- TIC TAC TOE --> *} 15 {else if $EASYCAPTCHA _CHALLENGE== 'tictac'}15 {else if $EASYCAPTCHA..challenge == 'tictac'} 16 16 <td class="title">{'You are player X, click on the right case to complete the line.'|translate}</td> 17 17 -
extensions/EasyCaptcha/template/drag.js
r24215 r26025 39 39 }); 40 40 }) 41 .drag('end', function( e, dd) {41 .drag('end', function() { 42 42 $(this).removeClass('active'); 43 43 }); 44 44 45 45 $easycaptcha.find('.drop_zone') 46 .drop('start', function( e, dd) {46 .drop('start', function() { 47 47 $(this).addClass('active'); 48 48 }) -
extensions/EasyCaptcha/template/guestbook.tpl
r24234 r26025 3 3 4 4 {* <!-- DRAG & DROP --> *} 5 {if $EASYCAPTCHA _CHALLENGE== 'drag'}6 <td colspan=2><label>{'To verify you are a human, please place the <b>%s</b> in the most right box bellow.'|translate |sprintf:$EASYCAPTCHA_CONF.text}</label></td>5 {if $EASYCAPTCHA.challenge == 'drag'} 6 <td colspan=2><label>{'To verify you are a human, please place the <b>%s</b> in the most right box bellow.'|translate:$EASYCAPTCHA.drag.text}</label></td> 7 7 8 8 {footer_script} … … 12 12 13 13 {* <!-- TIC TAC TOE --> *} 14 {else if $EASYCAPTCHA _CHALLENGE== 'tictac'}14 {else if $EASYCAPTCHA.challenge == 'tictac'} 15 15 <td colspan=2><label>{'You are player X, click on the right case to complete the line.'|translate}</label></td> 16 16 -
extensions/EasyCaptcha/template/register.tpl
r24234 r26025 4 4 5 5 {* <!-- DRAG & DROP --> *} 6 {if $EASYCAPTCHA _CHALLENGE== 'drag'}7 <span class="property"><label>{'To verify you are a human, please place the <b>%s</b> in the most right box bellow.'|translate |sprintf:$EASYCAPTCHA_CONF.text}</label></span>6 {if $EASYCAPTCHA.challenge == 'drag'} 7 <span class="property"><label>{'To verify you are a human, please place the <b>%s</b> in the most right box bellow.'|translate:$EASYCAPTCHA.drag.text}</label></span> 8 8 9 9 {* <!-- TIC TAC TOE --> *} 10 {else if $EASYCAPTCHA _CHALLENGE== 'tictac'}10 {else if $EASYCAPTCHA.challenge == 'tictac'} 11 11 <span class="property"><label>{'You are player X, click on the right case to complete the line.'|translate}</label></span> 12 12 -
extensions/EasyCaptcha/template/style.css
r24215 r26025 40 40 .my-warnings { 41 41 background-image:none; 42 display:inline-block; 42 43 min-height:0; 43 padding: 0 00 5px;44 padding:5px 5px 0 5px; 44 45 margin:0 5px 15px 5px; 45 46 font-weight:normal;
Note: See TracChangeset
for help on using the changeset viewer.