title: Joomla 2.5 hello world module development
body: <p>I am new in Joomla 2.5 module development so I read <a href="http://www.minitek.gr/tutorials/joomla-16-tutorials/item/89-how-to-create-a-database-driven-joomla-module.html" rel="nofollow">This</a> tutorial and copied and pasted everything without change, when I installed everything worked fine in server side but at the front end it showed this errors:</p>
  
  <p>1) Strict Standards: Non-static method modUserDataHelper::getData() should not be called statically in C:\xampp\htdocs\joomla\modules\mod_userdata\mod_userdata.php on line 16</p>
  
  <p>2) Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\joomla\modules\mod_userdata\helper.php on line 24</p>
  
  <p>so can you tell me what is wrong with my code?</p>
  
  <p>Files:</p>
  
  <pre><code>mod_userdata.xml
  mod_userdata.php
  helper.php
  index.html
  tmpl/default.php
  tmpl/index.html
  </code></pre>
  
  <p>mod_userdata.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;extension type="module" version="1.7" client="site" method="upgrade"&gt;
   &lt;name&gt;User Data Module&lt;/name&gt;
   &lt;author&gt;Minitek.gr&lt;/author&gt;
   &lt;creationDate&gt;03/08/2011&lt;/creationDate&gt;
   &lt;copyright&gt;Copyright (C) 2011. All rights reserved.&lt;/copyright&gt;
   &lt;license&gt;http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL&lt;/license&gt;
   &lt;authorEmail&gt;your_email&lt;/authorEmail&gt;
   &lt;authorUrl&gt;www.minitek.gr&lt;/authorUrl&gt;
   &lt;version&gt;1.7.1&lt;/version&gt;
   &lt;description&gt;Users Data Module&lt;/description&gt;
   &lt;languages&gt;
   &lt;/languages&gt;
   &lt;files&gt;
    &lt;filename module="mod_userdata"&gt;mod_userdata.php&lt;/filename&gt;
    &lt;filename&gt;mod_userdata.xml&lt;/filename&gt;
    &lt;filename&gt;helper.php&lt;/filename&gt;
    &lt;filename&gt;index.html&lt;/filename&gt;
    &lt;folder&gt;tmpl&lt;/folder&gt;
   &lt;/files&gt;
   &lt;config&gt;
    &lt;fields name="params"&gt;
     &lt;fieldset name="basic"&gt;
      &lt;field name="moduleclass_sfx" type="text" default="" label="Module Class Suffix" description="Suffix for individual css styling" /&gt;
      &lt;field name="limit" type="text" default="10" label="Limit Displayed Users" description="Limit Displayed Users" /&gt;
      &lt;field name="user_id" type="radio" default="1" label="Display user ID" description="Display user ID"&gt;
       &lt;option value="0"&gt;JNO&lt;/option&gt;
       &lt;option value="1"&gt;JYES&lt;/option&gt;
      &lt;/field&gt;
      &lt;field name="user_name" type="radio" default="1" label="Display Name" description="Display Name"&gt;
       &lt;option value="0"&gt;JNO&lt;/option&gt;
       &lt;option value="1"&gt;JYES&lt;/option&gt;
      &lt;/field&gt;
      &lt;field name="user_username" type="radio" default="1" label="Display Username" description="Display Username"&gt;
       &lt;option value="0"&gt;JNO&lt;/option&gt;
       &lt;option value="1"&gt;JYES&lt;/option&gt;
      &lt;/field&gt;
     &lt;/fieldset&gt;
    &lt;/fields&gt;
   &lt;/config&gt;
  &lt;/extension&gt;
  </code></pre>
  
  <p>mod_userdata.php</p>
  
  <pre><code>&lt;?php
  /**
   * @package Joomla.Site
   * @subpackage  mod_userdata
   * @copyright   Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
   * @license GNU General Public License version 2 or later; see LICENSE.txt
   */
  
  // no direct access
  defined('_JEXEC') or die;
  
  // Include the syndicate functions only once
  require_once dirname(__FILE__).'/helper.php';
  
  // Get the user data
  $list   = modUserDataHelper::getData($params);  // &lt;-- ERROR IS HERE!!!
  
  // Get the layout
  require JModuleHelper::getLayoutPath('mod_userdata', $params-&gt;get('layout', 'default'));
  </code></pre>
  
  <p>helper.php</p>
  
  <pre><code>&lt;?php
  /**
   * @package     Joomla.Site
   * @subpackage  mod_userdata
   * @copyright   Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   */
  
  // no direct access
  defined('_JEXEC') or die;
  
  class modUserDataHelper
  {
    function getData( &amp;$params )
    {
  
     // Database query        
     $list = array();         
     $query = " SELECT id, name, username "               
     ." FROM #__users "
     ." WHERE block=0 "               
     ." ORDER BY id DESC "
     ." LIMIT " . $params-&gt;get( 'limit' );                
     $db =&amp; JFactory::getDBO();   // &lt;-- ERROR IS HERE!!!
     $db-&gt;setQuery( $query );     
     $rows = $db-&gt;loadObjectList();
  
     // Get list items
     if ($rows!=null)
     {
      $i=0;
      foreach ($rows as $row) 
      {               
       $list["users"][$i]["id"]=$row-&gt;id;
       $list["users"][$i]["name"]=$row-&gt;name;
       $list["users"][$i]["username"]=$row-&gt;username;
       $i++;      
      }
      return $list;
     }
  
    }
  }
  </code></pre>
  
  <p>tmpl/default.php</p>
  
  <pre><code>&lt;?php
  /**
   * @package     Joomla.Site
   * @subpackage  mod_userdata
   * @copyright   Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   */
  
  // no direct access
  defined('_JEXEC') or die; ?&gt;
  
  &lt;div class="moduletable&lt;?php echo $params-&gt;get( 'moduleclass_sfx' ) ?&gt;"&gt;
  
   &lt;ul&gt;
    &lt;?php for ($i=0;$i&lt; sizeof($list["users"]); $i++) { ?&gt;    
  
       &lt;li&gt;
        &lt;?php if ($params-&gt;get( 'user_id' )) { ?&gt;
           &lt;span&gt;&lt;?php echo $list["users"][$i]["id"];?&gt;&lt;/span&gt;
          &lt;?php } ?&gt;
          &lt;?php if ($params-&gt;get( 'user_name' )) { ?&gt;
           &lt;span&gt;&lt;?php echo $list["users"][$i]["name"];?&gt;&lt;/span&gt;
          &lt;?php } ?&gt;
          &lt;?php if ($params-&gt;get( 'user_username' )) { ?&gt;
           &lt;span&gt;&lt;?php echo $list["users"][$i]["username"];?&gt;&lt;/span&gt;
          &lt;?php } ?&gt;
       &lt;/li&gt;
  
      &lt;?php } ?&gt;
   &lt;/ul&gt;
  
  &lt;/div&gt;
  </code></pre>