[Piwik-svn] r150 - in trunk: . modules modules/API modules/DataTable/Filter modules/DataTable/Renderer modules/LogStats modules/ViewDataTable plugins plugins/Actions plugins/ExamplePlugin plugins/Home plugins/UserSettings plugins/VisitorInterest

svnmaster at piwik.org svnmaster at piwik.org
Sun Jan 13 18:05:17 CET 2008


Author: matt
Date: 2008-01-13 18:05:17 +0100 (Sun, 13 Jan 2008)
New Revision: 150

Removed:
   trunk/plugins/Actions/Controller.php
   trunk/plugins/UserSettings/Controller.php
Modified:
   trunk/TODO
   trunk/modules/API/Proxy.php
   trunk/modules/DataTable.php
   trunk/modules/DataTable/Filter/Sort.php
   trunk/modules/DataTable/Renderer/Html.php
   trunk/modules/LogStats/javascriptTag.tpl
   trunk/modules/ViewDataTable/Html.php
   trunk/piwik.js
   trunk/plugins/ExamplePlugin/API.php
   trunk/plugins/Home/Controller.php
   trunk/plugins/Referers.php
   trunk/plugins/VisitorInterest.php
   trunk/plugins/VisitorInterest/API.php
Log:
- fixed a bug that caused piwik not record any visitor using IE6!
- added basic html rendering in the List API page that gives example
- javascript tag is now XHTML compliant :)
- fixed bug in the simple html renderer (more a proof of concept)
- completed the ExamplePlugin with new types
- fixed the wrong count of distinct campaigns
- in Visit_Interest "20 pages" now display "20+ pages" and "15 min" "+15 min"

Modified: trunk/TODO
===================================================================
--- trunk/TODO	2008-01-12 03:20:02 UTC (rev 149)
+++ trunk/TODO	2008-01-13 17:05:17 UTC (rev 150)
@@ -17,4 +17,4 @@
 
    
 test that archive always is OFF in prod
-distinct campaign number is wrong
\ No newline at end of file
+$GLOBALS['DEBUGPIWIK'] is false;
\ No newline at end of file

Modified: trunk/modules/API/Proxy.php
===================================================================
--- trunk/modules/API/Proxy.php	2008-01-12 03:20:02 UTC (rev 149)
+++ trunk/modules/API/Proxy.php	2008-01-13 17:05:17 UTC (rev 150)
@@ -203,7 +203,8 @@
 								<a target=_blank href='$exampleUrl&format=xml'>XML</a>, 
 								<a target=_blank href='$exampleUrl&format=PHP'>PHP</a>, 
 								<a target=_blank href='$exampleUrl&format=JSON'>Json</a>, 
-								<a target=_blank href='$exampleUrl&format=CSV'>Csv</a>
+								<a target=_blank href='$exampleUrl&format=Csv'>Csv</a>, 
+								<a target=_blank href='$exampleUrl&format=Html'>Basic html</a>
 								]";
 				}
 				else

Modified: trunk/modules/DataTable/Filter/Sort.php
===================================================================
--- trunk/modules/DataTable/Filter/Sort.php	2008-01-12 03:20:02 UTC (rev 149)
+++ trunk/modules/DataTable/Filter/Sort.php	2008-01-13 17:05:17 UTC (rev 150)
@@ -83,8 +83,11 @@
 		$value = $row->getColumn($this->columnToSort);
 		
 		if($value === false)
-		{
-			throw new Exception("The column to sort by '".$this->columnToSort."' is unknown in the row ". implode(array_keys($row->getColumns()), ','));
+		{
+			// we don't throw the exception because we sometimes export a DataTable without a column labelled '2'
+			// and when the generic filters tries to sort by default using this column 2, this shouldnt raise an exception...
+			//throw new Exception("The column to sort by '".$this->columnToSort."' is unknown in the row ". implode(array_keys($row->getColumns()), ','));
+			return;
 		}
 		
 		if( Piwik::isNumeric($value))

Modified: trunk/modules/DataTable/Renderer/Html.php
===================================================================
--- trunk/modules/DataTable/Renderer/Html.php	2008-01-12 03:20:02 UTC (rev 149)
+++ trunk/modules/DataTable/Renderer/Html.php	2008-01-13 17:05:17 UTC (rev 150)
@@ -27,7 +27,9 @@
 		}
 		
 		static $depth=0;
