Page 2 of 2

Re: Download statitics error with percentage No

Posted: 22 Jul 2012, 17:30
by Jan
Hi, not sure, if this can be done by the Chart Graphic. :idea:

Jan

Re: Download statitics error with percentage No

Posted: 15 Aug 2012, 19:14
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

Re: Download statitics error with percentage No

Posted: 16 Aug 2012, 23:27
by Jan
Ok, thank you very much, can you paste the code with location info here in the forum.

Thank you, Jan

Re: Download statitics error with percentage No

Posted: 27 Aug 2012, 19:59
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

Re: Download statitics error with percentage No

Posted: 25 Sep 2012, 21:11
by Jan
Hi, thank you very much for the code.

Jan

Re: Download statitics error with percentage No

Posted: 14 Mar 2013, 19:08
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

Re: Download statitics error with percentage No

Posted: 16 Mar 2013, 03:30
by Jan
Hi, I will try to implement it.

Jan