changed the unknown author handling in the code controller
This commit is contained in:
		@ -647,22 +647,19 @@ class Code extends Controller
 | 
			
		||||
		$history = $file['history'];
 | 
			
		||||
		$history_count = count($history);
 | 
			
		||||
 | 
			
		||||
			
 | 
			
		||||
		if ($type == 'commit-share-by-users')
 | 
			
		||||
		{
 | 
			
		||||
			$stats = array();
 | 
			
		||||
			for ($i = 0; $i < $history_count; $i++)
 | 
			
		||||
			{
 | 
			
		||||
				$h = $history[$i];
 | 
			
		||||
				if (array_key_exists ('author', $h))
 | 
			
		||||
				{
 | 
			
		||||
					$author = $h['author'];
 | 
			
		||||
				$author = (array_key_exists ('author', $h))? $h['author']: '?';
 | 
			
		||||
 | 
			
		||||
				if (array_key_exists ($author, $stats))
 | 
			
		||||
					$stats[$author]++;
 | 
			
		||||
				else 
 | 
			
		||||
					$stats[$author] = 1;
 | 
			
		||||
			}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			$this->load->library ('PHPGraphLibPie', array ('width' => 400, 'height' => 300), 'graph');
 | 
			
		||||
			$this->graph->addData($stats);
 | 
			
		||||
@ -677,15 +674,13 @@ class Code extends Controller
 | 
			
		||||
			for ($i = 0; $i < $history_count; $i++)
 | 
			
		||||
			{
 | 
			
		||||
				$h = $history[$i];
 | 
			
		||||
				if (array_key_exists ('author', $h))
 | 
			
		||||
				{
 | 
			
		||||
					$author = $h['author'];
 | 
			
		||||
				$author = (array_key_exists ('author', $h))? $h['author']: '?';
 | 
			
		||||
 | 
			
		||||
				if (array_key_exists ($author, $stats))
 | 
			
		||||
					$stats[$author]++;
 | 
			
		||||
				else 
 | 
			
		||||
					$stats[$author] = 1;
 | 
			
		||||
			}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			$this->load->library ('PHPGraphLib', array ('width' => 400, 'height' => 300), 'graph');
 | 
			
		||||
			$this->graph->addData($stats);
 | 
			
		||||
@ -696,7 +691,6 @@ class Code extends Controller
 | 
			
		||||
			$this->graph->setBars(TRUE);
 | 
			
		||||
			//$this->graph->setXValuesHorizontal(TRUE);
 | 
			
		||||
			$this->graph->createGraph();
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user