-		$i = 1;
+		$i = 1;
+		$someDetails = false;
+		$someIdSubTable = false;
 		
 		$tableStructure = array();
 		
@@ -37,7 +39,8 @@
 		 * ROW2 = col1 | col2 (no value but appears) | col3 | details | idSubTable
 		 * 		subtable here
 		 */
-		$allColumns = array();
+		$allColumns = array();
+//		echo $table;
 		foreach($table->getRows() as $row)
 		{
 			foreach($row->getColumns() as $column => $value)
@@ -52,18 +55,28 @@
 				if(is_string($value)) $value = "'$value'";
 				$details[] = "'$detail' => $value";
 			}
-			$details = implode("<br>", $details);
+			
+			if(count($details) != 0)
+			{
+				$someDetails = true;
+				$details = implode("<br>", $details);
+				$tableStructure[$i]['_details'] = $details;
+			}
+			
+			$idSubtable = $row->getIdSubDataTable();
+			if(!is_null($idSubtable))
+			{
+				$someIdSubTable = true;
+				$tableStructure[$i]['_idSubtable'] = $idSubtable;
+			}
 			
-			$tableStructure[$i]['_details'] = $details;
-			$tableStructure[$i]['_idSubtable'] = $row->getIdSubDataTable();
-			
 			if($row->getIdSubDataTable() !== null)
 			{
 				$depth++;
 				try{
-					$tableStructure[$i]['_subtable'] =  $this->renderTable( Piwik_DataTable_Manager::getInstance()->getTable($row->getIdSubDataTable()));
+					$tableStructure[$i]['_subtable']['html'] =  $this->renderTable( Piwik_DataTable_Manager::getInstance()->getTable($row->getIdSubDataTable()));
 				} catch(Exception $e) {
-					$tableStructure[$i]['_subtable'] = "-- Sub DataTable not loaded";
+					$tableStructure[$i]['_subtable']['html'] = "-- Sub DataTable not loaded";
 				}
 				$tableStructure[$i]['_subtable']['depth'] = $depth;
 				$depth--;
@@ -80,51 +93,63 @@
 			$allColumns = array_merge(array('label'=>true),$allColumns);
 		}
 		*/
