Changeset 6699
- Timestamp:
- Jul 24, 2010, 11:24:09 AM (14 years ago)
- Location:
- extensions/AStat
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AStat/astat_aip.class.inc.php
r5546 r6699 569 569 $returned0 = array(); 570 570 571 $sql_select=" selectSQL_CALC_FOUND_ROWS ";572 573 $sql= "category_id, if(category_id > 0, ".CATEGORIES_TABLE.".name, section) asIdCat,574 count(".HISTORY_TABLE.".id) as NbPages, MaxPages.somme, 100*(count(".HISTORY_TABLE.".id)/MaxPages.somme) asPctPages,575 count(".HISTORY_TABLE.".image_id) as NbImg, MaxImg.somme, 100*(count(".HISTORY_TABLE.".image_id)/MaxImg.somme) as PctImg, ic2.nb_images as NbImgCat, (count(".HISTORY_TABLE.".image_id)/ic2.nb_images) as RatioImg, greatest(100*(count(".HISTORY_TABLE.".id)/MaxPages.somme), 100*(count(".HISTORY_TABLE.".image_id)/MaxImg.somme)) asMaxPct ";571 $sql_select="SELECT SQL_CALC_FOUND_ROWS "; 572 573 $sql= "category_id, IF(category_id > 0, ".CATEGORIES_TABLE.".name, section) AS IdCat, 574 COUNT(".HISTORY_TABLE.".id) AS NbPages, MaxPages.somme, 100*(count(".HISTORY_TABLE.".id)/MaxPages.somme) AS PctPages, 575 COUNT(".HISTORY_TABLE.".image_id) AS NbImg, MaxImg.somme, 100*(count(".HISTORY_TABLE.".image_id)/MaxImg.somme) AS PctImg, ic2.nb_images as NbImgCat, (COUNT(".HISTORY_TABLE.".image_id)/ic2.nb_images) AS RatioImg, greatest(100*(COUNT(".HISTORY_TABLE.".id)/MaxPages.somme), 100*(COUNT(".HISTORY_TABLE.".image_id)/MaxImg.somme)) AS MaxPct "; 576 576 577 577 if($show_thumb=='true') … … 586 586 } 587 587 588 $sql_from = " from(".HISTORY_TABLE." LEFT JOIN ".CATEGORIES_TABLE." ON ".CATEGORIES_TABLE.".id = ".HISTORY_TABLE.".category_id),589 ( select category_id as catid, count(image_id) asnb_images, representative_picture_id590 from".IMAGE_CATEGORY_TABLE.", ".CATEGORIES_TABLE."591 where ".CATEGORIES_TABLE.".id = ".IMAGE_CATEGORY_TABLE.".category_id group by category_id) asic2 ";588 $sql_from = " FROM (".HISTORY_TABLE." LEFT JOIN ".CATEGORIES_TABLE." ON ".CATEGORIES_TABLE.".id = ".HISTORY_TABLE.".category_id), 589 (SELECT category_id AS catid, COUNT(image_id) AS nb_images, representative_picture_id 590 FROM ".IMAGE_CATEGORY_TABLE.", ".CATEGORIES_TABLE." 591 WHERE ".CATEGORIES_TABLE.".id = ".IMAGE_CATEGORY_TABLE.".category_id group by category_id) AS ic2 "; 592 592 $sql_where = ""; 593 $sql_group=" group bycategory_id, section ";593 $sql_group=" GROUP BY category_id, section "; 594 594 $sql_group2=""; 595 $sql_order=" order by".$sortlist[$sortcat];596 $sql_limit=" limit".(($pagenumber-1)* $nbipperpage).", ".$nbipperpage;595 $sql_order=" ORDER BY ".$sortlist[$sortcat]; 596 $sql_limit=" LIMIT ".(($pagenumber-1)* $nbipperpage).", ".$nbipperpage; 597 597 598 598 if($day!="") 599 599 { 600 $sql_where=" where YEAR(date) = $year and MONTH(date) = $month andDAY(date)= $day ";600 $sql_where=" WHERE YEAR(date) = $year AND MONTH(date) = $month AND DAY(date)= $day "; 601 601 } 602 602 elseif($month!="") 603 603 { 604 $sql_where=" where YEAR(date) = $year andMONTH(date) = $month ";604 $sql_where=" WHERE YEAR(date) = $year AND MONTH(date) = $month "; 605 605 } 606 606 elseif($year!="") 607 607 { 608 $sql_where=" whereYEAR(date) = $year ";608 $sql_where=" WHERE YEAR(date) = $year "; 609 609 } 610 610 else { } … … 617 617 } 618 618 619 $sql_max=", ( select count(id) as somme from ".HISTORY_TABLE.$sql_where.$sql_group2.") asMaxPages,620 ( select count(image_id) as somme from ".HISTORY_TABLE.$sql_where.$sql_group2.") asMaxImg ";621 622 ($sql_where=="")?$sql_where=" where ":$sql_where.=" and";619 $sql_max=", (SELECT COUNT(id) AS somme FROM ".HISTORY_TABLE.$sql_where.$sql_group2.") AS MaxPages, 620 (SELECT COUNT(image_id) AS somme FROM ".HISTORY_TABLE.$sql_where.$sql_group2.") AS MaxImg "; 621 622 ($sql_where=="")?$sql_where=" WHERE ":$sql_where.=" AND "; 623 623 $sql_where .= " ic2.catid = ".HISTORY_TABLE.".category_id "; 624 624 625 625 if(($this->config['AStat_UseBlackList']!="false")&&($this->config['AStat_BlackListedIP']!="")) 626 626 { 627 ($this->config['AStat_UseBlackList']=="true")?$sql_where .= " NOT ":"";627 ($this->config['AStat_UseBlackList']=="true")?$sql_where .= " AND NOT ":""; 628 628 $sql_where .= $this->make_IP_where_clause($this->config['AStat_BlackListedIP']); 629 629 } … … 632 632 633 633 $result = pwg_query($sql); 634 $sql=" selectFOUND_ROWS()";634 $sql="SELECT FOUND_ROWS()"; 635 635 636 636 $i=0; -
extensions/AStat/astat_version.inc.php
r5801 r6699 15 15 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 16 16 17 define('ASTAT_VERSION', '2.2. 1');18 define('ASTAT_VERSION2', '02.02.0 1');17 define('ASTAT_VERSION', '2.2.2'); 18 define('ASTAT_VERSION2', '02.02.02'); 19 19 ?> -
extensions/AStat/main.inc.php
r5801 r6699 2 2 /* 3 3 Plugin Name: AStat.2 4 Version: 2.2. 14 Version: 2.2.2 5 5 Description: Statistiques avancées / Advanced statistics 6 6 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=172 … … 60 60 | | | . it_IT 61 61 | | | 62 | | |63 | | | 62 | 2.2.2 | 2010/07/24 | * mantis: bug 1774 63 | | | Stat by categories doesn't work when IP filter is activated 64 64 | | | 65 65 | | |
Note: See TracChangeset
for help on using the changeset viewer.