Ignore:
Timestamp:
Jun 11, 2011, 3:01:45 PM (13 years ago)
Author:
mistic100
Message:

activate captcha on comment form

File:
1 edited

Legend:

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

    r10839 r11316  
    1212define('CRYPTO_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
    1313
    14 global $conf;
    15 
    16 add_event_handler('init', 'crypto_init');
     14add_event_handler('loc_end_section_init', 'crypto_init');
    1715
    1816function crypto_init()
    1917{
    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
     42if (script_basename() == 'admin')
     43{
     44  add_event_handler('get_admin_plugin_menu_links', 'crypto_plugin_admin_menu' );
    2645}
    2746
     
    3049        global $page,$conf;
    3150
    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      )
    3757                );
    3858        return $menu;
Note: See TracChangeset for help on using the changeset viewer.