-		$allColumns['_details'] = true;
-		$allColumns['_idSubtable'] = true;
-
-		$html = " <br><table border=1 width=70%>";
-		$html .= "<tr>";
-		foreach($allColumns as $name => $true)
-		{
-			$html .= "<td>$name</td>";
+		$allColumns['_details'] = $someDetails;
+		$allColumns['_idSubtable'] = $someIdSubTable;
+		$html = "\n";
+		$html .= "<table border=1 width=70%>";
+		$html .= "\n<tr>";
+		foreach($allColumns as $name => $toDisplay)
+		{
+			if($toDisplay !== false)
+			{
+				$html .= "\n\t<td><b>$name</b></td>";
+			}
 		}
 		$colspan = count($allColumns);
 		
 		foreach($tableStructure as $row)
 		{
-			$html .= "<tr>";
-			foreach($allColumns as $name => $true)
-			{
-				$value = "-";
-				if(isset($row[$name]))
+			$html .= "\n\n<tr>";
+			foreach($allColumns as $name => $toDisplay)
+			{
+				if($toDisplay !== false)
 				{
-					$value = $row[$name];
+					$value = "-";
+					if(isset($row[$name]))
+					{
+						$value = $row[$name];
+					}
+					
+					$html .= "\n\t<td>$value</td>";
 				}
-				
-				$html .= "<td>$value</td>";
 			}
 			$html .= "</tr>";
 			
-			$styles='<style>';
-			for($i=0;$i<11;$i++)
-			{
-				$padding=$i*2;
-				$styles.= "TD.l$i { padding-left:{$padding}em; } \n";
-			}
-			$styles.="</style>";
-			
 			if(isset($row['_subtable']))
-			{
-				$html .= "<tr><td class=l{$row['_subtable']['depth']} colspan=$colspan>{$row['_subtable']}</td></tr>";
+			{
+//				echo ".".$row['_subtable'];exit;
+				$html .= "<tr>
+						<td class=l{$row['_subtable']['depth']} colspan=$colspan>{$row['_subtable']['html']}</td></tr>";
 			}
 		}
-		$html .= "</table><br>";
-		
-		if($depth == 0)
-		{
-			$html = $styles . $html;
-		}
+		$html .= "\n\n</table>";
+		
+		// display styles if there is a subtable displayed
+		if($someIdSubTable)
+		{
+			$styles="\n\n<style>\n";
+			for($i=0;$i<11;$i++)
+			{
+				$padding=$i*2;
+				$styles.= "\t TD.l$i { padding-left:{$padding}em; } \n";
+			}
+			$styles.="</style>\n\n";
+			if($depth == 0)
+			{
+				$html = $styles . $html;
+			}
+		}
+//		echo "return={".$html."}";
 		return $html;
 	}	
 }

Modified: trunk/modules/DataTable.php
===================================================================
--- trunk/modules/DataTable.php	2008-01-12 03:20:02 UTC (rev 149)
+++ trunk/modules/DataTable.php	2008-01-13 17:05:17 UTC (rev 150)
@@ -281,14 +281,22 @@
 	{
 		return $this->currentId;
 	}
-		
-	/**
-	 * You should use loadFromArray for performance!
-	 */
-	public function addRowFromArray( $row )
-	{
-		$this->loadFromArray(array($row));
-	}
+		
+	/**
+	 * You should use loadFromArray for performance!
+	 */
+	public function addRowFromArray( $row )
+	{
+		$this->loadFromArray(array($row));
+	}
+	
+	/**
+	 * You should use loadFromSimpleArray for performance!
+	 */
+	public function addRowFromSimpleArray( $row )
+	{
+		$this->loadFromSimpleArray(array($row));
+	}
 	
 	/**
 	 * Returns the array of Piwik_DataTable_Row

Modified: trunk/modules/LogStats/javascriptTag.tpl
===================================================================
--- trunk/modules/LogStats/javascriptTag.tpl	2008-01-12 03:20:02 UTC (rev 149)
+++ trunk/modules/LogStats/javascriptTag.tpl	2008-01-13 17:05:17 UTC (rev 150)
@@ -9,6 +9,6 @@
 	piwik_log(piwik_action_name, piwik_idsite, piwik_url);
 //-->
 </script><object>
-<noscript><p>Web analytics<img src="piwik.php" style="border:0" /></p>
+<noscript><p>Web analytics<img src="{$piwikUrl}piwik.php" style="border:0" alt="piwik"/></p>
 </noscript></object></a>
 <!-- /Piwik -->
\ No newline at end of file

Modified: trunk/modules/ViewDataTable/Html.php
===================================================================
--- trunk/modules/ViewDataTable/Html.php	2008-01-12 03:20:02 UTC (rev 149)
+++ trunk/modules/ViewDataTable/Html.php	2008-01-13 17:05:17 UTC (rev 150)
@@ -43,7 +43,6 @@
 		// We get the PHP array converted from the DataTable
 		$phpArray = $this->getPHPArrayFromDataTable();
 		
-		
 		$view->arrayDataTable 	= $phpArray;
 		$view->method = $this->method;
 		

Modified: trunk/piwik.js
===================================================================
--- trunk/piwik.js	2008-01-12 03:20:02 UTC (rev 149)
+++ trunk/piwik.js	2008-01-13 17:05:17 UTC (rev 150)
@@ -1,107 +1,98 @@
-//-- Web analytics by Piwik -- http://piwik.org
-//-- Copyleft 2007, All rights reversed.
-
-var _pk_use_title_as_name = 0;
-
-//-- Beginning script
-function _pk_plug_normal(_pk_pl) {
-	if (_pk_tm.indexOf(_pk_pl) != -1 && (navigator.mimeTypes[_pk_pl].enabledPlugin != null)) 
-		return '1';
-	return '0';
-}
-
-function _pk_plug_ie(_pk_pl){
-	_pk_find = false;
-	document.write('<SCR' + 'IPT LANGUAGE=VBScript>\n on error resume next \n _pk_find = IsObject(CreateObject("' + _pk_pl + '")) </SCR' + 'IPT>\n');
-	if (_pk_find) return '1';
-	return '0';
-}
-
-var _pk_jav = '0'; if(navigator.javaEnabled()) _pk_jav='1';
-var _pk_agent = navigator.userAgent.toLowerCase();
-var _pk_moz = (navigator.appName.indexOf("Netscape") != -1);
-var _pk_ie = (_pk_agent.indexOf("msie") != -1);
-var _pk_win = ((_pk_agent.indexOf("win") != -1) || (_pk_agent.indexOf("32bit") != -1));
-var _pk_cookie = (navigator.cookieEnabled)? '1' : '0';
-if((typeof (navigator.cookieEnabled) == "undefined") && (_pk_cookie == '0')) {
-	document.cookie="_pk_testcookie"
-	_pk_cookie=(document.cookie.indexOf("_pk_testcookie")!=-1)? '1' : '0';
-}
-
-var _pk_dir='0',_pk_fla='0',_pk_pdf='0',_pk_qt = '0',_pk_rea = '0',_pk_wma='0'; 
-if (_pk_win && _pk_ie){
-	_pk_dir = _pk_plug_ie("SWCtl.SWCtl.1");
-	_pk_fla = _pk_plug_ie("ShockwaveFlash.ShockwaveFlash.1");
-	if (_pk_plug_ie("PDF.PdfCtrl.1") == '1' || _pk_plug_ie('PDF.PdfCtrl.5') == '1' || _pk_plug_ie('PDF.PdfCtrl.6') == '1') 
-		_pk_pdf = '1';
-	_pk_qt = _pk_plug_ie("Quicktime.Quicktime"); // Old : "QuickTimeCheckObject.QuickTimeCheck.1"
-	_pk_rea = _pk_plug_ie("rmocx.RealPlayer G2 Control.1");
-	_pk_wma = _pk_plug_ie("wmplayer.ocx"); // Old : "MediaPlayer.MediaPlayer.1"
-} else {
-	var _pk_tm = '';
-	for (var i=0; i < navigator.mimeTypes.length; i++)
-		_pk_tm += navigator.mimeTypes[i].type.toLowerCase();
-	_pk_dir = _pk_plug_normal("application/x-director");
-	_pk_fla = _pk_plug_normal("application/x-shockwave-flash");
-	_pk_pdf = _pk_plug_normal("application/pdf");
-	_pk_qt  = _pk_plug_normal("video/quicktime");
-	_pk_rea = _pk_plug_normal("audio/x-pn-realaudio-plugin");
-	_pk_wma = _pk_plug_normal("application/x-mplayer2");
-}
-	
-var _pk_rtu = '';
-try {
-	_pk_rtu = top.document.referrer;
-} catch(e1) {
-	if(parent){ 
-		try{ _pk_rtu = parent.document.referrer; } catch(e2) { _pk_rtu=''; }
-	}
-}
-if(_pk_rtu == '') {
-	_pk_rtu = document.referrer;
-}
-
-function _pk_escape(_pk_str){
-	if(typeof(encodeURIComponent) == 'function') {
-		return encodeURIComponent(_pk_str);
-	} else {
-		return escape(_pk_str);
-	}
-}
-var _pk_title = '';
-if (document.title && document.title!="") _pk_title = _pk_escape(document.title);
-
-var _pk_called;
-
-function _pk_getUrlLog( _pk_action_name, _pk_site, _pk_pkurl )
-{
-	var _pk_url = document.location.href;
-	var _pk_da = new Date();
-	var _pk_src = _pk_pkurl
-		+'?url='+_pk_escape(document.location.href)
-		+'&action_name='+_pk_escape(_pk_action_name)
-		+'&idsite='+_pk_site
-		+'&res='+screen.width+'x'+screen.height
-		+'&col='+screen.colorDepth
-		+'&h='+_pk_da.getHours()+'&m='+_pk_da.getMinutes()+'&s='+_pk_da.getSeconds()
-		+'&fla='+_pk_fla
-		+'&dir='+_pk_dir
-		+'&qt='+_pk_qt
-		+'&realp='+_pk_rea
-		+'&pdf='+_pk_pdf
-		+'&wma='+_pk_wma
-		+'&java='+_pk_jav
-		+'&cookie='+_pk_cookie
-		+'&title='+_pk_title
-		+'&urlref='+_pk_escape(_pk_rtu);
-	return _pk_src;
-}
-
-function piwik_log( _pk_action_name, _pk_site, _pk_pkurl )
-{
-	if(_pk_called && (!_pk_action_name || _pk_action_name=="")) return;
-	var _pk_src = _pk_getUrlLog(_pk_action_name, _pk_site, _pk_pkurl );
-	document.writeln('<img src="'+_pk_src+'" alt="Piwik" style="border:0" />');
-	if(!_pk_action_name || _pk_action_name=="") _pk_called=1;
-}
-
+// Web analytics by Piwik - http://piwik.org
+// Copyleft 2007, All rights reversed.
+var _pk_use_title_as_name = 0;
+
+// Beginning script
+function _pk_plug_normal(_pk_pl) {
+	if (_pk_tm.indexOf(_pk_pl) != -1 && (navigator.mimeTypes[_pk_pl].enabledPlugin != null)) 
+		return '1';
+	return '0';
+}
+
+function _pk_plug_ie(_pk_pl)
+{
+	pk_found = false;
+	document.write('<SCR' + 'IPT LANGUAGE=VBScript>\n on error resume next \n pk_found = IsObject(CreateObject("' + _pk_pl + '")) </SCR' + 'IPT>\n');
+	if (pk_found) return '1';
+	return '0';
+}
+
+var _pk_jav = '0'; if(navigator.javaEnabled()) _pk_jav='1';
+var _pk_agent = navigator.userAgent.toLowerCase();
+var _pk_moz = (navigator.appName.indexOf("Netscape") != -1);
+var _pk_ie = (_pk_agent.indexOf("msie") != -1);
+var _pk_win = ((_pk_agent.indexOf("win") != -1) || (_pk_agent.indexOf("32bit") != -1));
+var _pk_cookie = (navigator.cookieEnabled)? '1' : '0';
+if((typeof (navigator.cookieEnabled) == "undefined") && (_pk_cookie == '0')) {
+	document.cookie="_pk_testcookie"
+	_pk_cookie=(document.cookie.indexOf("_pk_testcookie")!=-1)? '1' : '0';
+}
+
+var _pk_dir='0',_pk_fla='0',_pk_pdf='0',_pk_qt = '0',_pk_rea = '0',_pk_wma='0'; 
+if (_pk_win && _pk_ie){
+	_pk_dir = _pk_plug_ie("SWCtl.SWCtl.1");
+	_pk_fla = _pk_plug_ie("ShockwaveFlash.ShockwaveFlash.1");
+	if (_pk_plug_ie("PDF.PdfCtrl.1") == '1' || _pk_plug_ie('PDF.PdfCtrl.5') == '1' || _pk_plug_ie('PDF.PdfCtrl.6') == '1') _pk_pdf = '1';
+	_pk_qt = _pk_plug_ie("Quicktime.Quicktime"); // Old : "QuickTimeCheckObject.QuickTimeCheck.1"
+	_pk_rea = _pk_plug_ie("rmocx.RealPlayer G2 Control.1");
+	_pk_wma = _pk_plug_ie("wmplayer.ocx"); // Old : "MediaPlayer.MediaPlayer.1"
+} else {
+	var _pk_tm = '';
+	for (var i=0; i < navigator.mimeTypes.length; i++)
+		_pk_tm += navigator.mimeTypes[i].type.toLowerCase();
+	_pk_dir = _pk_plug_normal("application/x-director");
+	_pk_fla = _pk_plug_normal("application/x-shockwave-flash");
+	_pk_pdf = _pk_plug_normal("application/pdf");
+	_pk_qt  = _pk_plug_normal("video/quicktime");
+	_pk_rea = _pk_plug_normal("audio/x-pn-realaudio-plugin");
+	_pk_wma = _pk_plug_normal("application/x-mplayer2");
+}
+	
+var _pk_rtu = '';
+try {
+	_pk_rtu = top.document.referrer;
+} catch(e1) {
+	if(parent){ 
+		try{ _pk_rtu = parent.document.referrer; } catch(e2) { _pk_rtu=''; }
+	}
+}
+if(_pk_rtu == '') {
+	_pk_rtu = document.referrer;
+}
+
+function _pk_escape(_pk_str){
+	if(typeof(encodeURIComponent) == 'function') {
+		return encodeURIComponent(_pk_str);
+	} else {
+		return escape(_pk_str);
+	}
+}
+var _pk_title = '';
+if (document.title && document.title!="") _pk_title = _pk_escape(document.title);
+
+var _pk_called;
+
+function _pk_getUrlLog( _pk_action_name, _pk_site, _pk_pkurl )
+{
+	var _pk_url = document.location.href;
+	var _pk_da = new Date();
+	var _pk_src = _pk_pkurl
+		+'?url='+_pk_escape(document.location.href)
+		+'&action_name='+_pk_escape(_pk_action_name)
+		+'&idsite='+_pk_site
+		+'&res='+screen.width+'x'+screen.height	+'&col='+screen.colorDepth
+		+'&h='+_pk_da.getHours()+'&m='+_pk_da.getMinutes()+'&s='+_pk_da.getSeconds()
+		+'&fla='+_pk_fla+'&dir='+_pk_dir+'&qt='+_pk_qt+'&realp='+_pk_rea+'&pdf='+_pk_pdf
+		+'&wma='+_pk_wma+'&java='+_pk_jav+'&cookie='+_pk_cookie
+		+'&title='+_pk_title
+		+'&urlref='+_pk_escape(_pk_rtu);
+	return _pk_src;
+}
+
+function piwik_log( _pk_action_name, _pk_site, _pk_pkurl )
+{
+	if(_pk_called && (!_pk_action_name || _pk_action_name=="")) return;
+	var _pk_src = _pk_getUrlLog(_pk_action_name, _pk_site, _pk_pkurl );
+	document.writeln('<img src="'+_pk_src+'" alt="Piwik" style="border:0" />');
+	if(!_pk_action_name || _pk_action_name=="") _pk_called=1;
+}
\ No newline at end of file

Deleted: trunk/plugins/Actions/Controller.php
===================================================================
--- trunk/plugins/Actions/Controller.php	2008-01-12 03:20:02 UTC (rev 149)
+++ trunk/plugins/Actions/Controller.php	2008-01-13 17:05:17 UTC (rev 150)
@@ -1,23 +0,0 @@
-<?php
-
-require_once "API/Request.php";
-require_once "View/DataTable.php";
-class Piwik_Actions_Controller extends Piwik_Controller
-{	
-	function index( )
-	{
-		$dataTableActions = $this->getActions( true );
-		echo $dataTableActions;
-	}
-	function getActions($fetch = false)
-	{
-		$view = new Piwik_ViewDataTable( __FUNCTION__, 'Actions.getActions' );
-		$view->disableSearchBox();
-		$view->disableSort();
-		$view->disableOffsetInformation();
-		
-		$view->setLimit( 10 );
-		
-		return $this->renderView($view, $fetch);
-	}
-}

Modified: trunk/plugins/ExamplePlugin/API.php
===================================================================
--- trunk/plugins/ExamplePlugin/API.php	2008-01-12 03:20:02 UTC (rev 149)
+++ trunk/plugins/ExamplePlugin/API.php	2008-01-13 17:05:17 UTC (rev 150)
@@ -41,6 +41,22 @@
 	public function getNull()
 	{
 		return null;
+	}
+	public function getDescriptionArray()
+	{
+		return array('piwik','open source','web analytics','free');
+	}
+	public function getCompetitionDatatable()
+	{
+		$dataTable = new Piwik_DataTable();
+		
+		$row1 = new Piwik_DataTable_Row;
+		$row1->setColumns( array('name' => 'piwik', 'license' => 'GPL'));
+		$dataTable->addRow($row1);
+		
+		$dataTable->addRowFromSimpleArray( array('name' => 'google analytics', 'license' => 'commercial')  );
+		
+		return $dataTable;
 	}
 	
 	public function getMoreInformationAnswerToLife()

Modified: trunk/plugins/Home/Controller.php
===================================================================
--- trunk/plugins/Home/Controller.php	2008-01-12 03:20:02 UTC (rev 149)
+++ trunk/plugins/Home/Controller.php	2008-01-13 17:05:17 UTC (rev 150)
@@ -154,7 +154,7 @@
 		$view->disableSort();
 		$view->disableOffsetInformation();
 		
-		$view->setColumnsToDisplay( array(0,1) );
+		$view->setColumnsToDisplay( array(0,1,2) );
 		$view->setLimit( 100 );
 		
 		// computing minimum value to exclude

Modified: trunk/plugins/Referers.php
===================================================================
--- trunk/plugins/Referers.php	2008-01-12 03:20:02 UTC (rev 149)
+++ trunk/plugins/Referers.php	2008-01-13 17:05:17 UTC (rev 150)
@@ -253,8 +253,10 @@
 		
 		
 		$numberOfDistinctSearchEngines = count($keywordBySearchEngine);
-		$numberOfDistinctKeywords = count($searchEngineByKeyword);
-		$numberOfDistinctCampaigns = count($keywordByCampaign);
+		$numberOfDistinctKeywords = count($searchEngineByKeyword);
+		
+//		var_dump($interestByCampaign);exit;
+		$numberOfDistinctCampaigns = count($interestByCampaign); //TODO bug here
 		$numberOfDistinctWebsites = count($interestByWebsite[Piwik_Common::REFERER_TYPE_WEBSITE]);
 		$numberOfDistinctWebsitesUrls = count($distinctUrls[Piwik_Common::REFERER_TYPE_WEBSITE]);
 		$numberOfDistinctPartners = count($interestByWebsite[Piwik_Common::REFERER_TYPE_PARTNER]);

Deleted: trunk/plugins/UserSettings/Controller.php
===================================================================
--- trunk/plugins/UserSettings/Controller.php	2008-01-12 03:20:02 UTC (rev 149)
+++ trunk/plugins/UserSettings/Controller.php	2008-01-13 17:05:17 UTC (rev 150)
@@ -1,5 +0,0 @@
-<?php
-
-class Piwik_UserSettings_Controller extends Piwik_Controller
-{	
-}
\ No newline at end of file

Modified: trunk/plugins/VisitorInterest/API.php
===================================================================
--- trunk/plugins/VisitorInterest/API.php	2008-01-12 03:20:02 UTC (rev 149)
+++ trunk/plugins/VisitorInterest/API.php	2008-01-13 17:05:17 UTC (rev 150)
@@ -67,12 +67,12 @@
 	else
 	{
 		$time = intval($label) / 60;
-		return '+'.$time.' min';
+		return urlencode('+').$time.' min';
 	}
 }
 
 function Piwik_getPageGapLabel($label)
-{ 
+{
 	$return = false;
 	if(($pos = strpos($label,'-')) !== false)
 	{
@@ -92,6 +92,7 @@
 	if($return == 1)
 	{
 		return $return . " page";
-	}
+	}
+	
 	return $return . " pages";
 }

Modified: trunk/plugins/VisitorInterest.php
===================================================================
--- trunk/plugins/VisitorInterest.php	2008-01-12 03:20:02 UTC (rev 149)
+++ trunk/plugins/VisitorInterest.php	2008-01-13 17:05:17 UTC (rev 150)
@@ -107,8 +107,9 @@
 			}
 			else
 			{
-				$minGap = $gap[0];
-				$gapName = "'$minGap+'";
+				$minGap = $gap[0];
+				$plusEncoded = urlencode('+');
+				$gapName = "'".$minGap.$plusEncoded."'";
 				$select[] = "sum(case when visit_total_actions > $minGap then 1 else 0 end) as $gapName ";
 			}
 		}		



More information about the Piwik-svn mailing list