Changeset 5615 for extensions


Ignore:
Timestamp:
Apr 3, 2010, 11:39:13 PM (14 years ago)
Author:
Eric
Message:

[nbc_HistoryIPExcluder]

  • Piwigo 2.1 compliance
  • Multiple database support
  • Improving the display of plugin's name
Location:
extensions/nbc_HistoryIPExcluder/trunk
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • extensions/nbc_HistoryIPExcluder/trunk/admin/HIPE_admin.php

    r5162 r5615  
    44
    55load_language('plugin.lang', HIPE_PATH);
     6
     7// +-----------------------------------------------------------------------+
     8// |                      Getting plugin version                           |
     9// +-----------------------------------------------------------------------+
     10$plugin =  HIPE_infos(HIPE_PATH);
     11$version = $plugin['version'];
     12$name = $plugin['name'];
    613
    714
     
    7683  $subresult = pwg_query($query);
    7784
    78   while ($subrow = mysql_fetch_array($subresult))
     85  while ($subrow = pwg_db_fetch_assoc($subresult))
    7986  {
    8087    $template->assign(
     
    116123  $subresult = pwg_query($query);
    117124
    118   while ($subrow = mysql_fetch_array($subresult))
     125  while ($subrow = pwg_db_fetch_assoc($subresult))
    119126  {
    120127    $template->assign(
     
    149156  $subresult = pwg_query($query);
    150157
    151   while ($subrow = mysql_fetch_array($subresult))
     158  while ($subrow = pwg_db_fetch_assoc($subresult))
    152159  {
    153160    $template->assign(
     
    182189  $subresult = pwg_query($query);
    183190
    184   while ($subrow = mysql_fetch_array($subresult))
     191  while ($subrow = pwg_db_fetch_assoc($subresult))
    185192  {
    186193    $template->assign(
     
    201208$template->assign(
    202209  array(
    203     'HIPE_F_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=plugin&section=HistoryIPExcluder%2Fadmin%2FHIPE_admin.php',
     210    'HIPE_VERSION' => $version,
     211    'HIPE_NAME'    => $name,
     212    'HIPE_PATH'    => HIPE_PATH,
    204213    'IPs_EXCLUDED' => implode("\n", $conf_HIPE),
    205214  )
  • extensions/nbc_HistoryIPExcluder/trunk/admin/HIPE_admin.tpl

    r5162 r5615  
    11<div class="titrePage">
    2   <h2>{'HIPE_admin_title'|@translate}</h2>
     2  <h2>{$HIPE_NAME}{'HIPE_version'|@translate}{$HIPE_VERSION}</h2>
    33</div>
    44
    55<p>{'HIPE_description'|@translate}</p>
    66
    7 <form method="post" action="{$HIPE_F_ACTION}" class="general">
     7<form method="post" action="" class="general">
    88  <fieldset>
    99    <legend>{'HIPE_admin_section1'|@translate}</legend>
  • extensions/nbc_HistoryIPExcluder/trunk/language/en_UK/plugin.lang.php

    r5121 r5615  
    22global $lang;
    33
    4 $lang['HIPE_admin_title'] = 'NBC History IP Excluder';
    54$lang['HIPE_description'] = 'This plugin allows to exclude from the history and statistics of IP or IP ranges. <br>Its activation blocks record in the table of IP *_history specified in the table below.';
    65$lang['HIPE_admin_section1'] = 'IP Exclusion';
     
    2726
    2827$lang['IP_geolocalisation'] = 'Geolocalisation';
     28
     29// --------- Starting below: New or revised $lang ---- from version 2.1.0
     30$lang['HIPE_version'] = ' - Version: ';
     31// --------- End: New or revised $lang ---- from version 2.1.0
    2932?>
  • extensions/nbc_HistoryIPExcluder/trunk/language/es_ES/plugin.lang.php

    r5135 r5615  
    22global $lang;
    33
    4 $lang['HIPE_admin_title'] = 'NBC History IP Excluder';
    54$lang['HIPE_description'] = 'Este plugin permite excluir de la reseña histórica y las estadísticas del IP o las playas d \'IP. <br> Su activación bloquea el registro en la mesa * _history IP especificados en el tablero más abajo.';
    65$lang['HIPE_admin_section1'] = 'IP a excluir';
     
    2827$lang['IP_geolocalisation'] = 'Geolocalización';
    2928$lang['submit'] = 'Someter';
     29
     30// --------- Starting below: New or revised $lang ---- from version 2.1.0
     31$lang['HIPE_version'] = ' - Versión: ';
     32// --------- End: New or revised $lang ---- from version 2.1.0
    3033?>
  • extensions/nbc_HistoryIPExcluder/trunk/language/fr_FR/plugin.lang.php

    r5121 r5615  
    22global $lang;
    33
    4 $lang['HIPE_admin_title'] = 'NBC History IP Excluder';
    54$lang['HIPE_description'] = 'Ce plugin permet d\'exclure de l\'historique et des statistiques des IP ou plages d\'IP.<br>Son activation bloque l\'enregistrement dans la table *_history des IP spécifiées dans le tableau ci-dessous.';
    65$lang['HIPE_admin_section1'] = 'IP à exclure';
     
    2726
    2827$lang['IP_geolocalisation'] = 'Géolocalisation';
     28
     29// --------- Starting below: New or revised $lang ---- from version 2.1.0
     30$lang['HIPE_version'] = ' - Version: ';
     31// --------- End: New or revised $lang ---- from version 2.1.0
    2932?>
  • extensions/nbc_HistoryIPExcluder/trunk/language/hu_HU/plugin.lang.php

    r5149 r5615  
    22global $lang;
    33
    4 $lang['HIPE_admin_title'] = 'NBC History IP Excluder';
    54$lang['HIPE_description'] = 'Ezzel a bővítménnyel kizárhat IP címeket, vagy IP tartományokat az előzményekből és a statisztikából. <br>A blokkolt rekordokat az IP *_history táblában az alábbi táblázat tartalmazza.';
    65$lang['HIPE_admin_section1'] = 'IP-k kizárása';
     
    2726
    2827$lang['IP_geolocalisation'] = 'Földrajzi hely';
     28
     29// --------- Starting below: New or revised $lang ---- from version 2.1.0
     30$lang['HIPE_version'] = ' - Változat: ';
     31// --------- End: New or revised $lang ---- from version 2.1.0
    2932?>
  • extensions/nbc_HistoryIPExcluder/trunk/language/it_IT/plugin.lang.php

    r5152 r5615  
    22global $lang;
    33
    4 $lang['HIPE_admin_title'] = 'NBC History IP Excluder';
    54$lang['HIPE_description'] = 'Questo plugin esclude gli indirizzi IP o intervalli d\indieizzi dalla cronologgia e dalle statistiche.<br>Attivandolo, gli indirizzi IP specifici della tabella sottostante non saranno più registrati nella tabella *.history de PWG.';
    65$lang['HIPE_admin_section1'] = 'Esclusione d\'IP';
     
    2726
    2827$lang['IP_geolocalisation'] = 'Geolocalizzazione';
     28
     29// --------- Starting below: New or revised $lang ---- from version 2.1.0
     30$lang['HIPE_version'] = ' - Versione: ';
     31// --------- End: New or revised $lang ---- from version 2.1.0
    2932?>
  • extensions/nbc_HistoryIPExcluder/trunk/main.inc.php

    r5162 r5615  
    22/*
    33Plugin Name: History IP Excluder
    4 Version: 2.0.1
     4Version: 2.1.0
    55Description: 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
     
    99*/
    1010
     11/*
     12:: HISTORY
     13
     141.0.x to 1.6.x          - Plugin only for PWG 1.7.x
     15
     162.0.0             - Compliance with Piwigo 2.0.x
     17
     182.1.0             - Compliance with Piwigo 2.1.x
     19                  - Multiple database support
     20                  - Removing "nbc_" prefix in plugin code and display in piwigo's plugin manager
     21                  - Displaying the good plugin name and current version in admin panel
     22
     23--------------------------------------------------------------------------------
     24*/
     25
    1126if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    1227
    1328if (!defined('HIPE_DIR')) define('HIPE_DIR' , basename(dirname(__FILE__)));
    1429if (!defined('HIPE_PATH')) define('HIPE_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
     30
     31include_once (HIPE_PATH.'/include/functions.inc.php');
    1532
    1633load_language('plugin.lang', HIPE_PATH);
     
    2542// |                      Getting plugin name                              |
    2643// +-----------------------------------------------------------------------+
    27   $plugin =  PluginNfo(HIPE_PATH);
     44  $plugin =  HIPE_infos(HIPE_PATH);
    2845  $name = $plugin['name'];
    2946 
     
    6986  }
    7087}
    71 
    72 
    73 /* Email sending debugger function */
    74 function 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 */
    84 function 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 
    12888?>
  • extensions/nbc_HistoryIPExcluder/trunk/maintain.inc.php

    r5162 r5615  
    2727WHERE param = "nbc_HistoryIPExcluder"
    2828;';
    29   $count = mysql_num_rows(pwg_query($query));
     29  $count = pwg_db_num_rows(pwg_query($query));
    3030 
    3131        if ($count == 1)
Note: See TracChangeset for help on using the changeset viewer.