Changeset 11316
- Timestamp:
- Jun 11, 2011, 3:01:45 PM (13 years ago)
- Location:
- extensions/CryptograPHP
- Files:
-
- 3 added
- 6 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
extensions/CryptograPHP/admin.php
r10837 r11316 3 3 4 4 load_language('plugin.lang', CRYPTO_PATH); 5 $conf['cryptographp_theme'] = explode(',', $conf['cryptographp_theme']); 5 6 6 7 if ( isset($_POST['submit'])) 7 8 { 8 $conf['cryptographp_theme'] = trim($_POST['cryptographp_theme']); 9 10 $query = ' 11 UPDATE '.CONFIG_TABLE.' 12 SET value="'.$conf['cryptographp_theme'].'" 13 WHERE param="cryptographp_theme" 14 LIMIT 1'; 15 pwg_query($query); 16 9 $conf['cryptographp_theme'] = array( 10 $_POST['cryptographp_theme'], 11 $_POST['comments_action'], 12 ); 13 conf_update_param('cryptographp_theme', implode(',', $conf['cryptographp_theme'])); 17 14 array_push($page['infos'], l10n('Information data registered in database')); 18 15 } … … 21 18 22 19 $template->assign(array( 23 'cryptographp_theme' => $conf['cryptographp_theme'], 20 'cryptographp_theme' => $conf['cryptographp_theme'][0], 21 'comments_action' => $conf['cryptographp_theme'][1], 24 22 'available_themes' => array('cryptographp', 'bluenoise', 'gray', 'pencil', 'xcolor'), 25 23 'CRYPTO_PATH' => CRYPTO_PATH, … … 27 25 ); 28 26 29 $template->assign_var_from_handle( 27 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 30 28 31 29 ?> -
extensions/CryptograPHP/admin.tpl
r11023 r11316 5 5 <form method="post" class="properties"> 6 6 <fieldset> 7 <legend>{'C aptcha theme'|@translate}</legend>7 <legend>{'Configuration'|@translate}</legend> 8 8 9 {foreach from=$available_themes item=theme} 10 <div style="display:inline-block;margin-top:5px;"> 11 <label for="{$theme}-example"><img src="{$CRYPTO_PATH}cryptographp/images/{$theme}.png" alt="{$theme}"/></label> <br/> 12 <input type="radio" name="cryptographp_theme" id="{$theme}-example" value="{$theme}" {if $theme == $cryptographp_theme}checked="checked"{/if}/> 13 </div> 14 {/foreach} 9 <ul> 10 <li style="text-align:center;"> 11 <b>{'Captcha theme'|@translate}</b><br/> 12 {foreach from=$available_themes item=theme} 13 <div style="display:inline-block;margin-top:5px;"> 14 <label for="{$theme}-example"><img src="{$CRYPTO_PATH}cryptographp/images/{$theme}.png" alt="{$theme}"/></label> <br/> 15 <input type="radio" name="cryptographp_theme" id="{$theme}-example" value="{$theme}" {if $theme == $cryptographp_theme}checked="checked"{/if}/> 16 </div> 17 {/foreach} 18 </li> 19 20 <li> 21 <span class="property">{'Comments action'|@translate}</span> 22 <label><input type="radio" name="comments_action" value="inactive" {if $comments_action == 'inactive'}checked="checked"{/if}/> {'No captcha'|@translate}</label> 23 <label><input type="radio" name="comments_action" value="reject" {if $comments_action == 'reject'}checked="checked"{/if}/> {'Reject'|@translate}</label> 24 <label><input type="radio" name="comments_action" value="moderate" {if $comments_action == 'moderate'}checked="checked"{/if}/> {'Moderate'|@translate}</label> 25 </li> 26 </ul> 15 27 16 28 <p class="bottomButtons"> -
extensions/CryptograPHP/include/contactform.inc.php
r11249 r11316 13 13 global $template, $conf; 14 14 15 //if (!is_a_guest()) return;15 if (!is_a_guest()) return; 16 16 17 17 $template->set_prefilter('cf_form', 'captcha_prefilter'); 18 $template->assign('CAPTCHA', dsp_crypt($conf['cryptographp_theme'] .'.cfg.php',1));18 $template->assign('CAPTCHA', dsp_crypt($conf['cryptographp_theme'][0].'.cfg.php',1)); 19 19 } 20 20 … … 38 38 function check_captcha($infos) 39 39 { 40 global $conf;41 42 40 if (!is_a_guest()) return $infos; 43 41 -
extensions/CryptograPHP/include/register.inc.php
r11249 r11316 14 14 15 15 $template->set_prefilter('register', 'captcha_prefilter'); 16 $template->assign('CAPTCHA', dsp_crypt($conf['cryptographp_theme'] .'.cfg.php',1));16 $template->assign('CAPTCHA', dsp_crypt($conf['cryptographp_theme'][0].'.cfg.php',1)); 17 17 } 18 18 … … 41 41 function check_captcha($errors) 42 42 { 43 global $conf;44 45 43 if (!chk_crypt($_POST['code'])) 46 44 { -
extensions/CryptograPHP/language/en_UK/plugin.lang.php
r10837 r11316 4 4 $lang['Captcha theme'] = 'Captcha theme'; 5 5 $lang['Antibot test'] = 'Antibot test'; 6 $lang['Comments action'] = 'Comments action'; 7 $lang['Moderate'] = 'Moderate'; 8 $lang['No captcha'] = 'No captcha'; 6 9 7 10 ?> -
extensions/CryptograPHP/language/fr_FR/plugin.lang.php
r10837 r11316 4 4 $lang['Captcha theme'] = 'Thème du captcha'; 5 5 $lang['Antibot test'] = 'Test anti-bots'; 6 $lang['Comments action'] = 'Action pour les commentaires'; 7 $lang['Moderate'] = 'Modérer'; 8 $lang['No captcha'] = 'Pas de captcha'; 6 9 7 10 ?> -
extensions/CryptograPHP/main.inc.php
r10839 r11316 12 12 define('CRYPTO_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'); 13 13 14 global $conf; 15 16 add_event_handler('init', 'crypto_init'); 14 add_event_handler('loc_end_section_init', 'crypto_init'); 17 15 18 16 function crypto_init() 19 17 { 20 if (script_basename() == 'register') 21 include('register.inc.php'); 22 elseif (isset($_GET['/contact'])) 23 include('contactform.inc.php'); 24 else if (script_basename() == 'admin') 25 add_event_handler('get_admin_plugin_menu_links', 'crypto_plugin_admin_menu' ); 18 global $conf, $pwg_loaded_plugins, $page; 19 $conf['cryptographp_theme'] = explode(',', $conf['cryptographp_theme']); 20 21 if (script_basename() == 'register') 22 { 23 include(CRYPTO_PATH.'include/register.inc.php'); 24 } 25 else if (script_basename() == 'picture' AND $conf['cryptographp_theme'][1] != 'inactive') 26 { 27 include(CRYPTO_PATH.'include/picture.inc.php'); 28 } 29 else if ( 30 script_basename() == 'index' AND $conf['cryptographp_theme'][1] != 'inactive' AND 31 isset($pwg_loaded_plugins['Comments_on_Albums']) AND 32 $page['section'] == 'categories' AND isset($page['category']) 33 ) { 34 include(CRYPTO_PATH.'include/category.inc.php'); 35 } 36 else if (isset($_GET['/contact'])) 37 { 38 include(CRYPTO_PATH.'include/contactform.inc.php'); 39 } 40 } 41 42 if (script_basename() == 'admin') 43 { 44 add_event_handler('get_admin_plugin_menu_links', 'crypto_plugin_admin_menu' ); 26 45 } 27 46 … … 30 49 global $page,$conf; 31 50 32 array_push($menu, 33 array( 34 'NAME' => 'CryptograPHP', 35 'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__)) 36 ) 51 array_push( 52 $menu, 53 array( 54 'NAME' => 'CryptograPHP', 55 'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__)) 56 ) 37 57 ); 38 58 return $menu; -
extensions/CryptograPHP/maintain.inc.php
r10841 r11316 6 6 if (!isset($conf['cryptographp_theme'])) 7 7 { 8 pwg_query('INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("cryptographp_theme","cryptographp ","CryptograPHP theme");');8 pwg_query('INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("cryptographp_theme","cryptographp,reject","CryptograPHP config");'); 9 9 } 10 10 } 11 11 12 function plugin_activate() 13 { 14 global $conf; 15 $conf['cryptographp_theme'] = explode(',', $conf['cryptographp_theme']); 16 17 if(count($conf['cryptographp_theme']) == 1) 18 { 19 pwg_query('UPDATE '.CONFIG_TABLE.' SET value = "'.$conf['cryptographp_theme'][0].',reject" WHERE param = "cryptographp_theme";'); 20 } 21 } 12 22 function plugin_uninstall() 13 23 {
Note: See TracChangeset
for help on using the changeset viewer.