[10837] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Plugin Name: CryptograPHP |
---|
| 4 | Version: auto |
---|
| 5 | Description: Add a CryptograPHP captcha to register and ContactForm pages (thanks to P@t) |
---|
[10839] | 6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=535 |
---|
[10837] | 7 | Author: Mistic |
---|
| 8 | Author URI: http://www.strangeplanet.fr |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 12 | define('CRYPTO_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'); |
---|
| 13 | |
---|
[11316] | 14 | add_event_handler('loc_end_section_init', 'crypto_init'); |
---|
[10837] | 15 | |
---|
| 16 | function crypto_init() |
---|
| 17 | { |
---|
[11316] | 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 | } |
---|
[10837] | 40 | } |
---|
| 41 | |
---|
[11316] | 42 | if (script_basename() == 'admin') |
---|
| 43 | { |
---|
| 44 | add_event_handler('get_admin_plugin_menu_links', 'crypto_plugin_admin_menu' ); |
---|
| 45 | } |
---|
| 46 | |
---|
[10837] | 47 | function crypto_plugin_admin_menu($menu) |
---|
| 48 | { |
---|
| 49 | global $page,$conf; |
---|
| 50 | |
---|
[11316] | 51 | array_push( |
---|
| 52 | $menu, |
---|
| 53 | array( |
---|
| 54 | 'NAME' => 'CryptograPHP', |
---|
| 55 | 'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__)) |
---|
| 56 | ) |
---|
[10837] | 57 | ); |
---|
| 58 | return $menu; |
---|
| 59 | } |
---|
| 60 | |
---|
| 61 | ?> |
---|