[Piwik-svn] r489 - trunk/plugins/ExamplePlugin

svnmaster at piwik.org svnmaster at piwik.org
Wed May 21 00:05:19 CEST 2008


Author: matt
Date: 2008-05-21 00:05:18 +0200 (Wed, 21 May 2008)
New Revision: 489

Modified:
   trunk/plugins/ExamplePlugin/ExamplePlugin.php
Log:
- fixing bug in feedburner example plugin

Modified: trunk/plugins/ExamplePlugin/ExamplePlugin.php
===================================================================
--- trunk/plugins/ExamplePlugin/ExamplePlugin.php	2008-05-20 01:19:02 UTC (rev 488)
+++ trunk/plugins/ExamplePlugin/ExamplePlugin.php	2008-05-20 22:05:18 UTC (rev 489)
@@ -27,7 +27,7 @@
 	function install()
 	{
 		try{
-			Piwik_Query('ALTER TABLE '.Piwik::prefixTable('site'). " ADD `feedburnerName` VARCHAR( 100 ) NOT NULL ;");
+			Piwik_Query('ALTER TABLE '.Piwik::prefixTable('site'). " ADD `feedburnerName` VARCHAR( 100 ) DEFAULT NULL");
 		} catch(Zend_Db_Statement_Exception $e){
 			// mysql code error 1060: column already exists
 			// if there is another error we throw the exception, otherwise it is OK as we are simply reinstalling the plugin
@@ -188,8 +188,9 @@
 		// we save the value in the DB for an authenticated user
 		if(Piwik::getCurrentUserLogin() != 'anonymous')
 		{
-			Piwik_Query('UPDATE '.Piwik::prefixTable('site').' SET feedburnerName = ?',
-							Piwik_Common::getRequestVar('name','','string'));
+			Piwik_Query('UPDATE '.Piwik::prefixTable('site').' SET feedburnerName = ? WHERE idsite = ?', 
+				array(Piwik_Common::getRequestVar('name','','string'), Piwik_Common::getRequestVar('idSite',1,'int'))
+				);
 		}
 	}
 }



More information about the Piwik-svn mailing list