Ignore:
Timestamp:
Nov 13, 2011, 12:34:07 AM (9 years ago)
Author:
mistic100
Message:

rewrite some prefilters, replace CryptograPHP by Securimage (not abandoned project!)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/CryptograPHP/main.inc.php

    r11375 r12617  
    33Plugin Name: Crypto Captcha
    44Version: auto
    5 Description: Add a CryptograPHP captcha to register, comment and ContactForm pages (thanks to P@t)
     5Description: Add a captcha to register, comment and ContactForm pages (thanks to P@t)
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=535
    77Author: Mistic
    88Author URI: http://www.strangeplanet.fr
     9*/
     10
     11## TODO : add customization of background image
     12
     13/*
     14Author note :
     15Le plugin était appellé à l'origine CryptograPHP et utilisait la librairie CryptograPHP
     16Puis il a été renommé Crypto Captcha pour plus de clareté
     17La version actuelle s'appelle toujours Crypto Captcha mais utilise la librairie Securimage
    918*/
    1019
     
    1726{
    1827  global $conf, $pwg_loaded_plugins, $page;
    19   $conf['cryptographp_theme'] = explode(',', $conf['cryptographp_theme']);
     28 
     29  $conf['cryptographp'] = unserialize($conf['cryptographp']);
     30  load_language('plugin.lang', CRYPTO_PATH);
    2031 
    2132  if (script_basename() == 'register')
     
    2334    include(CRYPTO_PATH.'include/register.inc.php');
    2435  }
    25   else if (script_basename() == 'picture' AND $conf['cryptographp_theme'][1] != 'inactive')
     36  else if (script_basename() == 'picture' and $conf['cryptographp']['comments_action'] != 'inactive')
    2637  {
    2738    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');
    3539  }
    3640  else if (isset($_GET['/contact']))
    3741  {
    3842    include(CRYPTO_PATH.'include/contactform.inc.php');
     43  }
     44  else if (
     45    script_basename() == 'index' and $conf['cryptographp']['comments_action'] != 'inactive' and
     46    isset($pwg_loaded_plugins['Comments_on_Albums']) and isset($page['section']) and
     47    $page['section'] == 'categories' and isset($page['category'])
     48    )
     49  {
     50    include(CRYPTO_PATH.'include/category.inc.php');
    3951  }
    4052}
     
    4658  function crypto_plugin_admin_menu($menu)
    4759  {
    48     global $page,$conf;
    49 
    50     array_push(
    51       $menu,
    52       array(
    53         'NAME' => 'CryptograPHP',
    54         'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__))
    55         )
    56       );
     60    array_push($menu, array(
     61      'NAME' => 'Crypto Captcha',
     62      'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__))
     63      ));
    5764    return $menu;
    5865  }
Note: See TracChangeset for help on using the changeset viewer.