Changeset 15342


Ignore:
Timestamp:
May 27, 2012, 10:09:14 AM (8 years ago)
Author:
grum
Message:

feature:2636 - Compatibility with Piwigo 2.4

Location:
extensions/AStat
Files:
1 added
1 deleted
4 edited

Legend:

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

    r10614 r15342  
    1 {combine_script id="jquery.ui" path="themes/default/js/ui/minified/jquery.ui.core.min.js"}
    2 {combine_script id="jquery.ui.datepicker" path="themes/default/js/ui/minified/jquery.ui.datepicker.min.js"}
     1{*
     2{combine_script id="jquery.ui" path="themes/default/js/ui/minified/jquery.ui.core.js"}
     3{combine_script id="jquery.ui.datepicker" path="themes/default/js/ui/minified/jquery.ui.datepicker.js"}
    34{assign var="datepicker_language" value="themes/default/js/ui/minified/i18n/jquery.ui.datepicker-"|@cat:$lang_info.code|@cat:".js"}
     5*}
    46
    57{if "PHPWG_ROOT_PATH"|@constant|@cat:$datepicker_language|@file_exists}
  • extensions/AStat/astat_aip.class.inc.php

    r10264 r15342  
    4141    $this->tabsheet->add('stats_by_period',
    4242                          l10n('AStat_by_period'),
    43                           $this->getAdminLink().'&fAStat_tabsheet=stats_by_period');
     43                          $this->getAdminLink().'-stats_by_period');
    4444    $this->tabsheet->add('stats_by_ip',
    4545                          l10n('AStat_by_ip'),
    46                           $this->getAdminLink().'&fAStat_tabsheet=stats_by_ip');
     46                          $this->getAdminLink().'-stats_by_ip');
    4747    $this->tabsheet->add('stats_by_category',
    4848                          l10n('AStat_by_category'),
    49                           $this->getAdminLink().'&fAStat_tabsheet=stats_by_category');
     49                          $this->getAdminLink().'-stats_by_category');
    5050    $this->tabsheet->add('stats_by_image',
    5151                          l10n('AStat_by_image'),
    52                           $this->getAdminLink().'&fAStat_tabsheet=stats_by_image');
     52                          $this->getAdminLink().'-stats_by_image');
    5353    $this->tabsheet->add('config',
    5454                          l10n('AStat_config'),
    55                           $this->getAdminLink().'&fAStat_tabsheet=config');
     55                          $this->getAdminLink().'-config');
    5656    $this->tabsheet->add('tools',
    5757                          l10n('AStat_tools'),
    58                           $this->getAdminLink().'&fAStat_tabsheet=tools');
     58                          $this->getAdminLink().'-tools');
    5959
    6060  }
     
    100100    }
    101101
    102     if($_REQUEST['fAStat_tabsheet']=='stats_by_period')
     102    if($_GET['tab']=='stats_by_period')
    103103    {
    104104      $this->display_stats_by_period(
     
    111111      );
    112112    }
    113     elseif($_REQUEST['fAStat_tabsheet']=='stats_by_ip')
     113    elseif($_GET['tab']=='stats_by_ip')
    114114    {
    115115      if(isset($_REQUEST['fAStat_IP_BL']))
     
    129129      );
    130130    }
    131     elseif($_REQUEST['fAStat_tabsheet']=='stats_by_category')
     131    elseif($_GET['tab']=='stats_by_category')
    132132    {
    133133      $this->display_stats_by_category(
     
    143143      );
    144144    }
    145     elseif($_REQUEST['fAStat_tabsheet']=='stats_by_image')
     145    elseif($_GET['tab']=='stats_by_image')
    146146    {
    147147      $this->display_stats_by_image(
     
    158158      );
    159159    }
    160     elseif($_REQUEST['fAStat_tabsheet']=='config')
     160    elseif($_GET['tab']=='config')
    161161    {
    162162      $this->display_config();
    163163    }
    164     elseif($_REQUEST['fAStat_tabsheet']=='tools')
     164    elseif($_GET['tab']=='tools')
    165165    {
    166166      $this->display_tools();
    167167    }
    168168
    169     $this->tabsheet->select($_REQUEST['fAStat_tabsheet']);
     169    $this->tabsheet->select($_GET['tab']);
    170170    $this->tabsheet->assign();
    171171    $selected_tab=$this->tabsheet->get_selected();
     
    173173
    174174    $template_plugin["ASTAT_VERSION"] = "<i>AStat</i> ".l10n('AStat_version').ASTAT_VERSION;
    175     $template_plugin["ASTAT_PAGE"] = $_REQUEST['fAStat_tabsheet'];
     175    $template_plugin["ASTAT_PAGE"] = $_GET['tab'];
    176176
    177177    $template->assign('plugin', $template_plugin);
     
    217217
    218218    //initialise $REQUEST values if not defined
    219     if(!array_key_exists('fAStat_tabsheet', $_REQUEST))
    220     {
    221       $_REQUEST['fAStat_tabsheet']='stats_by_period';
     219    if(!array_key_exists('tab', $_GET))
     220    {
     221      $_GET['tab']='stats_by_period';
    222222    }
    223223    if(!array_key_exists('fAStat_defper', $_REQUEST))
     
    254254    }
    255255
    256     if(($_REQUEST['fAStat_tabsheet']=='stats_by_period')&&($_REQUEST['fAStat_defper']=='Y'))
     256    if(($_GET['tab']=='stats_by_period')&&($_REQUEST['fAStat_defper']=='Y'))
    257257    {
    258258      if($this->config['AStat_default_period']!='global')
     
    584584    if($show_thumb=='true')
    585585    {
    586       $sql_thumb = ', '.IMAGES_TABLE.'.path as ThumbPath, '.IMAGES_TABLE.'.file as ThumbFile, '.IMAGES_TABLE.'.tn_ext as Extension';
     586      $sql_thumb = ', '.IMAGES_TABLE.'.path as ImgPath, '.IMAGES_TABLE.'.file as ThumbFile, '.IMAGES_TABLE.'.id as ImgId';
    587587      $sql_fromthumb = "LEFT JOIN ".IMAGES_TABLE." ON ic2.representative_picture_id = ".IMAGES_TABLE.".id  ";
    588588    }
     
    686686        ".HISTORY_TABLE.".category_id as IdCat, count(".HISTORY_TABLE.".image_id) as NbVues,
    687687        MaxImg.somme, 100*(count(".HISTORY_TABLE.".image_id)/MaxImg.somme) as PctImg,
    688         ".IMAGES_TABLE.".path as ThumbPath, ".IMAGES_TABLE.".file as ThumbFile,
    689         MaxImg2.somme as NbVuesMax, ".IMAGES_TABLE.".tn_ext as Extension ";
     688        ".IMAGES_TABLE.".path as ImgPath, ".IMAGES_TABLE.".file as ThumbFile,
     689        MaxImg2.somme as NbVuesMax ";
    690690
    691691    $sql_from = " from ((".HISTORY_TABLE." LEFT JOIN ".IMAGES_TABLE." ON
     
    793793        "day" => $this->getAdminLink()."&amp;fAStat_defper=N&amp;fAStat_all=N&amp;fAStat_year=$year&amp;fAStat_month=$month&amp;fAStat_day=$day");
    794794
    795     $ip_links=array("all" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_ip",
    796         "year" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_ip&amp;fAStat_year=",
    797         "month" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_ip&amp;fAStat_year=$year&amp;fAStat_month=",
    798         "day" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_ip&amp;fAStat_year=$year&amp;fAStat_month=$month&amp;fAStat_day=");
    799 
    800     $cat_links=array("all" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_category",
    801         "year" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_category&amp;fAStat_year=",
    802         "month" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_category&amp;fAStat_year=$year&amp;fAStat_month=",
    803         "day" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_category&amp;fAStat_year=$year&amp;fAStat_month=$month&amp;fAStat_day=");
    804 
    805     $img_links=array("all" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_image",
    806         "year" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_image&amp;fAStat_year=",
    807         "month" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_image&amp;fAStat_year=$year&amp;fAStat_month=",
    808         "day" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_image&amp;fAStat_year=$year&amp;fAStat_month=$month&amp;fAStat_day=");
     795    $ip_links=array("all" => $this->getAdminLink()."-stats_by_ip",
     796        "year" => $this->getAdminLink()."-stats_by_ip&amp;fAStat_year=",
     797        "month" => $this->getAdminLink()."-stats_by_ip&amp;fAStat_year=$year&amp;fAStat_month=",
     798        "day" => $this->getAdminLink()."-stats_by_ip&amp;fAStat_year=$year&amp;fAStat_month=$month&amp;fAStat_day=");
     799
     800    $cat_links=array("all" => $this->getAdminLink()."-stats_by_category",
     801        "year" => $this->getAdminLink()."-stats_by_category&amp;fAStat_year=",
     802        "month" => $this->getAdminLink()."-stats_by_category&amp;fAStat_year=$year&amp;fAStat_month=",
     803        "day" => $this->getAdminLink()."-stats_by_category&amp;fAStat_year=$year&amp;fAStat_month=$month&amp;fAStat_day=");
     804
     805    $img_links=array("all" => $this->getAdminLink()."-stats_by_image",
     806        "year" => $this->getAdminLink()."-stats_by_image&amp;fAStat_year=",
     807        "month" => $this->getAdminLink()."-stats_by_image&amp;fAStat_year=$year&amp;fAStat_month=",
     808        "day" => $this->getAdminLink()."-stats_by_image&amp;fAStat_year=$year&amp;fAStat_month=$month&amp;fAStat_day=");
    809809
    810810
     
    976976        "day" => $this->getAdminLink()."&amp;fAStat_defper=N&amp;fAStat_all=N&amp;fAStat_year=$year&amp;fAStat_month=$month&amp;fAStat_day=$day");
    977977
    978     $ip_links=array("all" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_ip",
    979         "year" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_ip&amp;fAStat_year=$year",
    980         "month" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_ip&amp;fAStat_year=$year&amp;fAStat_month=$month",
    981         "day" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_ip&amp;fAStat_year=$year&amp;fAStat_month=$month&amp;fAStat_day=$day");
    982 
    983     $img_links=array("all" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_image",
    984         "year" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_image&amp;fAStat_year=$year",
    985         "month" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_image&amp;fAStat_year=$year&amp;fAStat_month=$month",
    986         "day" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_image&amp;fAStat_year=$year&amp;fAStat_month=$month&amp;fAStat_day=$day");
     978    $ip_links=array("all" => $this->getAdminLink()."-stats_by_ip",
     979        "year" => $this->getAdminLink()."-stats_by_ip&amp;fAStat_year=$year",
     980        "month" => $this->getAdminLink()."-stats_by_ip&amp;fAStat_year=$year&amp;fAStat_month=$month",
     981        "day" => $this->getAdminLink()."-stats_by_ip&amp;fAStat_year=$year&amp;fAStat_month=$month&amp;fAStat_day=$day");
     982
     983    $img_links=array("all" => $this->getAdminLink()."-stats_by_image",
     984        "year" => $this->getAdminLink()."-stats_by_image&amp;fAStat_year=$year",
     985        "month" => $this->getAdminLink()."-stats_by_image&amp;fAStat_year=$year&amp;fAStat_month=$month",
     986        "day" => $this->getAdminLink()."-stats_by_image&amp;fAStat_year=$year&amp;fAStat_month=$month&amp;fAStat_day=$day");
    987987
    988988
     
    11401140        "day" => $this->getAdminLink()."&amp;fAStat_defper=N&amp;fAStat_all=N&amp;fAStat_year=$year&amp;fAStat_month=$month&amp;fAStat_day=$day");
    11411141
    1142     $cat_links=array("all" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_category",
    1143         "year" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_category&amp;fAStat_year=$year",
    1144         "month" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_category&amp;fAStat_year=$year&amp;fAStat_month=$month",
    1145         "day" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_category&amp;fAStat_year=$year&amp;fAStat_month=$month&amp;fAStat_day=$day");
     1142    $cat_links=array("all" => $this->getAdminLink()."-stats_by_category",
     1143        "year" => $this->getAdminLink()."-stats_by_category&amp;fAStat_year=$year",
     1144        "month" => $this->getAdminLink()."-stats_by_category&amp;fAStat_year=$year&amp;fAStat_month=$month",
     1145        "day" => $this->getAdminLink()."-stats_by_category&amp;fAStat_year=$year&amp;fAStat_month=$month&amp;fAStat_day=$day");
    11461146
    11471147    /* make navigation links */
     
    12151215      if($showthumb=='true')
    12161216      {
    1217         $filethumb=$this->change_file_ext($stats[$i]["ThumbFile"], $stats[$i]["Extension"]);
    1218         $filethumb=str_replace($stats[$i]["ThumbFile"],"thumbnail/".$conf['prefix_thumbnail'].$filethumb,$stats[$i]["ThumbPath"]); }
     1217        $filethumb=DerivativeImage::thumb_url(array('id'=>$stats[$i]["ImgId"], 'path'=>$stats[$i]["ImgPath"]));
     1218      }
    12191219      else
    12201220      {
     
    12861286        "day" => $this->getAdminLink()."&amp;fAStat_defper=N&amp;fAStat_all=N&amp;fAStat_year=$year&amp;fAStat_month=$month&amp;fAStat_day=$day");
    12871287
    1288     $img_links=array("all" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_image",
    1289         "year" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_image&amp;fAStat_year=$year",
    1290         "month" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_image&amp;fAStat_year=$year&amp;fAStat_month=$month",
    1291         "day" => $this->getAdminLink()."&amp;fAStat_tabsheet=stats_by_image&amp;fAStat_year=$year&amp;fAStat_month=$month&amp;fAStat_day=$day");
     1288    $img_links=array("all" => $this->getAdminLink()."-stats_by_image",
     1289        "year" => $this->getAdminLink()."-stats_by_image&amp;fAStat_year=$year",
     1290        "month" => $this->getAdminLink()."-stats_by_image&amp;fAStat_year=$year&amp;fAStat_month=$month",
     1291        "day" => $this->getAdminLink()."-stats_by_image&amp;fAStat_year=$year&amp;fAStat_month=$month&amp;fAStat_day=$day");
    12921292
    12931293    /* navigation links */
     
    13571357      if($showthumb=='true')
    13581358      {
    1359         $filethumb=$this->change_file_ext($stats[$i]["ThumbFile"], $stats[$i]["Extension"]);
    1360         $filethumb=str_replace($stats[$i]["ThumbFile"],"thumbnail/".$conf['prefix_thumbnail'].$filethumb,$stats[$i]["ThumbPath"]);
     1359        $filethumb=DerivativeImage::thumb_url(array('id'=>$stats[$i]["ImgId"], 'path'=>$stats[$i]["ImgPath"]));
    13611360      }
    13621361      else
     
    23802379
    23812380  /*
    2382     change filename extension
    2383   */
    2384   private function change_file_ext($file, $newext)
    2385   {  //filename can be <filename.truc.jpeg> for example
    2386     $tmp = explode('.', $file);
    2387     if(count($tmp)>1) { $tmp[count($tmp)-1] = $newext; }
    2388     return implode('.', $tmp);
    2389   }
    2390 
    2391   /*
    23922381      format number $octets with unit
    23932382      $format = "A" : auto
  • extensions/AStat/astat_version.inc.php

    r10264 r15342  
    1515  if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    1616
    17   define('ASTAT_VERSION',  '2.3.0');
    18   define('ASTAT_VERSION2', '02.03.00');
    19   define('ASTAT_GPC_NEEDED', '3.5.0');
     17  define('ASTAT_VERSION',  '2.4.0');
     18  define('ASTAT_VERSION2', '02.04.00');
     19  define('ASTAT_GPC_NEEDED', '3.5.2');
    2020?>
  • extensions/AStat/main.inc.php

    r10264 r15342  
    6666|         |            |   . compatibility with piwigo 2.2
    6767|         |            |
    68 |         |            |
     68| 2.4.0   | 2011/04/10 | * mantis: bug 2636
     69|         |            |   . compatibility with piwigo 2.4
    6970|         |            |
    7071|         |            |
Note: See TracChangeset for help on using the changeset viewer.