<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Probie715</id>
	<title>Joomla! Documentation - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Probie715"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Probie715"/>
	<updated>2026-09-07T02:29:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived:Upgrading_a_Joomla_1.5_template_to_Joomla_2.5&amp;diff=35693</id>
		<title>Archived:Upgrading a Joomla 1.5 template to Joomla 2.5</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived:Upgrading_a_Joomla_1.5_template_to_Joomla_2.5&amp;diff=35693"/>
		<updated>2011-01-18T23:51:15Z</updated>

		<summary type="html">&lt;p&gt;Probie715: corrected typographical errors&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Underconstruction}}&lt;br /&gt;
{{RightTOC}}&lt;br /&gt;
== Template parameters ==&lt;br /&gt;
In both Joomla! 1.5 and 1.6 template parameters are defined in templateDetails.xml. &lt;br /&gt;
&lt;br /&gt;
Whereas in 1.5 parameters are defined as part of the &amp;lt;code&amp;gt;&amp;lt;params&amp;gt;&amp;lt;/code&amp;gt; section, and each parameter is defined as a &amp;lt;code&amp;gt;&amp;lt;param&amp;gt;&amp;lt;/code&amp;gt;, in 1.6 template parameters are contained in the &amp;lt;code&amp;gt;&amp;lt;config&amp;gt;&amp;lt;/code&amp;gt; section and treated as a &amp;lt;code&amp;gt;&amp;lt;field&amp;gt;&amp;lt;/code&amp;gt; nested within the &amp;lt;code&amp;gt;&amp;lt;fieldset&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;fields&amp;gt;&amp;lt;/code&amp;gt; tags, as illustrated below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;config&amp;gt;&lt;br /&gt;
        &amp;lt;fields name=&amp;quot;params&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;field name=&amp;quot;&amp;quot; type=&amp;quot; default=&amp;quot;&amp;quot; label=&amp;quot;&amp;quot; description=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;On&amp;lt;/option&amp;gt;&lt;br /&gt;
                    &amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;Off&amp;lt;/option&amp;gt;&lt;br /&gt;
                &amp;lt;/field&amp;gt;&lt;br /&gt;
                &amp;lt;field name=&amp;quot;&amp;quot; type=&amp;quot;&amp;quot; default=&amp;quot;&amp;quot; label=&amp;quot;e&amp;quot; description=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/fieldset&amp;gt;&lt;br /&gt;
        &amp;lt;/fields&amp;gt;&lt;br /&gt;
    &amp;lt;/config&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&amp;lt;/code&amp;gt; wraps the parameters in a slider and using name=&amp;quot;basic&amp;quot; labels that slider as &amp;quot;Basic Options&amp;quot; and name=&amp;quot;advanced&amp;quot; labels it as &amp;quot;Advanced Options&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The name=&amp;quot;&amp;quot; type=&amp;quot; default=&amp;quot;&amp;quot; label=&amp;quot;&amp;quot; description=&amp;quot;&amp;quot; attributes still apply.&lt;br /&gt;
&lt;br /&gt;
== Objects and Methods ==&lt;br /&gt;
=== Sitename ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;?php echo $mainframe-&amp;gt;getCfg(&#039;sitename&#039;);?&amp;gt;&amp;lt;/code&amp;gt; is now &amp;lt;code&amp;gt;$app-&amp;gt;getCfg(&#039;sitename&#039;);&amp;lt;/code&amp;gt; Where &amp;lt;code&amp;gt;$app = JFactory::getApplication();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Error Codes ===&lt;br /&gt;
* &amp;lt;code&amp;gt;$this-&amp;gt;error-&amp;gt;code&amp;lt;/code&amp;gt; is replaced by &amp;lt;code&amp;gt;$this-&amp;gt;error-&amp;gt;getCode();&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;$this-&amp;gt;error-&amp;gt;message&amp;lt;/code&amp;gt; is replaced by &amp;lt;/code&amp;gt;$this-&amp;gt;error-&amp;gt;getMessage();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Joomla! 1.6]]&lt;/div&gt;</summary>
		<author><name>Probie715</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Publishers&amp;diff=29401</id>
		<title>Publishers</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Publishers&amp;diff=29401"/>
		<updated>2010-07-14T20:44:17Z</updated>

		<summary type="html">&lt;p&gt;Probie715: fix gramatics&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
&lt;br /&gt;
To understand more about what a publisher can do, we need to clarify about the Access Control Levels (ACL). In other words ACL&#039;s govern the permissions that are associated with the individual User levels. There are seven (7) User Groups/levels within Joomla. Four (4) only have access to the Site Front-end: Registered, Author, Editor, and Publisher. There are also three (3) levels with access to the Administrator Back-end: Manager, Administrator, and Super Administrator. In addition to the registered User Groups listed above there is a Public (unregistered) or Guest, level.&lt;br /&gt;
&lt;br /&gt;
So a publisher is a User level with access only to the Site Front-end functions, but with permission to publish content on the Site.&lt;/div&gt;</summary>
		<author><name>Probie715</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Register_globals&amp;diff=28407</id>
		<title>Register globals</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Register_globals&amp;diff=28407"/>
		<updated>2010-06-06T12:00:35Z</updated>

		<summary type="html">&lt;p&gt;Probie715: typographical edit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
