Tweet

Tuesday, 15 January 2013

default(tmpl)


<?php
/**
 * @package Joomla.Site
 * @subpackage mod_articles_archive
 * @copyright Copyright (C) 2005 - 2012 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;
?>

<ul>
<?php foreach ($getAll as $row) :
?>
<li>
<a href="#">
<?php echo $row->name; ?>
</a>
</li>
<?php endforeach; ?>
</ul>

index

<html><body bgcolor="#FFFFFF"></body></html>

mod_test


<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="1.6.0" client="site" method="install">
<name>test</name>
<author>Rajiv</author>
<creationDate>1/15/2013</creationDate>
<copyright>All rights reserved by me.</copyright>
<license>GPL 2.0</license>
<authorEmail>
info@me.com</authorEmail>
<authorUrl>www.me.com</authorUrl>
<version>1.0.0</version>
<description>Provides a listing of registered users</description>
<!-- Listing of all files that should be installed for the module to function -->
<files>
<!-- The "module" attribute signifies that this is the main controller file -->
<filename module="mod_test">mod_test.php</filename>
<filename>index.html</filename>
<filename>helper.php</filename>
<filename>tmpl/default.php</filename>

<filename>tmpl/index.html</filename>
</files>

<languages>
<!-- Any language files included with the module -->

</languages>

<!-- Optional parameters -->
<config>
<fields name="params">
<fieldset name="basic">
<field
name="moduleclass_sfx"
type="text"
default=""
label="LABEL_CLASS_SUFFIX"
description="DESC_MOD_SUFFIX">
</field>
<field
name="@spacer"
type="spacer"
default=""
label=""
description="">
</field>
<field
name="usercount"
type="text"
default="5"
label="LABEL_USER_COUNT"
description="DESC_USER_COUNT">
</field>
<field
name="layout"
type="list"
default="default"
label="LABEL_USER_LAYOUT"
description="DESC_USER_LAYOUT">
  <option
value="default">Unordered List</option>
<option
value="ordered_list">Ordered List</option>
</field>
</fieldset>
</fields>
</config>
</extension>

mod_test


<?php
/**
 * @package Joomla.Site
 * @subpackage mod_articles_archive
 * @copyright Copyright (C) 2005 - 2012 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;

// This is a parameter we get from our xml file above
//$userCount = $params->get('usercount');

// Include the syndicate functions only once
require_once dirname(__FILE__).'/helper.php';

$getAll = modTestHelper::getAll();
require JModuleHelper::getLayoutPath('mod_test', $params->get('layout', 'default'));

helper


<?php
/**
 * @package Joomla.Site
 * @subpackage mod_articles_archive
 * @copyright Copyright (C) 2005 - 2012 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 modTestHelper
{
function getAll(){
$db = JFactory::getDbo();
//$query = "SELECT name #__users  LIMIT {$userCount}";
$query = "SELECT name FROM #__users ";
 $db->setQuery($query);
$db->query();
//$rows =  $db->getNumRows();
$res=$db->loadObjectlist();
return $res;
}
}





index.html(Joomla)

<html><body bgcolor="#FFFFFF"></body></html>