Jan
Download statitics error with percentage No
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Download statitics error with percentage No
Hi, not sure, if this can be done by the Chart Graphic. 
Jan
Jan
If you find Phoca extensions useful, please support the project
-
poawer
- Phoca Member

- Posts: 11
- Joined: 27 Jun 2012, 18:53
Re: Download statitics error with percentage No
Hello Jan,
I modified the code see http://imageshack.us/photo/my-images/7/ ... numbe.png/
Result see http://imageshack.us/photo/my-images/20 ... numbe.png/ I tested it with every possible graph: all ok
Able and willing to add it to the official release?
Thank you in advance
Wil Panneman
The Netherlands
www.poawer.nl
I modified the code see http://imageshack.us/photo/my-images/7/ ... numbe.png/
Result see http://imageshack.us/photo/my-images/20 ... numbe.png/ I tested it with every possible graph: all ok
Able and willing to add it to the official release?
Thank you in advance
Wil Panneman
The Netherlands
www.poawer.nl
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Download statitics error with percentage No
Ok, thank you very much, can you paste the code with location info here in the forum.
Thank you, Jan
Thank you, Jan
If you find Phoca extensions useful, please support the project
-
poawer
- Phoca Member

- Posts: 11
- Joined: 27 Jun 2012, 18:53
Re: Download statitics error with percentage No
Hello Jan,
In file mod_phocadownload_chart_statistics.php I added one row (create variable for number of downloads) and changed one row (added the number of downloads to the string (in same way as percentage)). Rows are identified by // WP....
The snippet starts at row 125
Kind regards,
Wil Panneman
In file mod_phocadownload_chart_statistics.php I added one row (create variable for number of downloads) and changed one row (added the number of downloads to the string (in same way as percentage)). Rows are identified by // WP....
The snippet starts at row 125
Code: Select all
if ($rightDisplay == 1) {
if ($sum > 0) {
$num = (int)$value->hits; // WP withnumber of downloads
$per = (int)$value->hits / (int)$sum * 100;
$per = round((float)$per,2);
if ($display_per == 1){
$chlArray[] = $value->title .'('.$per.'%)';
} else {
$chlArray[] = $value->title . '('.$num.')'; // WP added number
}
$chdArray[] = $per;
$chcoArray[]= $colors[$i];
} else {
$chlArray[] = $value->title;
$chdArray[] = 0;//$per;
$chcoArray[]= $colors[$i];
}
if ($i == 23) {
$i = 0;
}
$i++;
}
Wil Panneman
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Download statitics error with percentage No
Hi, thank you very much for the code.
Jan
Jan
If you find Phoca extensions useful, please support the project
-
hominid4
- Phoca Member

- Posts: 12
- Joined: 16 Nov 2009, 23:39
Re: Download statitics error with percentage No
Thanks Wil for the code, just what I was looking for!
Will the number of downloads featured be added in future Stats Modules versions?
Thanks again!,
Wesley
Will the number of downloads featured be added in future Stats Modules versions?
Thanks again!,
Wesley
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Download statitics error with percentage No
Hi, I will try to implement it.
Jan
Jan
If you find Phoca extensions useful, please support the project