Ignore:
Timestamp:
Mar 17, 2010, 5:44:07 PM (14 years ago)
Author:
Eric
Message:

[nbc_HistoryIPExcluder]

  • Removing "NBC" references
  • Display the good plugin's name
  • Database upgrade process for next version
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/nbc_HistoryIPExcluder/trunk/main.inc.php

    r5121 r5162  
    11<?php
    22/*
    3 Plugin Name: NBC History IP Excluder
    4 Version: 2.0.0
    5 Description: Permet l'exclusion d'une IP ou d'une plage d'IP de l historique - Excludes one IP or a range of IP from the history. plugin directement derive de Stats Ip Excluder de Eric
     3Plugin Name: History IP Excluder
     4Version: 2.0.1
     5Description: Permet l'exclusion d'une IP ou d'une plage d'IP de l historique - Excludes one IP or a range of IP from the history.
    66Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=147
    77Author: Nicco, Eric
     
    2222function HIPE_admin_menu($menu)
    2323{
     24// +-----------------------------------------------------------------------+
     25// |                      Getting plugin name                              |
     26// +-----------------------------------------------------------------------+
     27  $plugin =  PluginNfo(HIPE_PATH);
     28  $name = $plugin['name'];
     29 
    2430  array_push($menu,
    2531    array(
    26       'NAME' => 'History IP Excluder',
     32      'NAME' => $name,
    2733      'URL' => get_admin_plugin_menu_link(HIPE_PATH.'admin/HIPE_admin.php')
    2834    )
     
    3743  global $conf;
    3844
    39   $conf_HIPE = explode("," , $conf['nbc_HistoryIPExcluder']);
     45  $conf_HIPE = explode("," , $conf['HistoryIPExcluder']);
    4046
    4147  if (!$do_log)
     
    6369  }
    6470}
     71
     72
     73/* Email sending debugger function */
     74function DebugLog($value1,$value2)
     75{
     76   $fo=fopen (HIPE_PATH.'admin/log.txt','a') ;
     77   fwrite($fo,"======================\n") ;
     78   fwrite($fo, "\n" . $value1 . "\r\n") ;
     79   fwrite($fo, "\n" . $value2 . "\r\n") ;
     80   fclose($fo) ;
     81}
     82
     83/* Function called to get the plugin name */
     84function PluginNfo($dir)
     85{
     86  $path = $dir;
     87
     88  $plg_data = implode( '', file($path.'main.inc.php') );
     89  if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) )
     90  {
     91    $plugin['name'] = trim( $val[1] );
     92  }
     93  if (preg_match("|Version: (.*)|", $plg_data, $val))
     94  {
     95    $plugin['version'] = trim($val[1]);
     96  }
     97  if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) )
     98  {
     99    $plugin['uri'] = trim($val[1]);
     100  }
     101  if ($desc = load_language('description.txt', $path.'/', array('return' => true)))
     102  {
     103    $plugin['description'] = trim($desc);
     104  }
     105  elseif ( preg_match("|Description: (.*)|", $plg_data, $val) )
     106  {
     107    $plugin['description'] = trim($val[1]);
     108  }
     109  if ( preg_match("|Author: (.*)|", $plg_data, $val) )
     110  {
     111    $plugin['author'] = trim($val[1]);
     112  }
     113  if ( preg_match("|Author URI: (.*)|", $plg_data, $val) )
     114  {
     115    $plugin['author uri'] = trim($val[1]);
     116  }
     117  if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid='))
     118  {
     119    list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']);
     120    if (is_numeric($extension)) $plugin['extension'] = $extension;
     121  }
     122// IMPORTANT SECURITY !
     123  $plugin = array_map('htmlspecialchars', $plugin);
     124
     125  return $plugin ;
     126}
     127
    65128?>
Note: See TracChangeset for help on using the changeset viewer.