Rev | Line | |
---|
[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 | |
---|
| 14 | global $conf; |
---|
| 15 | |
---|
| 16 | add_event_handler('init', 'crypto_init'); |
---|
| 17 | |
---|
| 18 | function crypto_init() |
---|
| 19 | { |
---|
| 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' ); |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | function crypto_plugin_admin_menu($menu) |
---|
| 29 | { |
---|
| 30 | global $page,$conf; |
---|
| 31 | |
---|
| 32 | array_push($menu, |
---|
| 33 | array( |
---|
| 34 | 'NAME' => 'CryptograPHP', |
---|
| 35 | 'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__)) |
---|
| 36 | ) |
---|
| 37 | ); |
---|
| 38 | return $menu; |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.