&lt;br /&gt;
== What is it? ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;register_globals&amp;lt;/tt&amp;gt; is a PHP environment setting that has been the subject of controversy for sometime.  Older versions of PHP often have this variable set to on and that setting is known to leave a site vulnerable to hacking.  Further information is available at [http://us.php.net/register_globals the PHP website]. Current Joomla! releases do not require this setting to be on, and best practices dictate that it should be changed to off.  (Joomla! 1.0.x releases also have a related emulator for this setting, which was implemented for backward compatibility with older components and extensions.  &#039;&#039;It is generally preferred not to enable this capability&#039;&#039;.)  If you have a component that requires this setting, you should look for an update, or find an alternative component.&lt;br /&gt;
&lt;br /&gt;
== Can I change it? ==&lt;br /&gt;
Yes, maybe.  Depending on how much control you have over your server, there are several approaches to addressing this setting.&lt;br /&gt;
&lt;br /&gt;
If you have complete control of your server, then you probably want to make sure that your main PHP configuration file (which is typically found in /usr/local/lib/php.ini) has the directive &#039;&#039;register_globals&#039;&#039; set to 0(zero).  &lt;br /&gt;
&lt;br /&gt;
If you&#039;re in a shared web environment, most likely your hosting provider will not let you modify the global php.ini file.  You have a couple of options in this case.&lt;br /&gt;
&lt;br /&gt;
== Where do I change it? ==&lt;br /&gt;
Possibly the easiest thing to do is to ask your hosting provider to make this change for your domain.  (Often this is accomplished by logging a technical support request.)  But not all providers will make this change for you.  So you may not be so lucky.  The good news is that there are likely other options available to you, and here are some of them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Local php configuration file:&#039;&#039;&#039;&lt;br /&gt;
If you have access to your web site&#039;s root directory, you should be able to include your own copy of a php.ini file.  Your copy only needs to include the settings that you want to alter from the global settings.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Change to .htaccess:&#039;&#039;&#039;&lt;br /&gt;
Another option is to introduce the preferred setting by making an entry in the .htaccess file at the root directory of your web site.  In this case, you should add the following line to .htaccess&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: This method is only suitable for the Apache PHP &#039;&#039;module&#039;&#039; and will not work if PHP runs in CGI-mode.&lt;br /&gt;
 php_flag register_globals off&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Joomla&#039;s Global Register Emulator:&#039;&#039;&#039;&lt;br /&gt;
In the case where you have an extension that absolutely needs to have register_globals on, Joomla! 1.0.x provides an alternative approach that does not require a change to your global settings.  The &#039;&#039;globals.php&#039;&#039; file in your site&#039;s root directory has an entry that lets Joomla! emulate a change to the register_globals site setting.  You will find a line that looks as such:&lt;br /&gt;
&lt;br /&gt;
 define( &#039;RG_EMULATION&#039;, 0 );&lt;br /&gt;
&lt;br /&gt;
You can change the zero to a one, if you want Joomla to emulate &#039;&#039;register_globals = on&#039;&#039;.&lt;br /&gt;
[[Category:Landing Pages]]&lt;/div&gt;</summary>
		<author><name>Probie715</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Coding_style_and_standards&amp;diff=27083</id>
		<title>Coding style and standards</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Coding_style_and_standards&amp;diff=27083"/>
		<updated>2010-05-05T21:40:55Z</updated>

		<summary type="html">&lt;p&gt;Probie715: Corrected a few typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
{{RightTOC}}&lt;br /&gt;
remark: The following information has been copied from the old WIKI archive has not yet been reviewed.&lt;br /&gt;
See: http://dev.joomla.org/component/option,com_jd-wiki/Itemid,/id,standards:coding/&lt;br /&gt;
&lt;br /&gt;
Good coding standards are important in any development project, but particularly when multiple developers are working on the same project. Having coding standards helps ensure that the code is of high quality, has fewer bugs, and is easily maintained.&lt;br /&gt;
&lt;br /&gt;
First rule, if in doubt, ask.&lt;br /&gt;
&lt;br /&gt;
== File Format ==&lt;br /&gt;
All files contributed to Joomla must:&lt;br /&gt;
&lt;br /&gt;
* Be stored as ASCII text&lt;br /&gt;
* Use UTF-8 character encoding&lt;br /&gt;
* Be Unix formatted&lt;br /&gt;
** Lines must end only with a line feed (LF). Line feeds are represented as ordinal 10, octal 012 and hex 0A. Do not use carriage returns (CR) like Macintosh computers do or the carriage return/line feed combination (CRLF) like Windows computers do.&lt;br /&gt;
&lt;br /&gt;
New files will normally be added to the code base using Subversion (SVN). All SVN files should have the SVN property set &amp;quot;eol-style=LF&amp;quot;. Also, most Joomla! files will have &amp;quot;$Id&amp;quot; tags in the &amp;quot;@version&amp;quot; line of the Doc block. These require the SVN property &amp;quot;keywords=Id&amp;quot;. See [[Subversion File Properties]] for more information about how to set SVN properties.&lt;br /&gt;
&lt;br /&gt;
== Coding Standards ==&lt;br /&gt;
&lt;br /&gt;
=== Spelling ===&lt;br /&gt;
&lt;br /&gt;
Spelling of class, function, variable and constant names should generally be in accordance with British English rules (en_GB).  However, some exceptions are permitted, for example where common programming names are used that align with the PHP API such as &amp;lt;code&amp;gt;$color&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== E_STRICT-compatible code ===&lt;br /&gt;
&lt;br /&gt;
As of version 1.6, all new code that is suggested for inclusion into Joomla must be E_STRICT-compatible. This means that it must not produce any warnings or errors when PHP&#039;s error reporting level is set to E_ALL | E_STRICT.&lt;br /&gt;
&lt;br /&gt;
=== Indenting and Line Length ===&lt;br /&gt;
&lt;br /&gt;
Use tabs to indent, not spaces. Make sure that the tab-stops are set to only 4 spaces in length.&lt;br /&gt;
&lt;br /&gt;
There is no set limit for line length.  Use your judgment based on the nature of the line and readability.&lt;br /&gt;
&lt;br /&gt;
=== Control Structures ===&lt;br /&gt;
&lt;br /&gt;
These include if, for, while, switch, etc. Here is an example of an if statement, as it is the most complicated of the control structures:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
if ((condition1) || (condition2)) {&lt;br /&gt;
    action1();&lt;br /&gt;
} else if ((condition3) &amp;amp;&amp;amp; (condition4)) {&lt;br /&gt;
    action2();&lt;br /&gt;
} else&lt;br /&gt;
{&lt;br /&gt;
   // Use one true brace in control structures&lt;br /&gt;
   // when the block is longer than one line&lt;br /&gt;
    defaultAction();&lt;br /&gt;
    anotherAction();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// optional formatting if it improves readability&lt;br /&gt;
if ((condition1) || (condition2)) {&lt;br /&gt;
    action1();&lt;br /&gt;
}&lt;br /&gt;
else if ((condition3) &amp;amp;&amp;amp; (condition4)) {&lt;br /&gt;
    action2();&lt;br /&gt;
}&lt;br /&gt;
else {&lt;br /&gt;
    defaultAction();&lt;br /&gt;
    anotherAction();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Control statements should have one space between the control keyword and opening parenthesis, to distinguish them from function calls.&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;layouts&#039;&#039;&#039;, the alternative named notation should be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
if ((condition1) OR (condition2)) :&lt;br /&gt;
    action1();&lt;br /&gt;
elseif ((condition3) AND (condition4)) :&lt;br /&gt;
    action2();&lt;br /&gt;
else :&lt;br /&gt;
    defaultAction();&lt;br /&gt;
    anotherAction();&lt;br /&gt;
endif;&lt;br /&gt;
&lt;br /&gt;
foreach ($array as $element) :&lt;br /&gt;
    echo $element;&lt;br /&gt;
endforeach;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Logical operators in condition statements should use uppercase words (&amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt;, etc) rather than programmatic notation (&amp;lt;code&amp;gt;&amp;amp;&amp;amp;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;||&amp;lt;/code&amp;gt;, etc).&lt;br /&gt;
&lt;br /&gt;
With the exception of &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; statements, curly braces must always be included even though they are technically optional. Having them increases readability and decreases the likelihood of logic errors being introduced when new lines are added.&lt;br /&gt;
&lt;br /&gt;
For switch statements:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
switch (condition)&lt;br /&gt;
{&lt;br /&gt;
    case 1:&lt;br /&gt;
        doAction1();&lt;br /&gt;
        break;&lt;br /&gt;
&lt;br /&gt;
    case 2:&lt;br /&gt;
        doAction2();&lt;br /&gt;
        break;&lt;br /&gt;
&lt;br /&gt;
    default:&lt;br /&gt;
        doDefaultAction();&lt;br /&gt;
        break;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use indenting and line-breaks rather than curly braces in the &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; statements to increase readability.  There should be no space between the condition and the colon in the &amp;lt;code&amp;gt;case&amp;lt;/code&amp;gt; statement.&lt;br /&gt;
&lt;br /&gt;
=== Function Calls ===&lt;br /&gt;
&lt;br /&gt;
Functions should be called with no spaces between the function name and the opening parenthesis, and no space between this and the first parameter; a space after the comma between each parameter (if they are present), and no space between the last parameter and the closing parenthesis, and the semicolon. Here&#039;s an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$var = foo($bar, $baz, $quux);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As displayed above, there should be space before and one space after the equals sign used to assign the return value of a function to a variable. In the case of a block of related assignments, tabs (not spaces) may be inserted to promote readability:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$short          = foo($bar);&lt;br /&gt;
$long_variable  = foo($baz);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Function Definitions ===&lt;br /&gt;
&lt;br /&gt;
Class and function declarations follow the &amp;quot;one true brace&amp;quot; convention:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
function fooFunction($arg1, $arg2 = &#039;&#039;)&lt;br /&gt;
{&lt;br /&gt;
    if (condition) {&lt;br /&gt;
        statement;&lt;br /&gt;
    }&lt;br /&gt;
    return $val;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class fooClass&lt;br /&gt;
{&lt;br /&gt;
    function fooMethod($arg1)&lt;br /&gt;
    {&lt;br /&gt;
        if ($arg) {&lt;br /&gt;
            $result = true;&lt;br /&gt;
        } else {&lt;br /&gt;
            $result = false;&lt;br /&gt;
        }&lt;br /&gt;
        return $result;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments with default values go at the end of the argument list. Always attempt to return a meaningful value from a function if one is appropriate. Here is a slightly longer example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
function connect(&amp;amp;$dsn, $persistent = false)&lt;br /&gt;
{&lt;br /&gt;
    if (is_array($dsn)) {&lt;br /&gt;
        $dsninfo = &amp;amp;$dsn;&lt;br /&gt;
    } else {&lt;br /&gt;
        $dsninfo = DB::parseDSN($dsn);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (!$dsninfo OR !$dsninfo[&#039;phptype&#039;]) {&lt;br /&gt;
        return $this-&amp;gt;raiseError();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Comments ===&lt;br /&gt;
&lt;br /&gt;
Inline documentation for classes should follow the PHPDoc convention, similar to Javadoc. More information about PHPDoc can be found here: http://www.phpdoc.org/&lt;br /&gt;
&lt;br /&gt;
See also [[Adding phpDocumentor comments]]&lt;br /&gt;
&lt;br /&gt;
Non-documentation comments are strongly encouraged. A general rule of thumb is that if you look at a section of code and think &amp;quot;Wow, I don&#039;t want to try and describe that&amp;quot;, you need to comment it before you forget how it works.&lt;br /&gt;
&lt;br /&gt;
C style comments (&amp;lt;tt&amp;gt;/* */&amp;lt;/tt&amp;gt;) and standard C++ comments (&amp;lt;tt&amp;gt;//&amp;lt;/tt&amp;gt;) are both satisfactory. Use of Perl/shell style comments (&amp;lt;tt&amp;gt;#&amp;lt;/tt&amp;gt;) is not permitted.&lt;br /&gt;
&lt;br /&gt;
Please note - commented code is not to be committed to trunk or release repositories.&lt;br /&gt;
&lt;br /&gt;
=== Including Code ===&lt;br /&gt;
&lt;br /&gt;
Anywhere you are unconditionally including a class file, use &amp;lt;code&amp;gt;require_once&amp;lt;/code&amp;gt;. Anywhere you are conditionally including a class file (for example, factory methods), use &amp;lt;code&amp;gt;include_once&amp;lt;/code&amp;gt;. Either of these will ensure that class files are included only once. They share the same file list, so you don&#039;t need to worry about mixing them -- a file included with &amp;lt;code&amp;gt;require_once&amp;lt;/code&amp;gt; will not be included again by &amp;lt;/code&amp;gt;include_once&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;Note: [[php:include_once|include_once]] and [[php:require_once|require_once]] are PHP &#039;&#039;language statements&#039;&#039;, not functions. You don&#039;t need parentheses around the filename to be included.&lt;br /&gt;
&lt;br /&gt;
=== PHP Code Tags ===&lt;br /&gt;
&lt;br /&gt;
Always use &amp;lt;tt&amp;gt;&amp;amp;lt;?php ?&amp;gt;&amp;lt;/tt&amp;gt; to delimit PHP code, not the &amp;lt;tt&amp;gt;&amp;amp;lt;? ?&amp;gt;&amp;lt;/tt&amp;gt; shorthand. This is the most portable way to include PHP code on differing operating systems and setups.&lt;br /&gt;
&lt;br /&gt;
For files that contain only PHP code, the closing tag (&amp;lt;tt&amp;gt;?&amp;gt;&amp;lt;/tt&amp;gt;) is never permitted. It is not required by PHP. Not including it prevents trailing white space from being accidentally injected into the output (see PHP manual on [http://au.php.net/basic-syntax.instruction-separation instruction separation]).&lt;br /&gt;
&lt;br /&gt;
=== SQL Queries ===&lt;br /&gt;
&lt;br /&gt;
SQL keywords are to be written in uppercase, while all other identifiers (which the exception of quoted text obviously) is to be in lowercase. Carriage returns should not be used as [[JDatabase]]::getQuery provides for formatted output.  However, indenting with spaces to improve readability is desireable.&lt;br /&gt;
&lt;br /&gt;
Queries should be wrapped in single quotes (as these text blocks are parsed faster by php).&lt;br /&gt;
&lt;br /&gt;
All quoted strings must use the &#039;&#039;Quote&#039;&#039; method to facilitate future compatibility with other database engines.&lt;br /&gt;
&lt;br /&gt;
All table names should use the &#039;&#039;&#039;&amp;lt;tt&amp;gt;#_&amp;lt;/tt&amp;gt;&#039;&#039;&#039; prefix rather than &amp;lt;tt&amp;gt;jos_&amp;lt;/tt&amp;gt; to access Joomla! contents and allow for the [[screen.config.15#Database_Settings|user defined database prefix]] to be applied.&lt;br /&gt;
&lt;br /&gt;
All expected integer or floating-point variable must be [http://php.net/manual/language.types.type-juggling.php cast] with &amp;lt;tt&amp;gt;(int)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(float)&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;(double)&amp;lt;/tt&amp;gt; as appropriate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$state = 1;&lt;br /&gt;
$name  = &#039;bill&#039;;&lt;br /&gt;
$db    = &amp;amp;JFactory::getDBO();&lt;br /&gt;
$query = &#039;SELECT COUNT( c.id ) AS num_articles, u.id, u.username&#039;.&lt;br /&gt;
    &#039; FROM #__content AS c&#039;.&lt;br /&gt;
    &#039; LEFT JOIN #__users AS u ON u.id = c.created_by&#039;.&lt;br /&gt;
    &#039; WHERE c.state = &#039;.(int) $state&lt;br /&gt;
    &#039;  AND u.id IS NOT NULL&#039;.&lt;br /&gt;
    &#039;  AND u.username &amp;lt;&amp;gt; &#039;.$db-&amp;gt;Quote( $name ).&lt;br /&gt;
    &#039; GROUP BY u.id&#039;.&lt;br /&gt;
    &#039;  HAVING COUNT( c.id ) &amp;gt; 0&#039;;&lt;br /&gt;
$db-&amp;gt;setQuery();&lt;br /&gt;
// Output formated query:&lt;br /&gt;
if ($debug) {&lt;br /&gt;
    echo $db-&amp;gt;getQuery();&lt;br /&gt;
}&lt;br /&gt;
$stats = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Doc Blocks ===&lt;br /&gt;
&lt;br /&gt;
All source code files in the core Joomla distribution must contain the following comment block as the header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * @version	$Id$&lt;br /&gt;
 * @package	Joomla&lt;br /&gt;
 * @copyright	Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.&lt;br /&gt;
 * @license	GNU/GPL, see LICENSE.php&lt;br /&gt;
 */&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;@package&amp;lt;/code&amp;gt; in the header is not required for class-only files.&lt;br /&gt;
&lt;br /&gt;
Classes, functions, constants, class properties and class methods should all be supplied with appropriate DocBlocks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Short description for class&lt;br /&gt;
 *&lt;br /&gt;
 * Long description for class (if any)...&lt;br /&gt;
 *&lt;br /&gt;
 * @package    PackageName&lt;br /&gt;
 * @subpackage SubPackageName&lt;br /&gt;
 * @link       http://pear.php.net/package/PackageName&lt;br /&gt;
 * @see        NetOther, Net_Sample::Net_Sample()&lt;br /&gt;
 * @since      Class available since Release 1.2.0&lt;br /&gt;
 * @deprecated Class deprecated in Release 2.0.0&lt;br /&gt;
 */&lt;br /&gt;
class JFooBar&lt;br /&gt;
{&lt;br /&gt;
    /**&lt;br /&gt;
     * @var int $id Primary key&lt;br /&gt;
     */&lt;br /&gt;
    public $id = null;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following package names are to be used in the core stack:&lt;br /&gt;
&lt;br /&gt;
* Joomla.Administrator - all files that belong only to the administrator or backend application&lt;br /&gt;
* Joomla.Installation - all files that belong to the installation application&lt;br /&gt;
* Joomla.Plugin - all plugin files&lt;br /&gt;
* Joomla.Site - all files that pertain only to the site or frontend application&lt;br /&gt;
* Joomla.XML-RPC - all files that belong to the XML-RPC server application&lt;br /&gt;
&lt;br /&gt;
The sub-package name will vary according to the extension type:&lt;br /&gt;
&lt;br /&gt;
* Components - the component folder, eg &amp;lt;code&amp;gt;com_content&amp;lt;/code&amp;gt;&lt;br /&gt;
* Modules - the module folder, eg &amp;lt;code&amp;gt;mod_latest_news&amp;lt;/code&amp;gt;&lt;br /&gt;
* Plugins - the folder.element, eg &amp;lt;code&amp;gt;content.pagebreak&amp;lt;/code&amp;gt;&lt;br /&gt;
* Templates - the template folder, eg &amp;lt;code&amp;gt;rhuk_milkyway&amp;lt;/code&amp;gt;&lt;br /&gt;
* Framework - nothing for top level files (such as &amp;lt;code&amp;gt;factory.php&amp;lt;/code&amp;gt;), the first level folder or the first.second level folders as appropriate, eg &amp;lt;code&amp;gt;utilities&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;joomla/utilities/date.php&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;html.html&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;joomla/html/html/email.php&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that code contributed to the Joomla stack that will become the copyright of the project is not allowed to include &amp;lt;code&amp;gt;@author&amp;lt;/code&amp;gt; tags.  You should update the contribution log in &amp;lt;tt&amp;gt;CREDITS.php&amp;lt;/tt&amp;gt;.  Joomla&#039;s philosophy is that the code is written &amp;quot;all together&amp;quot; and there is no notion of any one person &#039;owning&#039; any section of code.&lt;br /&gt;
&lt;br /&gt;
Files included from third party sources must leave DocBlocks intact. Layout files use the same DocBlocks as other PHP files. &lt;br /&gt;
&lt;br /&gt;
Note that the &amp;quot;@version $Id&amp;quot; line uses the SVN &amp;quot;keywords=Id&amp;quot; property. See [[Subversion File Properties]] for information about setting this property.&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
=== Classes ===&lt;br /&gt;
&lt;br /&gt;
Classes should be given descriptive names. Avoid using abbreviations where possible. Class names should always begin with an uppercase letter and be written in CamelCase even if using traditionally uppercase acronyms (such as XML, HTML).  One exception is for Joomla framework classes which must begin with an uppercase &#039;J&#039; with the next letter also being uppercase.  For example:&lt;br /&gt;
&lt;br /&gt;
* JHtmlHelper&lt;br /&gt;
* JXmlParser&lt;br /&gt;
* JModel&lt;br /&gt;
&lt;br /&gt;
Third-party developers are advised to namespace their functions with a unique prefix.&lt;br /&gt;
&lt;br /&gt;
=== Functions and Methods ===&lt;br /&gt;
&lt;br /&gt;
Functions and methods should be named using the &amp;quot;studly caps&amp;quot; style (also referred to as &amp;quot;bumpy case&amp;quot; or &amp;quot;camel caps&amp;quot;). The initial letter of the name is lowercase, and each letter that starts a new &amp;quot;word&amp;quot; is capitalized. Function in the Joomla framework must begin with a lowercase &#039;j&#039;.  Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
connect();&lt;br /&gt;
getData();&lt;br /&gt;
buildSomeWidget();&lt;br /&gt;
jImport();&lt;br /&gt;
jDoSomething();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Private class members (meaning class members that are intended to be used only from within the same class in which they are declared; are preceded by a single underscore. Properties are to be written in underscore format (that is, logical words separated by underscores) and should be all lowercase.  For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class JFooBar&lt;br /&gt;
{&lt;br /&gt;
    // Joomla 1.5 and earlier format&lt;br /&gt;
    var $_status = null;&lt;br /&gt;
&lt;br /&gt;
    function _sort()&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Joomla 1.6 format&lt;br /&gt;
    private $_status = null;&lt;br /&gt;
&lt;br /&gt;
    protected $field_name = null;&lt;br /&gt;
&lt;br /&gt;
    protected function _sort()&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Constants ===&lt;br /&gt;
&lt;br /&gt;
Constants should always be all-uppercase, with underscores to separate words. Prefix constant names with the uppercase name of the class/package they are used in. For example, the constants used by the [[JError]] class all begin with &amp;quot;JERROR_&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Global Variables ===&lt;br /&gt;
&lt;br /&gt;
If your package needs to define global variables, their name should start with a single underscore followed by the uppercase class/package name and another underscore. For example, the JError class uses a global variable called $_JERROR_LEVELS.&lt;br /&gt;
&lt;br /&gt;
With PHP5 and later you may use static class properties or constants instead of globals.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
class JWhatever&lt;br /&gt;
{&lt;br /&gt;
    public static $instance = null;&lt;br /&gt;
    const SUCCESS = 1;&lt;br /&gt;
    const FAILURE = 0;&lt;br /&gt;
    // Methods...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regular and Class Variables ===&lt;br /&gt;
&lt;br /&gt;
Regular variables, follow the same conventions as function.&lt;br /&gt;
&lt;br /&gt;
Class variables should be set to null or some other appropriate default value. Lining up the default values with tabs should only be used if particularly warranted for readability.&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
When using references, there should be a space before the reference operator and no space between it and the function or variable name.  For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$ref1  = &amp;amp;$this-&amp;gt;_sql;&lt;br /&gt;
$db    = &amp;amp;JFactory::getDBO();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Language Keys ===&lt;br /&gt;
&lt;br /&gt;
Except for the most common of words, such as &amp;quot;Yes&amp;quot;, &amp;quot;No&amp;quot;, &amp;quot;Show&amp;quot;, &amp;quot;Hide&amp;quot; all language keys should be namespaced to reflect the type of string they represent.  Always consider that if two extensions use the same key, the one loaded last will be the one that displays.  Namespacing should generally relate to the extension displaying the text. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
echo JText::_(&#039;Weblink Link&#039;);&lt;br /&gt;
echo JText::_(&#039;Weblink Title&#039;);&lt;br /&gt;
echo JText::_(&#039;Weblink Description&#039;);&lt;br /&gt;
&lt;br /&gt;
echo JText::_(&#039;Exception An error occurred while saving&#039;);&lt;br /&gt;
?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TODO: Link to page with &amp;quot;common&amp;quot; strings that can be used for typical actions in components, such a &amp;quot;Save&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Where the same English word is used in two different locations, two different language keys should be used to allow for cases where the translation results in different words or phrases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// A table column title&lt;br /&gt;
&amp;lt;th&amp;gt;&amp;lt;?php echo JText::_(&#039;Weblink Column Title&#039;);?&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;&amp;lt;?php echo JText::_(&#039;Weblink Column Link&#039;);?&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// In the form&lt;br /&gt;
&amp;lt;?php echo JText::_(&#039;Weblink Title&#039;);?&amp;gt;&amp;lt;input name=&amp;quot;title&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;?php echo JText::_(&#039;Weblink Link&#039;);?&amp;gt;&amp;lt;input name=&amp;quot;link&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Toolbar and Linkbar text should be prefixed Toolbar and Linkbar respectively.&lt;br /&gt;
&lt;br /&gt;
The language keys should be written as naturally as possible with spaces, not underscores separating words.  Long phrases can be condensed to reduce keys to a sensible length.  For example, tooltips for an edit field can be written like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php echo JText::_(&#039;Weblink Title&#039;);?&amp;gt;&amp;lt;input name=&amp;quot;title&amp;quot; title=&amp;quot;&amp;lt;?php echo JText::_(&#039;Weblink Title Desc&#039;);?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The convention used should be governed by common sense, but must be consistent.  In general consider how the language file will look with all keys sorted alphabetically.  Prefixes should be used to group text within a common context (such as column headings).  Suffixes should be used to group elements that logically go together (such as a field name and its description).&lt;br /&gt;
&lt;br /&gt;
Phrases must never be assembled by string concatenation. Each phrase must be represented by a single language key, using sprintf as appropriate to replace dynamic words in the phrase.  Where replacements are made, the word used should be as descriptive as possible and all-uppercase.  This assists the translators to determine the context of the replacement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
// Not permitted&lt;br /&gt;
echo JText::_(&#039;Deleted &#039;).$n.JText::_(&#039; items&#039;);&lt;br /&gt;
&lt;br /&gt;
// Permitted&lt;br /&gt;
echo JText::sprintf(&#039;Message Deleted NUMBER items&#039;, $n);&lt;br /&gt;
?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference in the language file would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;MESSAGE DELETED NUMBER ITEMS=Deleted %d Item(s)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If more than one dynamic string is used in a phrase, the printf markers should employ order placement as other languages might change the position of the strings. This is done via %[number]$[printf_type] as follows:&lt;br /&gt;
&lt;br /&gt;
Left to right language:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;PAGE X OF Y=Page %1$d of %2$d&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Right to left language:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;PAGE X OF Y=%2$d of %1$d egaP&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
&lt;br /&gt;
For single controller components, the naming convention is &#039;&#039;[Name]Controller&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * Content Controller&lt;br /&gt;
 * @package Joomla&lt;br /&gt;
 */&lt;br /&gt;
class ContentController extends JController&lt;br /&gt;
{&lt;br /&gt;
    // Methods&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The file name will generally be &#039;&#039;controller.php&#039;&#039; and is located in the component folder.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
com_content&lt;br /&gt;
 / controller.php&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a multi-controller components, such as the Banners in the Administrator, the convention is &#039;&#039;[Component]Controller[Name]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * Banner Client Controller&lt;br /&gt;
 * @package Joomla&lt;br /&gt;
 */&lt;br /&gt;
class BannerControllerClient extends JController&lt;br /&gt;
{&lt;br /&gt;
    // Methods&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The files will be located in a &amp;lt;tt&amp;gt;/controllers/&amp;lt;/tt&amp;gt; folder under the component folder.  The file names will reflect the name of the controller.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
com_banner&lt;br /&gt;
  /controllers/&lt;br /&gt;
    / banner.php&lt;br /&gt;
    / client.php&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Models===&lt;br /&gt;
&lt;br /&gt;
The naming convention is &#039;&#039;[Component]Model[Name]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * Banner Client Model&lt;br /&gt;
 * @package Joomla&lt;br /&gt;
 */&lt;br /&gt;
class BannerModelClient extends JModel&lt;br /&gt;
{&lt;br /&gt;
    // Methods&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The files will be located in a &amp;lt;tt&amp;gt;/models/&amp;lt;/tt&amp;gt; folder under the component folder.  The file names will reflect the name of the model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
com_banner&lt;br /&gt;
  /models/&lt;br /&gt;
    / banner.php&lt;br /&gt;
    / client.php&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Views ===&lt;br /&gt;
The naming convention is &#039;&#039;[Component]View[Name]&#039;&#039;.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * Contact Category View&lt;br /&gt;
 * @package Joomla&lt;br /&gt;
 */&lt;br /&gt;
class ContactViewCategory extends JView&lt;br /&gt;
{&lt;br /&gt;
    // Methods&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The files will be located in a &amp;lt;tt&amp;gt;/view/&amp;lt;/tt&amp;gt; folder under the component folder. The subfolder names will reflect the name of a View.&lt;br /&gt;
&lt;br /&gt;
 com_contact&lt;br /&gt;
  /views/&lt;br /&gt;
    /&#039;&#039;view name 1&#039;&#039;/&lt;br /&gt;
      / view.html.php&lt;br /&gt;
    /&#039;&#039;view name 2&#039;&#039;/&lt;br /&gt;
      / view.html.php&lt;br /&gt;
&lt;br /&gt;
Multi-view components such as com_content may provide an optional &amp;quot;master&amp;quot; view class the specialised views extend from. It is located in the component folder and typically called &#039;&#039;view.php&#039;&#039;. The naming convention is &#039;&#039;[Component]View&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
 com_content&lt;br /&gt;
  /views/&lt;br /&gt;
     &amp;lt;span style=&amp;quot;color:#999&amp;quot;&amp;gt;/archive/&amp;lt;/span&amp;gt;&lt;br /&gt;
       / view.html.php&lt;br /&gt;
     &amp;lt;span style=&amp;quot;color:#999&amp;quot;&amp;gt;/article/&amp;lt;/span&amp;gt;&lt;br /&gt;
  / view.php&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
view.php&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * Content View&lt;br /&gt;
 * @package Joomla&lt;br /&gt;
 */&lt;br /&gt;
class ContentView extends JView&lt;br /&gt;
{&lt;br /&gt;
    // Helper Methods&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
views/archive/view.html.php&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/**&lt;br /&gt;
 * Content Archive View&lt;br /&gt;
 * @package Joomla&lt;br /&gt;
 */&lt;br /&gt;
class ContactViewArchive extends ContentView&lt;br /&gt;
{&lt;br /&gt;
    // Methods&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Plugins ===&lt;br /&gt;
&lt;br /&gt;
The naming convention is &#039;&#039;[Folder]Plugin[Element]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class ContentPluginPagebreak extends JPlugin&lt;br /&gt;
{&lt;br /&gt;
    // Methods&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Layouts ===&lt;br /&gt;
Components may support different Layouts to render the data supplied by a [[#Views|View]] and its [[#Models|Models]]. A Layout file usually contains markup and some PHP code for &#039;&#039;display logic only&#039;&#039;: no functions, no classes.&lt;br /&gt;
&lt;br /&gt;
A Layout consists of at least one .php file and an equally named [[Creating a basic layout.xml file|.xml manifest file]] located in the &amp;lt;tt&amp;gt;/tmpl/&amp;lt;/tt&amp;gt; folder of a View, both reflect the internal name of the Layout. The standard Layout is called &#039;&#039;default&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:#999&amp;quot;&amp;gt;com_content&lt;br /&gt;
   /views/&lt;br /&gt;
     /article/&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000&amp;quot;&amp;gt;&lt;br /&gt;
       /tmpl/&lt;br /&gt;
         / default.php&lt;br /&gt;
         / default.xml&lt;br /&gt;
         / form.php&lt;br /&gt;
         / form.xml&lt;br /&gt;
         / pagebreak.php&lt;br /&gt;
         / pagebreak.xml &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Layout may use supplemental .php files to provide more granule control in order to render individual parts or repetitive items of the data.&lt;br /&gt;
&lt;br /&gt;
Users may customize the Layout output via [[#Template Layout Overrides|Template Layout Overrides]].&lt;br /&gt;
&lt;br /&gt;
=== Templates ===&lt;br /&gt;
&lt;br /&gt;
=== Template Layout Overrides ===&lt;/div&gt;</summary>
		<author><name>Probie715</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Cache&amp;diff=26855</id>
		<title>Cache</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Cache&amp;diff=26855"/>
		<updated>2010-04-26T01:34:21Z</updated>

		<summary type="html">&lt;p&gt;Probie715: corrected typographical errors&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
Joomla has different ways of caching &amp;quot;things&amp;quot;.  Here is an overview for administrators and developers, what, where and when..&lt;br /&gt;
&lt;br /&gt;
=Cache partly broken=&lt;br /&gt;
{{notice| All cache storages except filecache are broken in Joomla 1.5. Though they are all redirected to the filecache since a certain 1.5 version, there still seem to be some problems with this workaround. (See [[Talk:Cache]])}}&lt;br /&gt;
=For Administrators=&lt;br /&gt;
A Joomla administrator can use these caches and options:&lt;br /&gt;
==Page Caching==&lt;br /&gt;
*&#039;&#039;&#039;Configuration&#039;&#039;&#039;: Built-in Plugin (Extensions -&amp;gt; Plugin Manager -&amp;gt; System - Cache)&lt;br /&gt;
*&#039;&#039;&#039;Caches&#039;&#039;&#039;: each whole page of your site&lt;br /&gt;
*&#039;&#039;&#039;Based on&#039;&#039;&#039;: URL&lt;br /&gt;
*&#039;&#039;&#039;More info&#039;&#039;&#039;:&lt;br /&gt;
**Optional browser caching: Also caches on your visitors&#039; browser/computer&lt;br /&gt;
**Only caches pages for guest visitors (not for logged in visitors)&lt;br /&gt;
&lt;br /&gt;
==View Caching==&lt;br /&gt;
*&#039;&#039;&#039;Configuration&#039;&#039;&#039;: Global Config-&amp;gt;Cache&lt;br /&gt;
*&#039;&#039;&#039;Caches&#039;&#039;&#039;: each view of a component&lt;br /&gt;
*&#039;&#039;&#039;Based on&#039;&#039;&#039;: URL, view, parameters, ...&lt;br /&gt;
*&#039;&#039;&#039;More info&#039;&#039;&#039;: Component developers have to include this in their code to work. Mostly this is not done.  The Joomla main content component uses this, but only for guest visitors of your site though this is not obligated for every component. &lt;br /&gt;
==Module Caching==&lt;br /&gt;
*&#039;&#039;&#039;Configuration&#039;&#039;&#039;: Global Config-&amp;gt;Cache&lt;br /&gt;
*&#039;&#039;&#039;Caches&#039;&#039;&#039;: each module (individually customized via each module&#039;s Advanced Parameters)&lt;br /&gt;
*&#039;&#039;&#039;Based on&#039;&#039;&#039;: ?&lt;br /&gt;
*&#039;&#039;&#039;More info&#039;&#039;&#039;: You must disable it on some modules to avoid problems&lt;br /&gt;
==Further Caching==&lt;br /&gt;
If you want to check out other cache systems and possibilities, you might want to check out the third-party extensions around caching.&lt;br /&gt;
==Caching engines or storages==&lt;br /&gt;
*&#039;&#039;&#039;Configuration&#039;&#039;&#039;: Global Config-&amp;gt;Cache&lt;br /&gt;
Here you can choose which system you want your site to use for all caching.  Current options are: APC, Eaccelorator, File, Memcache, XCache.&lt;br /&gt;
&lt;br /&gt;
APC, for example, also caches your php opcode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=For Developers=&lt;br /&gt;
The class &#039;&#039;&#039;[[JCache]]&#039;&#039;&#039; allows a lot of different sorts and levels of caching.  The following sub-classes are made specifically, but you can add your own, or use the main one in many different ways.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget that the first level of cache encountered, will override any deeper caching.  I suppose that too many levels is also counterproductive (&#039;&#039;to be verified though&#039;&#039;).&lt;br /&gt;
*&#039;&#039;&#039;[[JCacheView]]&#039;&#039;&#039; caches and returns the output of a given view (in MVC).  A cache id is automatically generated from the URI, specific view and its specific method, or you can give your own.&lt;br /&gt;
This can automatically be done via the base controller&#039;s display function. For example in the controller of your component:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;class DeliciousController extends JController {&lt;br /&gt;
	function display() {&lt;br /&gt;
		parent::display(true); //true asks for caching.&lt;br /&gt;
	}&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[JCachePage]]&#039;&#039;&#039; caches and returns the body of the page.&lt;br /&gt;
*&#039;&#039;&#039;[[JCacheCallback]]&#039;&#039;&#039; caches and returns the output and results of functions or methods.&lt;br /&gt;
If you want to cache queries, this is a good class for it, as illustrated here: [[Using caching to speed up your code]]&lt;br /&gt;
*&#039;&#039;&#039;[[JCacheOutput]]&#039;&#039;&#039; caches and returns output.&lt;br /&gt;
This is rather meant for caching a specific part of php code. It acts like an output buffer, but cached.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
* [http://forum.joomla.org/viewtopic.php?f=428&amp;amp;t=326990&amp;amp;start=0 Better performance with joomla System Cache plugin (Joomla Forum)]&lt;br /&gt;
* [[JCache]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Development]] [[Category:Cache]] [[Category:Manual]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Probie715</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Creating_a_simple_module&amp;diff=26854</id>
		<title>J1.5:Creating a simple module</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Creating_a_simple_module&amp;diff=26854"/>
		<updated>2010-04-26T01:30:22Z</updated>

		<summary type="html">&lt;p&gt;Probie715: corrected typographical errors&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
== Basic Hello World Module ==&lt;br /&gt;
&lt;br /&gt;
A Joomla! 1.5 Module is in its most basic form two files: an XML configuration file and a PHP controller file. The XML configuration file contains general information about the module (as will be displayed in the Module Manager in the Joomla! administration interface), as well as module parameters which may be supplied to fine tune the appearance / functionality of the module. The PHP file provides the controlling logic for the module. A very simple &amp;quot;Hello World&amp;quot; module might looking something like this.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/modules/mod_hello_world/mod_hello_world.xml:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;!!! Note:&#039;&#039;&#039; it is very important, that XML file name matches module name. Otherwise, installer will install the module, but Joomla wouldn&#039;t show parameters and additional info stored in XML.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;install type=&amp;quot;module&amp;quot; version=&amp;quot;1.5.0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Name of the Module --&amp;gt;&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World - Hello&amp;lt;/name&amp;gt; &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Name of the Author --&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;Ambitionality Software LLC&amp;lt;/author&amp;gt; &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Version Date of the Module --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;2008-06-23&amp;lt;/creationDate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Copyright information --&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;All rights reserved by Ambitionality Software LLC 2008.&amp;lt;/copyright&amp;gt; &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- License Information --&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;GPL 2.0&amp;lt;/license&amp;gt; &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Author&#039;s email address --&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;info@ambitionality.com&amp;lt;/authorEmail&amp;gt; &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Author&#039;s website --&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;www.ambitionality.com&amp;lt;/authorUrl&amp;gt; &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Module version number --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;1.0.0&amp;lt;/version&amp;gt; &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Description of what the module does --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Provides a basic &amp;quot;Hello World&amp;quot; notice&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Listing of all files that should be installed for the module to function --&amp;gt;&lt;br /&gt;
	&amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;!-- The &amp;quot;module&amp;quot; attribute signifies that this is the main controller file --&amp;gt;&lt;br /&gt;
		&amp;lt;filename module=&amp;quot;mod_hello_world&amp;quot;&amp;gt;mod_hello_world.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Optional parameters --&amp;gt;&lt;br /&gt;
	&amp;lt;params /&amp;gt;&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Basically, this XML file just lines out basic information about the module such as the owner, version, etc. for identification by the Joomla! installer and then provides optional parameters which may be set in the Module Manager and accessed from within the module&#039;s logic to fine tune its behavior. Additionally, this file tells the installer which files should be copied and installed. Notice that we DO NOT include a reference in the files section for the XML file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/modules/mod_hello_world/mod_hello_world.php:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
//don&#039;t allow other scripts to grab and execute our file&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Direct Access to this location is not allowed.&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
    Hello World&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What happens when this module is loaded is that Joomla! includes (via the PHP include directive) the mod_hello_world.php file and stores the output into an output buffer which is then rendered onto the page output. This file would simply produce &amp;lt;p&amp;gt;Hello World&amp;lt;/p&amp;gt; to the final page.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/modules/mod_hello_world/index.html:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&amp;lt;body bgcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This really just helps to ensure that a default page is displayed if direct access to the directory is attempted without listing all of the other files in the directory. It&#039;s not necessary, but is good practice.&lt;br /&gt;
&lt;br /&gt;
To package this module for distribution and installation, simply zip the files together, e.g.,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
% cd mod_hello_world&lt;br /&gt;
% zip mod_hello_world.zip mod_hello_world.php mod_hello_world.xml index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting mod_hello_world.zip file may be uploaded and installed through the standard Joomla! 1.5 Extension Manager.&lt;br /&gt;
&lt;br /&gt;
== Real Joomla! 1.5 Style Module Implementation ==&lt;br /&gt;
&lt;br /&gt;
Now that was easy...too easy. In fact, that was pretty much the simplest form of a module possible. In reality a module will probably be doing something much more substantial. Let&#039;s assume that our modules are going to be more complex - we need to take advantage of the MVC (Model View Controller) design pattern and consider using the following file layout for a &amp;quot;Hello World 2&amp;quot; module instead:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
/modules/mod_hello_world2/index.html&lt;br /&gt;
/modules/mod_hello_world2/mod_hello_world2.php&lt;br /&gt;
/modules/mod_hello_world2/mod_hello_world2.xml&lt;br /&gt;
/modules/mod_hello_world2/helper.php&lt;br /&gt;
/modules/mod_hello_world2/en-GB.mod_hello_world2.ini&lt;br /&gt;
/modules/mod_hello_world2/tmpl/index.html&lt;br /&gt;
/modules/mod_hello_world2/tmpl/default.php&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The differences to note here are that there are three additional files beyond what the &amp;quot;Hello World&amp;quot; module had, namely helper.php, tmpl/default.php, and the en-GB.mod_hello_world2.ini file. The purpose in adding the first two files is two-fold. Firstly, we separate the module&#039;s logic into the helper.php file to ensure that all of the thinking and data access is performed here and separate out the module&#039;s presentation / template into the tmpl/default.php file (the (X)HTML). I argue that this is just good programming - separating logic from presentation. There is a second advantage to this, however, which is that it will allow the HTML / presentation to be overridden easily by any Joomla! 1.5 template for optimal integration into any site. (Overriding module and component presentation in templates is beyond the scope of this article, however it should be addressed as it&#039;s really useful).&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a look at what these files might look like and discuss what&#039;s going on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/modules/mod_hello_world2/mod_hello_world2.php:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
//no direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Direct Access to this location is not allowed.&#039;);&lt;br /&gt;
&lt;br /&gt;
// include the helper file&lt;br /&gt;
require_once(dirname(__FILE__).DS.&#039;helper.php&#039;);&lt;br /&gt;
&lt;br /&gt;
// get a parameter from the module&#039;s configuration&lt;br /&gt;
$userCount = $params-&amp;gt;get(&#039;usercount&#039;);&lt;br /&gt;
&lt;br /&gt;
// get the items to display from the helper&lt;br /&gt;
$items = ModHelloWorld2Helper::getItems($userCount);&lt;br /&gt;
&lt;br /&gt;
// include the template for display&lt;br /&gt;
require(JModuleHelper::getLayoutPath(&#039;mod_hello_world2&#039;));&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The important differences to note are that (1) we include a helper file which will be the work-horse of our logic and data access and (2) once we have our data, we just load a template which will use our data and render it as it sees fit.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/modules/mod_hello_world2/mod_hello_world2.xml&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;install type=&amp;quot;module&amp;quot; version=&amp;quot;1.5.0&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Name of the Module --&amp;gt;&lt;br /&gt;
	&amp;lt;name&amp;gt;Hello World 2 - Hello&amp;lt;/name&amp;gt; &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Name of the Author --&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;Ambitionality Software LLC&amp;lt;/author&amp;gt; &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Version Date of the Module --&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;2008-06-23&amp;lt;/creationDate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Copyright information --&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;All rights reserved by Ambitionality Software LLC 2008.&amp;lt;/copyright&amp;gt; &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- License Information --&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;GPL 2.0&amp;lt;/license&amp;gt; &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Author&#039;s email address --&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;info@ambitionality.com&amp;lt;/authorEmail&amp;gt; &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Author&#039;s website --&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;www.ambitionality.com&amp;lt;/authorUrl&amp;gt; &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Module version number --&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;1.0.0&amp;lt;/version&amp;gt; &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Description of what the module does --&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Provides a random listing of registered users&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Listing of all files that should be installed for the module to function --&amp;gt;&lt;br /&gt;
	&amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;!-- The &amp;quot;module&amp;quot; attribute signifies that this is the main controller file --&amp;gt;&lt;br /&gt;
		&amp;lt;filename module=&amp;quot;mod_hello_world2&amp;quot;&amp;gt;mod_hello_world2.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;helper.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;tmpl/default.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
		&amp;lt;filename&amp;gt;tmpl/index.html&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;languages&amp;gt;&lt;br /&gt;
        &amp;lt;!-- Any language files included with the module --&amp;gt;&lt;br /&gt;
        &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;en-GB.mod_hello_world2.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
    &amp;lt;/languages&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Optional parameters --&amp;gt;&lt;br /&gt;
	&amp;lt;params&amp;gt;&lt;br /&gt;
        &amp;lt;!-- parameter to allow placement of a module class suffix for the module table / xhtml display --&amp;gt;&lt;br /&gt;
		&amp;lt;param name=&amp;quot;moduleclass_sfx&amp;quot; type=&amp;quot;text&amp;quot; default=&amp;quot;&amp;quot; label=&amp;quot;Module Class Suffix&amp;quot; description=&amp;quot;PARAMMODULECLASSSUFFIX&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;!-- just gives us a little room between the previous parameter and the next --&amp;gt;&lt;br /&gt;
		&amp;lt;param name=&amp;quot;@spacer&amp;quot; type=&amp;quot;spacer&amp;quot; default=&amp;quot;&amp;quot; label=&amp;quot;&amp;quot; description=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;!-- A parameter that allows an administrator to modify the number of users that this module will display --&amp;gt;&lt;br /&gt;
        &amp;lt;param name=&amp;quot;usercount&amp;quot; type=&amp;quot;text&amp;quot; default=&amp;quot;5&amp;quot; label=&amp;quot;LABEL USER COUNT&amp;quot; description=&amp;quot;DESC USER COUNT&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/params&amp;gt;&lt;br /&gt;
&amp;lt;/install&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main differences to note here are that we have added a language file reference (we could have added more) and we added some parameters.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/modules/mod_hello_world2/helper.php:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Direct Access to this location is not allowed.&#039;);&lt;br /&gt;
&lt;br /&gt;
class ModHelloWorld2Helper&lt;br /&gt;
{&lt;br /&gt;
    /**&lt;br /&gt;
     * Returns a list of post items&lt;br /&gt;
    */&lt;br /&gt;
    public function getItems($userCount)&lt;br /&gt;
    {&lt;br /&gt;
        // get a reference to the database&lt;br /&gt;
        $db = &amp;amp;JFactory::getDBO();&lt;br /&gt;
&lt;br /&gt;
        // get a list of $userCount randomly ordered users &lt;br /&gt;
        $query = &#039;SELECT a.name FROM `#__users` AS a ORDER BY rand() LIMIT &#039; . $userCount  . &#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
        $db-&amp;gt;setQuery($query);&lt;br /&gt;
        $items = ($items = $db-&amp;gt;loadObjectList())?$items:array();&lt;br /&gt;
&lt;br /&gt;
        return $items;&lt;br /&gt;
    } //end getItems&lt;br /&gt;
&lt;br /&gt;
} //end ModHelloWorld2Helper&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This helper class (note that it is named for the module name so that it doesn&#039;t collide with other class names) simply retrieves a list of all users in the database and randomly selects a subset of those based upon the number supplied as $userCount.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/modules/mod_hello_world2/tmpl/default.php:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;); // no direct access ?&amp;gt;&lt;br /&gt;
&amp;lt;?php echo JText::_(&#039;RANDOM USERS&#039;); ?&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;?php foreach ($items as $item) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;&lt;br /&gt;
        &amp;lt;?php echo JText::sprintf(&#039;USER LABEL&#039;, $item-&amp;gt;name); ?&amp;gt;&lt;br /&gt;
    &amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we simply create an unordered HTML list and then iterate through the items returned by our helper (in mod_hello_world2.php), printing out a message with each user&#039;s name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/modules/mod_hello_world2/en-GB.mod_hello_world2.ini:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
LABEL USER COUNT=User Count&lt;br /&gt;
DESC USER COUNT=The number of users to display&lt;br /&gt;
RANDOM USERS=Random Users for Hello World2&lt;br /&gt;
USER LABEL=%s is a randomly selected user&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we simply identify strings which appear in the module configuration file and the module template which appear in JText::_ or JText::sprintf statements. This allows someone to easily write a new language file without editing any of the HTML or code for the module.&lt;br /&gt;
&lt;br /&gt;
Now all we have to do is zip up these files, as in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
% pwd&lt;br /&gt;
/somesite/modules/mod_hello_world2&lt;br /&gt;
% zip -r ../mod_hello_world2.zip *&lt;br /&gt;
% ls ..&lt;br /&gt;
mod_hello_world2.zip&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting mod_hello_world2.zip file is ready for installation and distribution. When the ZIP file is installed, the en-GB.mod_hello_world2.ini file is copied to /language/en-GB/en-GB.mod_hello_world2.ini and is loaded each time the module is loaded. All of the other files are copied to the /modules/mod_hello_world2 subfolder of the Joomla! installation.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Development]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Probie715</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Unable_to_connect_to_the_database&amp;diff=26853</id>
		<title>Unable to connect to the database</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Unable_to_connect_to_the_database&amp;diff=26853"/>
		<updated>2010-04-26T01:25:36Z</updated>

		<summary type="html">&lt;p&gt;Probie715: Corrected misspelling in page title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;startFeed /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{review}}&lt;br /&gt;
== Unable to Connect to the Database: Could Not Connect to MySQL ==&lt;br /&gt;
If during or after installation, you received &amp;quot;&#039;&#039;&#039;Unable to connect to the database&#039;&#039;&#039;&amp;quot; error, verify that you have entered your MySQL database details correctly. The installation script will not allow you to continue unless the details are correct. &lt;br /&gt;
&lt;br /&gt;
If the failure occurs after moving your site to another host, check the following items of your &#039;&#039;configuration.php&#039;&#039; file. The normal database settings are the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var $dbtype = &#039;mysql&#039;;&lt;br /&gt;
var $host = &#039;localhost&#039;;&lt;br /&gt;
var $user = &#039;user_with_database_access&#039;;&lt;br /&gt;
var $db = &#039;the_actual_database_name&#039;;&lt;br /&gt;
var $dbprefix = &#039;table_prefix_&#039;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Most Common Reasons ==&lt;br /&gt;
# Sometimes you will see this message if MySQL has stopped running on your server. Your server administrator may temporarily turn MySQL off to run maintenance utilities. In such circumstances, your site will likely return shortly.&lt;br /&gt;
# Your database user has been deleted. If this is the case, you will need to recreate your database user with the same username and password that existed when you first installed Joomla. Use your domain control panel to administer this or contact your server administrator.&lt;br /&gt;
# Your database username or password has changed.&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Administration FAQ]]&lt;br /&gt;
[[Category:Getting Started FAQ]]&lt;br /&gt;
[[Category:Version 1.5 FAQ]]&lt;br /&gt;
&amp;lt;endFeed /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Probie715</name></author>
	</entry>
</feed>