Ignore:
Timestamp:
09/16/12 17:20:39 (7 years ago)
Author:
mistic100
Message:
  • stores emails in database (/!\ update only from published version, not from trunk)
  • allow emails to be categorized
File:
1 edited

Legend:

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

    r17658 r17945  
    1111if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 
    1212 
    13 define('CONTACT_FORM_PATH',   PHPWG_PLUGINS_PATH . 'ContactForm/'); 
    14 define('CONTACT_FORM_ADMIN',  get_root_url() . 'admin.php?page=plugin-ContactForm'); 
    15 define('CONTACT_FORM_PUBLIC', get_absolute_root_url() . make_index_url(array('section' => 'contact')) . '/'); 
    16 define('CONTACT_FORM_VERSION', '2.4.d'); 
     13global $prefixeTable; 
     14 
     15defined('CONTACT_FORM_ID') or define('CONTACT_FORM_ID', basename(dirname(__FILE__))); 
     16define('CONTACT_FORM_PATH',    PHPWG_PLUGINS_PATH . CONTACT_FORM_ID . '/'); 
     17define('CONTACT_FORM_ADMIN',   get_root_url() . 'admin.php?page=plugin-' . CONTACT_FORM_ID); 
     18define('CONTACT_FORM_PUBLIC',  get_absolute_root_url() . make_index_url(array('section' => 'contact')) . '/'); 
     19define('CONTACT_FORM_TABLE',   $prefixeTable .'contact_form'); 
     20define('CONTACT_FORM_VERSION', '2.5.0'); 
    1721 
    1822 
    1923add_event_handler('init', 'contact_form_init'); 
    2024 
    21 add_event_handler('loc_end_section_init', 'contact_form_section_init'); 
    22 add_event_handler('loc_end_index', 'contact_form_page'); 
    23 add_event_handler('blockmanager_apply', 'contact_form_applymenu', EVENT_HANDLER_PRIORITY_NEUTRAL+10); 
    24  
    2525if (defined('IN_ADMIN')) 
    2626{ 
    2727  add_event_handler('get_admin_plugin_menu_links', 'contact_form_admin_menu'); 
     28} 
     29else 
     30{ 
     31  add_event_handler('loc_end_section_init', 'contact_form_section_init'); 
     32  add_event_handler('loc_end_index', 'contact_form_page'); 
     33  add_event_handler('blockmanager_apply', 'contact_form_applymenu', EVENT_HANDLER_PRIORITY_NEUTRAL+10); 
    2834} 
    2935 
     
    3945   
    4046  if ( 
    41     $pwg_loaded_plugins['ContactForm']['version'] == 'auto' or 
    42     version_compare($pwg_loaded_plugins['ContactForm']['version'], CONTACT_FORM_VERSION, '<') 
     47    $pwg_loaded_plugins[CONTACT_FORM_ID]['version'] == 'auto' or 
     48    version_compare($pwg_loaded_plugins[CONTACT_FORM_ID]['version'], CONTACT_FORM_VERSION, '<') 
    4349  ) 
    4450  { 
     
    4652    contact_form_install(); 
    4753     
    48     if ($pwg_loaded_plugins['ContactForm']['version'] != 'auto') 
     54    if ($pwg_loaded_plugins[CONTACT_FORM_ID]['version'] != 'auto') 
    4955    { 
    5056      $query = ' 
    5157UPDATE '. PLUGINS_TABLE .' 
    5258SET version = "'. CONTACT_FORM_VERSION .'" 
    53 WHERE id = "ContactForm"'; 
     59WHERE id = "'. CONTACT_FORM_ID .'"'; 
    5460      pwg_query($query); 
    5561       
    56       $pwg_loaded_plugins['ContactForm']['version'] = CONTACT_FORM_VERSION; 
     62      $pwg_loaded_plugins[CONTACT_FORM_ID]['version'] = CONTACT_FORM_VERSION; 
    5763       
    5864      if (defined('IN_ADMIN')) 
Note: See TracChangeset for help on using the changeset viewer.