Changeset 5423 for extensions/AStat


Ignore:
Timestamp:
Mar 28, 2010, 6:55:48 PM (14 years ago)
Author:
grum
Message:

Update the plugin for compatibility with Piwigo 2.1 and fix some bugs
feature 1192, feature 1344

Location:
extensions/AStat
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • extensions/AStat/admin/astat_admin.tpl

    r3394 r5423  
    1 <div class="titrePage">
    2   <h2 style="position:absolute;right:0px;top:32px;height:auto;font-size:12px;font-weight:normal;">:: {$plugin.ASTAT_VERSION} ::</h2>
    3   <h2>{'AStat_title_page'|@translate} <span style="font-size:-1;font-weight:normal;">{$TABSHEET_TITLE}</span></h2>
    41
     2<h2 style="float:right;top:-24px;position:relative;height:auto;font-size:12px;font-weight:normal;">{$plugin.ASTAT_VERSION}</h2>
     3
     4
     5<div style="position:relative;top:-24px;clear:right;">
    56  {$tabsheet}
     7
     8  {if isset($datas)}
     9    <p>{$datas.ASTAT_NFO_STAT}</p>
     10
     11    <h3>{$datas.L_STAT_TITLE}</h3>
     12
     13    {if isset($f_AStat_catfilter_list_values) and count($f_AStat_catfilter_list_values)
     14           and isset($plugin.ASTAT_PAGE) and $plugin.ASTAT_PAGE != "config" and $plugin.ASTAT_PAGE != "tools"}
     15      <center>
     16        <form method="GET" action="{$plugin.ASTAT_LINK}" class="general">
     17
     18            {if isset($f_AStat_parameters) and count($f_AStat_parameters)}
     19              {foreach from=$f_AStat_parameters key=name item=data}
     20                <INPUT type="hidden" name="{$data.NAME}" value="{$data.VALUE}">
     21              {/foreach}
     22            {/if}
     23            <fieldset>
     24              <legend>{'AStat_catfilter_list'|@translate}</legend>
     25              <select name="fAStat_catfilter" onchange="this.form.submit();">
     26                {html_options values=$f_AStat_catfilter_list_values output=$f_AStat_catfilter_list_labels selected=$f_AStat_catfilter_selected}
     27              </select>
     28            </fieldset>
     29        </form>
     30      </center>
     31    {/if}
     32
     33  {/if}
     34
     35
    636</div>
    737
    8 {if isset($datas)}
    9   {$datas.ASTAT_NFO_STAT}
    10   <h3>{$datas.L_STAT_TITLE}</h3>
    1138
    12   {if isset($f_AStat_catfilter_list_values) and count($f_AStat_catfilter_list_values)
    13          and isset($plugin.ASTAT_PAGE) and $plugin.ASTAT_PAGE != "config" and $plugin.ASTAT_PAGE != "tools"}
    14     <center>
    15       <form method="GET" action="{$plugin.ASTAT_LINK}" class="general">
    1639
    17           {if isset($f_AStat_parameters) and count($f_AStat_parameters)}
    18             {foreach from=$f_AStat_parameters key=name item=data}
    19               <INPUT type="hidden" name="{$data.NAME}" value="{$data.VALUE}">
    20             {/foreach}
    21           {/if}
    22           <fieldset>
    23             <legend>{'AStat_catfilter_list'|@translate}</legend>
    24             <select name="fAStat_catfilter" onchange="this.form.submit();">
    25               {html_options values=$f_AStat_catfilter_list_values output=$f_AStat_catfilter_list_labels selected=$f_AStat_catfilter_selected}
    26             </select>
    27           </fieldset>
    28       </form>
    29     </center>
    30   {/if}
    3140
    32 {/if}
    3341
    3442{$ASTAT_BODY_PAGE}
  • extensions/AStat/admin/astat_tools.tpl

    r4269 r5423  
    1 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"}
    2 {known_script id="jquery.ui.datepicker" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.datepicker.packed.js"}
    3 {assign var="datepicker_language" value="template-common/lib/ui/i18n/ui.datepicker-"|@cat:$lang_info.code|@cat:".js"}
     1{known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
     2{known_script id="jquery.ui.datepicker" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.datepicker.packed.js"}
     3{assign var="datepicker_language" value="themes/default/js/ui/packed/i18n/ui.datepicker-"|@cat:$lang_info.code|@cat:".js"}
    44
    55{if "PHPWG_ROOT_PATH"|@constant|@cat:$datepicker_language|@file_exists}
     
    1919
    2020  if(($('#purge_history_confirm').attr('checked')&&$('#purge_history_type0').attr('checked')&&re.test($('#purge_history_date').val()))||
    21      ($('#purge_history_confirm').attr('checked')&&!('#purge_history_type0').attr('checked')))
     21     ($('#purge_history_confirm').attr('checked')&&!$('#purge_history_type0').attr('checked')))
    2222  {
    23     $('#purge_history_button').attr('disabled', true);
     23    $('#purge_history_button').attr('disabled', false);
    2424  }
    2525  else
    2626  {
    27     $('#purge_history_button').attr('disabled', false);
     27    $('#purge_history_button').attr('disabled', true);
    2828  }
    2929 }
  • extensions/AStat/astat_aim.class.inc.php

    r3707 r5423  
    171171    if($result)
    172172    {
    173       $row = mysql_fetch_array($result);
     173      $row = pwg_db_fetch_assoc($result);
    174174      $list=substr($row['Type'], 5, strlen($row['Type'])-6);
    175175      $returned[0]=explode(',', $list);
  • extensions/AStat/astat_aip.class.inc.php

    r3707 r5423  
    435435
    436436    $i=0;
    437     while ($row = mysql_fetch_array($result))
     437    while ($row = pwg_db_fetch_assoc($result))
    438438    {
    439439      if($year.$month.$day=="")
     
    534534
    535535    $i=0;
    536     while ($row = mysql_fetch_array($result))
     536    while ($row = pwg_db_fetch_assoc($result))
    537537    {
    538538      $returned0[$i] = $row; $i++;
     
    543543    if($result)
    544544    {
    545       $row = mysql_fetch_array($result); $returned[1] = $row[0];
     545      $row = pwg_db_fetch_row($result); $returned[1] = $row[0];
    546546    }
    547547    else
     
    638638
    639639    $i=0;
    640     while ($row = mysql_fetch_array($result))
     640    while ($row = pwg_db_fetch_assoc($result))
    641641    {
    642642      $returned0[$i] = $row; $i++;
     
    647647    if($result)
    648648    {
    649       $row = mysql_fetch_array($result); $returned[1] = $row[0];
     649      $row = pwg_db_fetch_row($result); $returned[1] = $row[0];
    650650    }
    651651    else
     
    738738
    739739    $i=0;
    740     while ($row = mysql_fetch_array($result))
     740    while ($row = pwg_db_fetch_assoc($result))
    741741    {
    742742      $returned0[$i] = $row; $i++;
     
    747747    if($result)
    748748    {
    749       $row = mysql_fetch_array($result); $returned[1] = $row[0];
     749      $row = pwg_db_fetch_row($result); $returned[1] = $row[0];
    750750    }
    751751    else
     
    11161116    $template->set_filename('body_page', dirname(__FILE__)."/admin/astat_by_category.tpl");
    11171117
     1118    $template_datas=array();
     1119    $template_datarows=array();
    11181120
    11191121    /* requete */
     
    19181920      {
    19191921        $returned[0]=0;
    1920         while ($row = mysql_fetch_array($result))
     1922        while ($row = pwg_db_fetch_row($result))
    19211923        {
    19221924          $returned[2][$returned[0]][0] = $row[0];
     
    19651967      {
    19661968        $returned[0]=0;
    1967         while ($row = mysql_fetch_array($result))
     1969        while ($row = pwg_db_fetch_row($result))
    19681970        {
    19691971          $returned[2][$returned[0]][0] = $row[0];
     
    20172019      {
    20182020        $returned[0]=0;
    2019         while ($row = mysql_fetch_array($result))
     2021        while ($row = pwg_db_fetch_row($result))
    20202022        {
    20212023          $returned[2][$returned[0]][0] = $row[0];
     
    20622064    if($result)
    20632065    {
    2064       $row = mysql_fetch_array($result);
     2066      $row = pwg_db_fetch_row($result);
    20652067      if(is_array($row))
    20662068      {
     
    20702072        if($result)
    20712073        {
    2072           $row2=mysql_fetch_array($result);
     2074          $row2=pwg_db_fetch_assoc($result);
    20732075          array_push($returned, $row2['Data_length'], $row2['Index_length']);
    20742076        }
     
    21242126    if($result)
    21252127    {
    2126       $row=mysql_fetch_array($result);
     2128      $row=pwg_db_fetch_row($result);
    21272129      return($row[0]);
    21282130    }
     
    21362138    if($result)
    21372139    {
    2138       $row=mysql_fetch_array($result);
     2140      $row=pwg_db_fetch_row($result);
    21392141      return($row[0]);
    21402142    }
     
    21632165      if($result)
    21642166      {
    2165         $row=mysql_fetch_array($result);
     2167        $row=pwg_db_fetch_row($result);
    21662168        $returned[0]=$row[0];
    21672169      }
     
    21842186    if($result)
    21852187    {
    2186       if(mysql_num_rows($result)==1)
     2188      if(pwg_db_num_rows($result)==1)
    21872189      {
    21882190        return(true);
     
    22222224      if($result)
    22232225      {
    2224         if(mysql_num_rows($result)>0)
    2225         {
    2226           $row=mysql_fetch_row($result);
     2226        if(pwg_db_num_rows($result)>0)
     2227        {
     2228          $row=pwg_db_fetch_row($result);
    22272229          $returned[0]=true;
    22282230          $returned[1]=$row[0];
     
    22962298    if($result)
    22972299    {
    2298       while ($row = mysql_fetch_array($result))
     2300      while ($row = pwg_db_fetch_assoc($result))
    22992301      {
    23002302        $text=str_repeat('&nbsp;&nbsp;', substr_count($row['global_rank'], '.'));
     
    23392341    if($result)
    23402342    {
    2341       while ($row = mysql_fetch_row($result))
     2343      while ($row = pwg_db_fetch_row($result))
    23422344      {
    23432345        $returned[]=$row[0];
     
    24732475    if($result)
    24742476    {
    2475       while($row=mysql_fetch_array($result))
     2477      while($row=pwg_db_fetch_assoc($result))
    24762478      {
    24772479        $list.="<option value='".$row['IP']."'>".$row['IP'].str_repeat("&nbsp;", 15-strlen($row['IP']))."&nbsp;&nbsp;&nbsp;&nbsp;(".$row['NbEvents'].")</option>";
  • extensions/AStat/main.inc.php

    r4269 r5423  
    22/*
    33Plugin Name: AStat.2
    4 Version: 2.1.1
     4Version: 2.2.0
    55Description: Statistiques avancées / Advanced statistics
    66Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=172
     
    4242| 2.1.1   | 2009/11/15 | * bug on tools (cf. bug #1242 in mantis)
    4343|         |            |   it was impossible to purge items in history due to an invalid regexp in the javascript
     44| 2.2.0   | 2010/03/28 | * release for compatibility with Piwigo 2.1
     45|         |            | * mantis: bug 1192
     46|         |            |   Constant already defined when deactivating the plugin
     47|         |            | * mantis: bug 1344
     48|         |            |   In tools, it's allowed to do purge only if checkbox is not checked
     49|         |            |
     50|         |            |
     51|         |            |
     52|         |            |
     53|         |            |
    4454|         |            |
    4555|         |            |
     
    7181define('ASTAT_PATH' , PHPWG_PLUGINS_PATH . ASTAT_DIR . '/');
    7282
    73 define('ASTAT_VERSION' , '2.1.1'); // => ne pas oublier la version dans l'entête !!
     83define('ASTAT_VERSION' , '2.2.0'); // => ne pas oublier la version dans l'entête !!
    7484
    7585global $prefixeTable;
  • extensions/AStat/maintain.inc.php

    r3394 r5423  
    1212  --------------------------------------------------------------------------- */
    1313
    14 if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
     14if(!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
    1515
    16 define('ASTAT_DIR' , basename(dirname(__FILE__)));
    17 define('ASTAT_PATH' , PHPWG_PLUGINS_PATH . ASTAT_DIR . '/');
     16if(!defined('ASTAT_DIR')) define('ASTAT_DIR' , basename(dirname(__FILE__)));
     17if(!defined('ASTAT_PATH')) define('ASTAT_PATH' , PHPWG_PLUGINS_PATH . ASTAT_DIR . '/');
    1818
    1919//ini_set('error_reporting', E_ALL);
     
    4646load_language('plugin.lang', ASTAT_PATH);
    4747
    48 function plugin_install($plugin_id, $plugin_version, &$errors) 
     48function plugin_install($plugin_id, $plugin_version, &$errors)
    4949{
    5050  global $prefixeTable, $gpc_installed;
Note: See TracChangeset for help on using the changeset viewer.