Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8335289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:37:56+00:00 2026-06-09T03:37:56+00:00

I am new in Joomla 2.5 module development so I read This tutorial and

  • 0

I am new in Joomla 2.5 module development so I read This 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:

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

2) Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\joomla\modules\mod_userdata\helper.php on line 24

so can you tell me what is wrong with my code?

Files:

mod_userdata.xml
mod_userdata.php
helper.php
index.html
tmpl/default.php
tmpl/index.html

mod_userdata.xml

<?xml version="1.0" encoding="UTF-8"?>
<extension type="module" version="1.7" client="site" method="upgrade">
 <name>User Data Module</name>
 <author>Minitek.gr</author>
 <creationDate>03/08/2011</creationDate>
 <copyright>Copyright (C) 2011. All rights reserved.</copyright>
 <license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
 <authorEmail>your_email</authorEmail>
 <authorUrl>www.minitek.gr</authorUrl>
 <version>1.7.1</version>
 <description>Users Data Module</description>
 <languages>
 </languages>
 <files>
  <filename module="mod_userdata">mod_userdata.php</filename>
  <filename>mod_userdata.xml</filename>
  <filename>helper.php</filename>
  <filename>index.html</filename>
  <folder>tmpl</folder>
 </files>
 <config>
  <fields name="params">
   <fieldset name="basic">
    <field name="moduleclass_sfx" type="text" default="" label="Module Class Suffix" description="Suffix for individual css styling" />
    <field name="limit" type="text" default="10" label="Limit Displayed Users" description="Limit Displayed Users" />
    <field name="user_id" type="radio" default="1" label="Display user ID" description="Display user ID">
     <option value="0">JNO</option>
     <option value="1">JYES</option>
    </field>
    <field name="user_name" type="radio" default="1" label="Display Name" description="Display Name">
     <option value="0">JNO</option>
     <option value="1">JYES</option>
    </field>
    <field name="user_username" type="radio" default="1" label="Display Username" description="Display Username">
     <option value="0">JNO</option>
     <option value="1">JYES</option>
    </field>
   </fieldset>
  </fields>
 </config>
</extension>

mod_userdata.php

<?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);  // <-- ERROR IS HERE!!!

// Get the layout
require JModuleHelper::getLayoutPath('mod_userdata', $params->get('layout', 'default'));

helper.php

<?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( &$params )
  {

   // Database query        
   $list = array();         
   $query = " SELECT id, name, username "               
   ." FROM #__users "
   ." WHERE block=0 "               
   ." ORDER BY id DESC "
   ." LIMIT " . $params->get( 'limit' );                
   $db =& JFactory::getDBO();   // <-- ERROR IS HERE!!!
   $db->setQuery( $query );     
   $rows = $db->loadObjectList();

   // Get list items
   if ($rows!=null)
   {
    $i=0;
    foreach ($rows as $row) 
    {               
     $list["users"][$i]["id"]=$row->id;
     $list["users"][$i]["name"]=$row->name;
     $list["users"][$i]["username"]=$row->username;
     $i++;      
    }
    return $list;
   }

  }
}

tmpl/default.php

<?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; ?>

<div class="moduletable<?php echo $params->get( 'moduleclass_sfx' ) ?>">

 <ul>
  <?php for ($i=0;$i< sizeof($list["users"]); $i++) { ?>    

     <li>
      <?php if ($params->get( 'user_id' )) { ?>
         <span><?php echo $list["users"][$i]["id"];?></span>
        <?php } ?>
        <?php if ($params->get( 'user_name' )) { ?>
         <span><?php echo $list["users"][$i]["name"];?></span>
        <?php } ?>
        <?php if ($params->get( 'user_username' )) { ?>
         <span><?php echo $list["users"][$i]["username"];?></span>
        <?php } ?>
     </li>

    <?php } ?>
 </ul>

</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T03:37:58+00:00Added an answer on June 9, 2026 at 3:37 am

    You have “strict standards” turned on which is throwing some errors due to the code being written for (likely) php 5.3 rather than 5.4. Looks like an object is being instantiated or assigned by reference (&new MyClass as opposed to new MyClass) and modUserDataHelper::getData(), which is not defined as static is being called as though it were static.

    There are two things you can do: turn off strict standards (which is the code equivalent of sweeping dust under a rug) or fix the bad code. In this case, calling modUserDataHelper::getData() is bad form. It needs to be called from an instantiated object, not from a static context. Create an instance of it ($tempObj or something like that) then call the method from that object ($tempObj->getData();).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have installed new site in Joomla 1.7 and its working fine, but when
Hello I'm new to Joomla and I want to change the way an account
I am new to Joomla!. My question is: I installed JoomFish alpha version successfully.
I am new to Joomla development, I am developing a website in which I
I'm new to this whole Joomla thing, and I'm trying to get an swf
This question may seem a bit stupid, but i'm new to Joomla! And i
I'm fairly new to Joomla - so hopefully this isn't too simple. My client
I am new to Joomla and this is my first project in Joomla. I
I am new to Joomla. I am developing a dynamic module which will display
I'm new at Joomla. I just had made my first component and module. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.