Download statitics error with percentage No

Phoca Download - download manager
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48587
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Download statitics error with percentage No

Post by Jan »

Hi, not sure, if this can be done by the Chart Graphic. :idea:

Jan
If you find Phoca extensions useful, please support the project
poawer
Phoca Member
Phoca Member
Posts: 11
Joined: 27 Jun 2012, 18:53

Re: Download statitics error with percentage No

Post by poawer »

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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48587
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Download statitics error with percentage No

Post by Jan »

Ok, thank you very much, can you paste the code with location info here in the forum.

Thank you, Jan
If you find Phoca extensions useful, please support the project
poawer
Phoca Member
Phoca Member
Posts: 11
Joined: 27 Jun 2012, 18:53

Re: Download statitics error with percentage No

Post by poawer »

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

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++;
		}
Kind regards,

Wil Panneman
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48587
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Download statitics error with percentage No

Post by Jan »

Hi, thank you very much for the code.

Jan
If you find Phoca extensions useful, please support the project
hominid4
Phoca Member
Phoca Member
Posts: 12
Joined: 16 Nov 2009, 23:39

Re: Download statitics error with percentage No

Post by hominid4 »

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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48587
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Download statitics error with percentage No

Post by Jan »

Hi, I will try to implement it.

Jan
If you find Phoca extensions useful, please support the project
Post Reply