<?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=BastianW</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=BastianW"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/BastianW"/>
	<updated>2026-08-07T11:55:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=API17:JRequest::getVar&amp;diff=68128</id>
		<title>API17:JRequest::getVar</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=API17:JRequest::getVar&amp;diff=68128"/>
		<updated>2012-07-01T10:12:42Z</updated>

		<summary type="html">&lt;p&gt;BastianW: /* User contributed notes */ added example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
=={{JVer|11.1}} JRequest::getVar==&lt;br /&gt;
===Description===&lt;br /&gt;
Fetches and returns a given variable. &lt;br /&gt;
&lt;br /&gt;
{{Description:JRequest::getVar}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[Description:JRequest::getVar|Edit Descripton]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public static function getVar (&lt;br /&gt;
        $name&lt;br /&gt;
        $default=null&lt;br /&gt;
        $hash= &#039;default&#039;&lt;br /&gt;
        $type= &#039;none&#039;&lt;br /&gt;
        $mask=0&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameter&lt;br /&gt;
!Type&lt;br /&gt;
!Default&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|$name&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|$default&lt;br /&gt;
|&lt;br /&gt;
|null&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|$hash&lt;br /&gt;
|&lt;br /&gt;
|&#039;default&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|$type&lt;br /&gt;
|&lt;br /&gt;
|&#039;none&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|$mask&lt;br /&gt;
|&lt;br /&gt;
|0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Returns&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;Defined&#039;&#039;&#039; on line 92 of libraries/joomla/environment/request.php&lt;br /&gt;
* &#039;&#039;&#039;Referenced by&#039;&#039;&#039;&lt;br /&gt;
** [[JSession::_start/11.1|JSession::_start]]&lt;br /&gt;
** [[JControllerAdmin::checkin/11.1|JControllerAdmin::checkin]]&lt;br /&gt;
** [[JControllerAdmin::delete/11.1|JControllerAdmin::delete]]&lt;br /&gt;
** [[JControllerForm::edit/11.1|JControllerForm::edit]]&lt;br /&gt;
** [[JController::getInstance/11.1|JController::getInstance]]&lt;br /&gt;
** [[JModelList::getUserStateFromRequest/11.1|JModelList::getUserStateFromRequest]]&lt;br /&gt;
** [[JCache::makeId/11.1|JCache::makeId]]&lt;br /&gt;
** [[JControllerAdmin::publish/11.1|JControllerAdmin::publish]]&lt;br /&gt;
** [[JControllerAdmin::reorder/11.1|JControllerAdmin::reorder]]&lt;br /&gt;
** [[JControllerForm::save/11.1|JControllerForm::save]]&lt;br /&gt;
** [[JControllerAdmin::saveorder/11.1|JControllerAdmin::saveorder]]&lt;br /&gt;
===See also===&lt;br /&gt;
* {{JVer|11.1}} &#039;&#039;&#039;JRequest::getVar source code&#039;&#039;&#039; on [[jplatform:environment/request.php#cl-84|BitBucket]]&lt;br /&gt;
* {{JVer|11.1}} Class [[JRequest/11.1|JRequest]]&lt;br /&gt;
* {{JVer|11.1}} Subpackage [[Subpackage_Environment/11.1|Environment]]&lt;br /&gt;
* [[JRequest::getVar|Other versions of JRequest::getVar]]&lt;br /&gt;
{{SeeAlso:JRequest::getVar}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[SeeAlso:JRequest::getVar|Edit See Also]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
===User contributed notes===&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
//Retrieve file details from uploaded file, sent from upload form&lt;br /&gt;
$file = JRequest::getVar(&#039;upload_file&#039;, null, &#039;files&#039;, &#039;array&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CodeExamplesForm /&amp;gt;&lt;br /&gt;
&amp;lt;dpl&amp;gt;&lt;br /&gt;
noresultsheader=\n&lt;br /&gt;
category=JRequest::getVar&lt;br /&gt;
category=CodeExample&lt;br /&gt;
category=MethodExample&lt;br /&gt;
include=*&lt;br /&gt;
namespace=CodeExample&lt;br /&gt;
format= ,,,&lt;br /&gt;
&amp;lt;/dpl&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:JRequest]][[Category:JRequest::getVar]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=API17:JFile::makeSafe&amp;diff=68127</id>
		<title>API17:JFile::makeSafe</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=API17:JFile::makeSafe&amp;diff=68127"/>
		<updated>2012-07-01T09:02:40Z</updated>

		<summary type="html">&lt;p&gt;BastianW: /* User contributed notes */ added example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
=={{JVer|11.1}} JFile::makeSafe==&lt;br /&gt;
===Description===&lt;br /&gt;
Makes file name safe to use. &lt;br /&gt;
&lt;br /&gt;
{{Description:JFile::makeSafe}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[Description:JFile::makeSafe|Edit Descripton]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public static function makeSafe ($file)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameter&lt;br /&gt;
!Type&lt;br /&gt;
!Default&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|$file&lt;br /&gt;
|string&lt;br /&gt;
|&lt;br /&gt;
|The name of the file [not full path]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Returns&#039;&#039;&#039; string The sanitised string&lt;br /&gt;
* &#039;&#039;&#039;Defined&#039;&#039;&#039; on line 60 of libraries/joomla/filesystem/file.php&lt;br /&gt;
* &#039;&#039;&#039;Since&#039;&#039;&#039; {{JVer|11.1 }}&lt;br /&gt;
===See also===&lt;br /&gt;
* {{JVer|11.1}} &#039;&#039;&#039;JFile::makeSafe source code&#039;&#039;&#039; on [[jplatform:filesystem/file.php#cl-52|BitBucket]]&lt;br /&gt;
* {{JVer|11.1}} Class [[JFile/11.1|JFile]]&lt;br /&gt;
* {{JVer|11.1}} Subpackage [[Subpackage_Filesystem/11.1|Filesystem]]&lt;br /&gt;
* [[JFile::makeSafe|Other versions of JFile::makeSafe]]&lt;br /&gt;
{{SeeAlso:JFile::makeSafe}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[SeeAlso:JFile::makeSafe|Edit See Also]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
===User contributed notes===&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
		//Retrieve file details from uploaded file, sent from upload form&lt;br /&gt;
		$file = JRequest::getVar(&#039;upload_file&#039;, null, &#039;files&#039;, &#039;array&#039;);&lt;br /&gt;
				&lt;br /&gt;
		//Import filesystem libraries. Perhaps not necessary, but does not hurt&lt;br /&gt;
		jimport(&#039;joomla.filesystem.file&#039;);&lt;br /&gt;
 &lt;br /&gt;
		//Clean up filename to get rid of strange characters like spaces etc&lt;br /&gt;
		$filename = JFile::makeSafe($file[&#039;name&#039;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CodeExamplesForm /&amp;gt;&lt;br /&gt;
&amp;lt;dpl&amp;gt;&lt;br /&gt;
noresultsheader=\n&lt;br /&gt;
category=JFile::makeSafe&lt;br /&gt;
category=CodeExample&lt;br /&gt;
category=MethodExample&lt;br /&gt;
include=*&lt;br /&gt;
namespace=CodeExample&lt;br /&gt;
format= ,,,&lt;br /&gt;
&amp;lt;/dpl&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:JFile]][[Category:JFile::makeSafe]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=How_to_use_the_filesystem_package&amp;diff=68126</id>
		<title>How to use the filesystem package</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=How_to_use_the_filesystem_package&amp;diff=68126"/>
		<updated>2012-07-01T08:56:43Z</updated>

		<summary type="html">&lt;p&gt;BastianW: /* Example */  added note that enctype=&amp;quot;multipart/form-data&amp;quot; is a must have here.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Using the JFILE:: class=&lt;br /&gt;
&lt;br /&gt;
There are 4 classes in the J15 filesystem library.&lt;br /&gt;
&lt;br /&gt;
* JFile:: (file.php)&lt;br /&gt;
* JFolder:: (folder.php)&lt;br /&gt;
* JPath:: (path.php)&lt;br /&gt;
* JArchive:: (archive.php)[/i]&lt;br /&gt;
&lt;br /&gt;
For this first tutorial, I will focus on the JFile:: class.&lt;br /&gt;
&lt;br /&gt;
The base for filehandling is the JFile class, found in libraries/joomla/filesystem/file.php&lt;br /&gt;
Below I will discuss the most common options from this library file. At the end of this post, I put it together in a very simple script for file upload.&lt;br /&gt;
&lt;br /&gt;
==Get file extension==&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
$ext =  JFile::getExt($filename);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pretty clear, just feed the function with a filename and it will return the extension of the file you selected.&lt;br /&gt;
&lt;br /&gt;
==Strip file extension==&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
$name = JFile::stripExt($filename);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will return the filename without the extension.&lt;br /&gt;
&lt;br /&gt;
==Clean filename==&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
$safefilename = JFile::makeSafe($filename);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It cleans out all odd characters from a filename and returns a safe filename.&lt;br /&gt;
&lt;br /&gt;
==Copy a file==&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
JFile::copy($src, $dest);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It is basically a wrapper for the PHP copy() function, but also checks if the file you want to copy exists and the destination really is available. Great thing is that this function also makes use of the FTP-layer in J15 if necessary.&lt;br /&gt;
&lt;br /&gt;
==Delete a file==&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
JFile::delete($path.$file);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It tries to delete the file, making sure it is actually existing, but also checks permissions. If permissions are not set up properly, it tries to change them and delete the file. It also uses the FTP-layer when necessary.&lt;br /&gt;
&lt;br /&gt;
==Upload a file==&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
JFile::upload($src, $dest);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It is basically the wrapper for the PHP move_uploaded_file() function, but also does checks availability and permissions on both source and destination path.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
So how does that look in a script? I put up a small code snippet of an upload script. Some of the functions are used.&lt;br /&gt;
The script is fired from an upload form. That form has a file element, called file_upload (see below).&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
&amp;lt;form name=&amp;quot;upload&amp;quot; method=&amp;quot;post&amp;quot; enctype=&amp;quot;multipart/form-data&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;file_upload&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;submit&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
If you didn´t add the part: enctype=&amp;quot;multipart/form-data&amp;quot; then you are unable to upload a file!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upload code looks like this:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
***********************&lt;br /&gt;
*                     *&lt;br /&gt;
* File upload example *&lt;br /&gt;
*                     *&lt;br /&gt;
***********************&lt;br /&gt;
//Retrieve file details from uploaded file, sent from upload form&lt;br /&gt;
$file = JRequest::getVar(&#039;file_upload&#039;, null, &#039;files&#039;, &#039;array&#039;);&lt;br /&gt;
&lt;br /&gt;
//Import filesystem libraries. Perhaps not necessary, but does not hurt&lt;br /&gt;
jimport(&#039;joomla.filesystem.file&#039;);&lt;br /&gt;
&lt;br /&gt;
//Clean up filename to get rid of strange characters like spaces etc&lt;br /&gt;
$filename = JFile::makeSafe($file[&#039;name&#039;]);&lt;br /&gt;
&lt;br /&gt;
//Set up the source and destination of the file&lt;br /&gt;
$src = $file[&#039;tmp_name&#039;];&lt;br /&gt;
$dest = JPATH_COMPONENT . DS . &amp;quot;uploads&amp;quot; . DS . $filename;&lt;br /&gt;
&lt;br /&gt;
//First check if the file has the right extension, we need jpg only&lt;br /&gt;
if ( strtolower(JFile::getExt($filename) ) == &#039;jpg&#039;) {&lt;br /&gt;
   if ( JFile::upload($src, $dest) ) {&lt;br /&gt;
      //Redirect to a page of your choice&lt;br /&gt;
   } else {&lt;br /&gt;
      //Redirect and throw an error message&lt;br /&gt;
   }&lt;br /&gt;
} else {&lt;br /&gt;
   //Redirect and notify user file is not right extension&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Upload - Full Sample=&lt;br /&gt;
&lt;br /&gt;
Little sample where admin choose the file type or all, enter the users to access the form upload.&lt;br /&gt;
Folder to upload files in Joomla directory or with absolute path.&lt;br /&gt;
Only selected users access the form upload.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mod_simpleupload.xml&lt;br /&gt;
&amp;lt;source lang=xml&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&amp;gt;Simple Upload 1.3&amp;lt;/name&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;Ribamar FS&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;creationDate&amp;gt;fevereiro 2010&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
	&amp;lt;copyright&amp;gt;(C) 2005 Open Source Matters. All rights reserved.&amp;lt;/copyright&amp;gt;&lt;br /&gt;
	&amp;lt;license&amp;gt;http://www.gnu.org/copyleft/gpl.html GNU/GPL&amp;lt;/license&amp;gt;&lt;br /&gt;
	&amp;lt;authorEmail&amp;gt;ribafs@gmail.com&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
	&amp;lt;authorUrl&amp;gt;http://ribafs.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;1.3&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Simple Upload 1.3 - Simple upload with Joomla Framework.&amp;lt;/description&amp;gt;&lt;br /&gt;
	&amp;lt;files&amp;gt;&lt;br /&gt;
		&amp;lt;filename module=&amp;quot;mod_simpleupload&amp;quot;&amp;gt;mod_simpleupload.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;/files&amp;gt;&lt;br /&gt;
	&amp;lt;params&amp;gt;&lt;br /&gt;
		&amp;lt;param name=&amp;quot;dir&amp;quot; type=&amp;quot;text&amp;quot; label=&amp;quot;Directory&amp;quot; description=&amp;quot;Directory Upload&amp;quot; default=&amp;quot;upload&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;param name=&amp;quot;type&amp;quot; type=&amp;quot;list&amp;quot; default=&amp;quot;*&amp;quot; label=&amp;quot;Select a file type&amp;quot; description=&amp;quot;File type&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;option value=&amp;quot;*&amp;quot;&amp;gt;Any File &amp;lt;/option&amp;gt;&lt;br /&gt;
             &amp;lt;option value=&amp;quot;image/png&amp;quot;&amp;gt;PNG&amp;lt;/option&amp;gt;&lt;br /&gt;
             &amp;lt;option value=&amp;quot;image/gif&amp;quot;&amp;gt;GIF&amp;lt;/option&amp;gt;&lt;br /&gt;
             &amp;lt;option value=&amp;quot;image/jpeg&amp;quot;&amp;gt;JPEG&amp;lt;/option&amp;gt;&lt;br /&gt;
             &amp;lt;option value=&amp;quot;application/zip&amp;quot;&amp;gt;ZIP&amp;lt;/option&amp;gt;&lt;br /&gt;
             &amp;lt;option value=&amp;quot;application/x-gzip&amp;quot;&amp;gt;TAR.GZ&amp;lt;/option&amp;gt;&lt;br /&gt;
             &amp;lt;option value=&amp;quot;text/html&amp;quot;&amp;gt;HTML&amp;lt;/option&amp;gt;&lt;br /&gt;
             &amp;lt;option value=&amp;quot;text/plain&amp;quot;&amp;gt;TXT&amp;lt;/option&amp;gt;&lt;br /&gt;
             &amp;lt;option value=&amp;quot;application/pdf&amp;quot;&amp;gt;PDF&amp;lt;/option&amp;gt;&lt;br /&gt;
             &amp;lt;option value=&amp;quot;application/msword&amp;quot;&amp;gt;DOC&amp;lt;/option&amp;gt;&lt;br /&gt;
           &amp;lt;/param&amp;gt;          &lt;br /&gt;
		&amp;lt;param name=&amp;quot;user_names&amp;quot; type=&amp;quot;text&amp;quot; label=&amp;quot;User Names (optional)&amp;quot; description=&amp;quot;Names users (optionas)&amp;quot; default=&amp;quot;&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;
mod_simpleupload.php&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// no direct access&lt;br /&gt;
defined(&#039;_JEXEC&#039;) or die(&#039;Restricted access&#039;);&lt;br /&gt;
&lt;br /&gt;
//Import filesystem libraries. Perhaps not necessary, but does not hurt&lt;br /&gt;
jimport(&#039;joomla.filesystem.file&#039;);&lt;br /&gt;
&lt;br /&gt;
$max = ini_get(&#039;upload_max_filesize&#039;);&lt;br /&gt;
$module_dir = $params-&amp;gt;get( &#039;dir&#039; );&lt;br /&gt;
$file_type = $params-&amp;gt;get( &#039;type&#039; );&lt;br /&gt;
&lt;br /&gt;
$user_names = $params-&amp;gt;get( &#039;user_names&#039; );&lt;br /&gt;
$msg = &#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
function fileUpload($max, $module_dir, $file_type, $msg){&lt;br /&gt;
	//Retrieve file details from uploaded file, sent from upload form&lt;br /&gt;
	$file = JRequest::getVar(&#039;file_upload&#039;, null, &#039;files&#039;, &#039;array&#039;); &lt;br /&gt;
	// Retorna: Array ( [name] =&amp;gt; mod_simpleupload_1.2.1.zip [type] =&amp;gt; application/zip &lt;br /&gt;
	// [tmp_name] =&amp;gt; /tmp/phpo3VG9F [error] =&amp;gt; 0 [size] =&amp;gt; 4463 ) &lt;br /&gt;
&lt;br /&gt;
	if(isset($file)){ &lt;br /&gt;
		//Clean up filename to get rid of strange characters like spaces etc&lt;br /&gt;
		$filename = JFile::makeSafe($file[&#039;name&#039;]);&lt;br /&gt;
&lt;br /&gt;
		if($file[&#039;size&#039;] &amp;gt; $max) $msg = JText::_(&#039;ONLY_FILES_UNDER&#039;).&#039; &#039;.$max;&lt;br /&gt;
		//Set up the source and destination of the file&lt;br /&gt;
&lt;br /&gt;
		$src = $file[&#039;tmp_name&#039;];&lt;br /&gt;
		$dest = $module_dir . DS . $filename;&lt;br /&gt;
&lt;br /&gt;
		//First check if the file has the right extension, we need jpg only&lt;br /&gt;
		if ($file[&#039;type&#039;] == $file_type || $file_type == &#039;*&#039;) { &lt;br /&gt;
		   if ( JFile::upload($src, $dest) ) {&lt;br /&gt;
&lt;br /&gt;
  		       //Redirect to a page of your choice&lt;br /&gt;
			$msg = JText::_(&#039;FILE_SAVE_AS&#039;).&#039; &#039;.$dest;&lt;br /&gt;
		   } else {&lt;br /&gt;
			  //Redirect and throw an error message&lt;br /&gt;
			$msg = JText::_(&#039;ERROR_IN_UPLOAD&#039;);&lt;br /&gt;
		   }&lt;br /&gt;
		} else {&lt;br /&gt;
		   //Redirect and notify user file is not right extension&lt;br /&gt;
			$msg = JText::_(&#039;FILE_TYPE_INVALID&#039;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		$msg = &amp;quot;&amp;lt;script&amp;gt;alert(&#039;&amp;quot;. $msg .&amp;quot;&#039;);&amp;lt;/script&amp;gt;&amp;quot;;&lt;br /&gt;
	}&lt;br /&gt;
	return $msg;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$user =&amp;amp; JFactory::getUser();&lt;br /&gt;
$username = $user-&amp;gt;get(&#039;username&#039;);&lt;br /&gt;
&lt;br /&gt;
$acc = 0;&lt;br /&gt;
$session =&amp;amp; JFactory::getSession(); &lt;br /&gt;
&lt;br /&gt;
if(isset($user_names)) {&lt;br /&gt;
	$more = strpos($user_names, &#039;,&#039;,0);&lt;br /&gt;
	if($more &amp;gt;0){&lt;br /&gt;
		$user_names = explode(&#039;,&#039;,$user_names);&lt;br /&gt;
		foreach($user_names as $un){&lt;br /&gt;
			if($un == $username) {&lt;br /&gt;
				$session-&amp;gt;set($acc, 1); &lt;br /&gt;
			}else{&lt;br /&gt;
				$session-&amp;gt;set($acc, 0); &lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}else{&lt;br /&gt;
		if ($user_names == $username) $session-&amp;gt;set($acc, 1); &lt;br /&gt;
	}&lt;br /&gt;
}else{&lt;br /&gt;
	if(isset($username)) $session-&amp;gt;set($acc, 1); &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if($session-&amp;gt;get($acc) == 1){&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form name=&amp;quot;imgform&amp;quot; method=&amp;quot;post&amp;quot; action=&amp;quot;&amp;quot; enctype=&amp;quot;multipart/form-data&amp;quot; onSubmit=&amp;quot;if(file_upload.value==&#039;&#039;) {alert(&#039;Choose a file!&#039;);return false;}&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;?php echo JText::_(&#039;CHOOSE_FILE&#039;); ?&amp;gt; &amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;file_upload&amp;quot; size=&amp;quot;10&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;input name=&amp;quot;submit&amp;quot; type=&amp;quot;submit&amp;quot; value=&amp;quot;Upload&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
	print fileUpload($max, $module_dir, $file_type, $msg);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Adapted from http://docs.joomla.org/How_to_use_the_filesystem_package&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Using the JFolder:: class=&lt;br /&gt;
The base for folder handling is the JFolder class, found in libraries/joomla/filesystem/folder.php&lt;br /&gt;
Below I will discuss the most common options from this library file. At the end of this post, I put it together in a very simple script as an exmaple&lt;br /&gt;
&lt;br /&gt;
==Copy folder==&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
JFolder::copy($src, $dest, $path, $force);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will copy a complete folder and all of it’s contents to another location on the server. It does permission and availability checking on both source and destination. By using $path you can enter a basepath to prefix to the filename and by setting the $force parameter to true, you can force the overwriting of already existing files. If set in the configuration, the FTP-layer will be used.&lt;br /&gt;
&lt;br /&gt;
==Create folder==&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
JFolder::create($path, $mode);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is basically a wrapper for the php mkdir() function, but with error permissions and availability checking. This one also uses the FTP-layer when set in the configuration. $mode will set the default permission, once copied and defaults to 0755.&lt;br /&gt;
&lt;br /&gt;
==Move folder==&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
JFolder::move($src, $dest);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Basically a wrapper for the php rename() function, but with permissions and availability checking. This one also uses the FTP-layer when set in the configuration.&lt;br /&gt;
&lt;br /&gt;
==Check if folder exists==&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
JFolder::exists($path);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Wrapper for the php is_dir() function. Pretty straightforward, returns true if folder exists.&lt;br /&gt;
&lt;br /&gt;
==Read files from folder==&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
JFolder::files($path, $filter = &#039;.&#039;, $recurse, $fullpath , $exclude);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Function to read files from a folder. When setting $recurse to true, also subfolders will be searched. $fullpath set to true returns the full path in the array. With $exclude, you can offer an array of extensions, not to include in the search for files. It returns an array with all filenames.&lt;br /&gt;
&lt;br /&gt;
==Read folders from filesystem==&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
JFolder::folders($path, $filter = &#039;.&#039;, $recurse, $fullpath , $exclude);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Exactly the same as JFolder::files(), except this does only return an array with foldernames.&lt;br /&gt;
&lt;br /&gt;
==Make a tree like list from a folder structure==&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
JFolder::listFolderTree($path, $filter, $maxLevel = 3, $level = 0, $parent = 0);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It will read a folder, specified in $path and will return all folders in an array, suitable for tree display. You can specify the number of levels. The folder array looks like this:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
Array&lt;br /&gt;
(&lt;br /&gt;
    [0] =&amp;gt; Array&lt;br /&gt;
        (&lt;br /&gt;
            [id] =&amp;gt; 1&lt;br /&gt;
            [parent] =&amp;gt; 0&lt;br /&gt;
            [name] =&amp;gt; administrator&lt;br /&gt;
            [fullname] =&amp;gt; g:/joomla_1012/administrator&lt;br /&gt;
            [relname] =&amp;gt; g:/joomla_1012/administrator&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
    [1] =&amp;gt; Array&lt;br /&gt;
        (&lt;br /&gt;
            [id] =&amp;gt; 2&lt;br /&gt;
            [parent] =&amp;gt; 1&lt;br /&gt;
            [name] =&amp;gt; backups&lt;br /&gt;
            [fullname] =&amp;gt; g:/joomla_1012/administrator/backups&lt;br /&gt;
            [relname] =&amp;gt; g:/joomla_1012/administrator/backups&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
    [2] =&amp;gt; Array&lt;br /&gt;
        (&lt;br /&gt;
            [id] =&amp;gt; 3&lt;br /&gt;
            [parent] =&amp;gt; 1&lt;br /&gt;
            [name] =&amp;gt; components&lt;br /&gt;
            [fullname] =&amp;gt; g:/joomla_1012/administrator/components&lt;br /&gt;
            [relname] =&amp;gt; g:/joomla_1012/administrator/components&lt;br /&gt;
        )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Clean a path string==&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
JFolder::makeSafe($path);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Identically to the JFile::makeSafe() function. It cleans all odd characters out of the string and returns a clean path.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Ok, and how does this look in actual code. We are going to read the contents of a folder called images. In it, al large number of files are placed. We want to create a subfolder, called jpg and filter all jpg files out and move them to the jpg subfolder. After that, we will move the complete subfolder to another place on the server.&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
//First we set up parameters&lt;br /&gt;
$searchpath = JPATH_COMPONENT . DS . &amp;quot;images&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
//Then we create the subfolder called jpg&lt;br /&gt;
if ( !JFolder::create($searchpath . DS . &amp;quot;jpg&amp;quot;) ) {&lt;br /&gt;
   //Throw error message and stop script&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//Now we read all jpg files and put them in an array.&lt;br /&gt;
$jpg_files = JFolder::files($searchpath, &#039;.jpg&#039;);&lt;br /&gt;
&lt;br /&gt;
//Now we need some stuff from the JFile:: class to move all files into the new folder&lt;br /&gt;
foreach ($jpg_files as $file) {&lt;br /&gt;
   JFile::move($searchpath. DS . $file, $searchpath . DS. &amp;quot;jpg&amp;quot; . $file);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//Lastly, we are moving the complete subdir to the root of the component.&lt;br /&gt;
if (JFolder::move($searchpath . DS. &amp;quot;jpg&amp;quot;, $JPATH_COMPONENT) ) {&lt;br /&gt;
   //Redirect with perhaps a happy message&lt;br /&gt;
} else {&lt;br /&gt;
   //Throw an error&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is example script only, but gives a general idea of the possibilities. I did not touch other stuff like JError to keep it clean and simple.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Development]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=API17:JFile&amp;diff=68125</id>
		<title>API17:JFile</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=API17:JFile&amp;diff=68125"/>
		<updated>2012-07-01T08:54:49Z</updated>

		<summary type="html">&lt;p&gt;BastianW: /* See also */  added crosslink to: How to use the filesystem package&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
=={{JVer|11.1}} JFile==&lt;br /&gt;
===Description===&lt;br /&gt;
{{Description:JFile}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[Description:JFile|Edit Descripton]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
===Methods===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Visibility&lt;br /&gt;
!Method name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JFile::copy/11.1|copy]]&lt;br /&gt;
|Copies a file. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JFile::delete/11.1|delete]]&lt;br /&gt;
|Delete a file or array of files. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JFile::exists/11.1|exists]]&lt;br /&gt;
|Wrapper for the standard file_exists function. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JFile::getExt/11.1|getExt]]&lt;br /&gt;
|Gets the extension of a file name. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JFile::getName/11.1|getName]]&lt;br /&gt;
|Returns the name, without any path. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JFile::makeSafe/11.1|makeSafe]]&lt;br /&gt;
|Makes file name safe to use. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JFile::move/11.1|move]]&lt;br /&gt;
|Moves a file. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JFile::read/11.1|read]]&lt;br /&gt;
|Read the contents of a file. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JFile::stripExt/11.1|stripExt]]&lt;br /&gt;
|Strips the last extension off a file name. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JFile::upload/11.1|upload]]&lt;br /&gt;
|Moves an uploaded file to a destination folder. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JFile::write/11.1|write]]&lt;br /&gt;
|Write contents to a file. &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Defined in&#039;&#039;&#039; libraries/joomla/filesystem/file.php&lt;br /&gt;
===Importing===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;jimport( &#039;joomla.filesystem.file&#039; );&amp;lt;/source&amp;gt;&lt;br /&gt;
===See also===&lt;br /&gt;
* {{JVer|11.1}} &#039;&#039;&#039;JFile source code&#039;&#039;&#039; on [[jplatform:filesystem/file.php|BitBucket]]&lt;br /&gt;
* {{JVer|11.1}} Subpackage [[Subpackage Filesystem/11.1|Filesystem]]&lt;br /&gt;
* [[JFile|Other versions of JFile]]&lt;br /&gt;
* [[How_to_use_the_filesystem_package|How to use the filesystem package]]&lt;br /&gt;
{{SeeAlso:JFile}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[SeeAlso:JFile|Edit See Also]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===User contributed notes===&lt;br /&gt;
&amp;lt;CodeExamplesForm /&amp;gt;&lt;br /&gt;
&amp;lt;dpl&amp;gt;&lt;br /&gt;
noresultsheader=\n&lt;br /&gt;
category=JFile&lt;br /&gt;
category=CodeExample&lt;br /&gt;
category=ClassExample&lt;br /&gt;
include=*&lt;br /&gt;
namespace=CodeExample&lt;br /&gt;
format= ,,,&lt;br /&gt;
&amp;lt;/dpl&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Platform]][[Category:Platform 11.1]][[Category:JFile]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=API17:JError&amp;diff=68124</id>
		<title>API17:JError</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=API17:JError&amp;diff=68124"/>
		<updated>2012-07-01T07:47:55Z</updated>

		<summary type="html">&lt;p&gt;BastianW: /* See also */ added crosslink to : &amp;quot;Display error messages and notices&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
=={{JVer|11.1}} JError==&lt;br /&gt;
===Description===&lt;br /&gt;
{{Description:JError}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[Description:JError|Edit Descripton]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
===Note===&lt;br /&gt;
JError is deprecated use PHP exceptions instead&lt;br /&gt;
&lt;br /&gt;
===Methods===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Visibility&lt;br /&gt;
!Method name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::addToStack/11.1|addToStack]]&lt;br /&gt;
|Method to add non-JError thrown JExceptions to the  stack for debugging purposes. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::attachHandler/11.1|attachHandler]]&lt;br /&gt;
|Method that attaches the error handler to . &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::customErrorHandler/11.1|customErrorHandler]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::customErrorPage/11.1|customErrorPage]]&lt;br /&gt;
|Display a custom error page and exit gracefully. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::detachHandler/11.1|detachHandler]]&lt;br /&gt;
|Method that detaches the error handler from . &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::getError/11.1|getError]]&lt;br /&gt;
|Method for retrieving the last exception object in the error stack. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::getErrorHandling/11.1|getErrorHandling]]&lt;br /&gt;
|Method to get the current error handler settings for a specified error level. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::getErrors/11.1|getErrors]]&lt;br /&gt;
|Method for retrieving the exception stack. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::handleCallback/11.1|handleCallback]]&lt;br /&gt;
|Callback error handler&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::handleDie/11.1|handleDie]]&lt;br /&gt;
|Die error handler&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::handleEcho/11.1|handleEcho]]&lt;br /&gt;
|Echo error handler&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::handleIgnore/11.1|handleIgnore]]&lt;br /&gt;
|Ignore error handler&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::handleLog/11.1|handleLog]]&lt;br /&gt;
|Log error handler&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::handleMessage/11.1|handleMessage]]&lt;br /&gt;
|Message error handler&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::handleVerbose/11.1|handleVerbose]]&lt;br /&gt;
|Verbose error handler&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::isError/11.1|isError]]&lt;br /&gt;
|Method to determine if a value is an exception object. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::raise/11.1|raise]]&lt;br /&gt;
|Create a new  object given the passed arguments. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::raiseError/11.1|raiseError]]&lt;br /&gt;
|Wrapper method for the  method with predefined error level of E_ERROR and backtrace set to true. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::raiseNotice/11.1|raiseNotice]]&lt;br /&gt;
|Wrapper method for the  method with predefined error level of E_NOTICE and backtrace set to false. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::raiseWarning/11.1|raiseWarning]]&lt;br /&gt;
|Wrapper method for the  method with predefined error level of E_WARNING and backtrace set to false. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::registerErrorLevel/11.1|registerErrorLevel]]&lt;br /&gt;
|Method to register a new error level for handling errors. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::renderBacktrace/11.1|renderBacktrace]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::setErrorHandling/11.1|setErrorHandling]]&lt;br /&gt;
|Method to set the way the  will handle different error levels. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::throwError/11.1|throwError]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JError::translateErrorLevel/11.1|translateErrorLevel]]&lt;br /&gt;
|Translate an error level integer to a human readable string e.g. &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Defined in&#039;&#039;&#039; libraries/joomla/error/error.php&lt;br /&gt;
===Importing===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;jimport( &#039;joomla.error.error&#039; );&amp;lt;/source&amp;gt;&lt;br /&gt;
===See also===&lt;br /&gt;
* {{JVer|11.1}} &#039;&#039;&#039;JError source code&#039;&#039;&#039; on [[jplatform:error/error.php|BitBucket]]&lt;br /&gt;
* {{JVer|11.1}} Subpackage [[Subpackage Error/11.1|Error]]&lt;br /&gt;
* [[JError|Other versions of JError]]&lt;br /&gt;
* [[Display_error_messages_and_notices|Display error messages and notices]]&lt;br /&gt;
{{SeeAlso:JError}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[SeeAlso:JError|Edit See Also]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
===User contributed notes===&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=API17:JRequest::getInt&amp;diff=68119</id>
		<title>API17:JRequest::getInt</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=API17:JRequest::getInt&amp;diff=68119"/>
		<updated>2012-07-01T07:26:43Z</updated>

		<summary type="html">&lt;p&gt;BastianW: /* User contributed notes */ added example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
=={{JVer|11.1}} JRequest::getInt==&lt;br /&gt;
===Description===&lt;br /&gt;
Fetches and returns a given filtered variable. &lt;br /&gt;
&lt;br /&gt;
{{Description:JRequest::getInt}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[Description:JRequest::getInt|Edit Descripton]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public static function getInt (&lt;br /&gt;
        $name&lt;br /&gt;
        $default=0&lt;br /&gt;
        $hash= &#039;default&#039;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameter&lt;br /&gt;
!Type&lt;br /&gt;
!Default&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|$name&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|$default&lt;br /&gt;
|&lt;br /&gt;
|0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|$hash&lt;br /&gt;
|&lt;br /&gt;
|&#039;default&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Returns&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;Defined&#039;&#039;&#039; on line 175 of libraries/joomla/environment/request.php&lt;br /&gt;
* &#039;&#039;&#039;Referenced by&#039;&#039;&#039;&lt;br /&gt;
** [[JModuleHelper::_load/11.1|JModuleHelper::_load]]&lt;br /&gt;
** [[JHtmlTabs::_loadBehavior/11.1|JHtmlTabs::_loadBehavior]]&lt;br /&gt;
** [[JHtmlSliders::_loadBehavior/11.1|JHtmlSliders::_loadBehavior]]&lt;br /&gt;
** [[JControllerForm::cancel/11.1|JControllerForm::cancel]]&lt;br /&gt;
** [[JControllerForm::edit/11.1|JControllerForm::edit]]&lt;br /&gt;
** [[JFormFieldRules::getInput/11.1|JFormFieldRules::getInput]]&lt;br /&gt;
** [[JModelAdmin::populateState/11.1|JModelAdmin::populateState]]&lt;br /&gt;
** [[JControllerForm::save/11.1|JControllerForm::save]]&lt;br /&gt;
===See also===&lt;br /&gt;
* {{JVer|11.1}} &#039;&#039;&#039;JRequest::getInt source code&#039;&#039;&#039; on [[jplatform:environment/request.php#cl-167|BitBucket]]&lt;br /&gt;
* {{JVer|11.1}} Class [[JRequest/11.1|JRequest]]&lt;br /&gt;
* {{JVer|11.1}} Subpackage [[Subpackage_Environment/11.1|Environment]]&lt;br /&gt;
* [[JRequest::getInt|Other versions of JRequest::getInt]]&lt;br /&gt;
{{SeeAlso:JRequest::getInt}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[SeeAlso:JRequest::getInt|Edit See Also]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
===User contributed notes===&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$ourresult   = JRequest::getInt( &#039;inputbox&#039;,              0,                        &#039;post&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CodeExamplesForm /&amp;gt;&lt;br /&gt;
&amp;lt;dpl&amp;gt;&lt;br /&gt;
noresultsheader=\n&lt;br /&gt;
category=JRequest::getInt&lt;br /&gt;
category=CodeExample&lt;br /&gt;
category=MethodExample&lt;br /&gt;
include=*&lt;br /&gt;
namespace=CodeExample&lt;br /&gt;
format= ,,,&lt;br /&gt;
&amp;lt;/dpl&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:JRequest]][[Category:JRequest::getInt]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=API17:JRequest::getBool&amp;diff=68118</id>
		<title>API17:JRequest::getBool</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=API17:JRequest::getBool&amp;diff=68118"/>
		<updated>2012-07-01T07:25:44Z</updated>

		<summary type="html">&lt;p&gt;BastianW: /* User contributed notes */ added example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
=={{JVer|11.1}} JRequest::getBool==&lt;br /&gt;
===Description===&lt;br /&gt;
Fetches and returns a given filtered variable. &lt;br /&gt;
&lt;br /&gt;
{{Description:JRequest::getBool}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[Description:JRequest::getBool|Edit Descripton]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public static function getBool (&lt;br /&gt;
        $name&lt;br /&gt;
        $default=false&lt;br /&gt;
        $hash= &#039;default&#039;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameter&lt;br /&gt;
!Type&lt;br /&gt;
!Default&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|$name&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|$default&lt;br /&gt;
|&lt;br /&gt;
|false&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|$hash&lt;br /&gt;
|&lt;br /&gt;
|&#039;default&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Returns&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;Defined&#039;&#039;&#039; on line 213 of libraries/joomla/environment/request.php&lt;br /&gt;
* &#039;&#039;&#039;Referenced by&#039;&#039;&#039;&lt;br /&gt;
** [[JModuleHelper::getModules/11.1|JModuleHelper::getModules]]&lt;br /&gt;
** [[JModuleHelper::renderModule/11.1|JModuleHelper::renderModule]]&lt;br /&gt;
===See also===&lt;br /&gt;
* {{JVer|11.1}} &#039;&#039;&#039;JRequest::getBool source code&#039;&#039;&#039; on [[jplatform:environment/request.php#cl-205|BitBucket]]&lt;br /&gt;
* {{JVer|11.1}} Class [[JRequest/11.1|JRequest]]&lt;br /&gt;
* {{JVer|11.1}} Subpackage [[Subpackage_Environment/11.1|Environment]]&lt;br /&gt;
* [[JRequest::getBool|Other versions of JRequest::getBool]]&lt;br /&gt;
{{SeeAlso:JRequest::getBool}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[SeeAlso:JRequest::getBool|Edit See Also]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
===User contributed notes===&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$ourresult   = JRequest::getBool( &#039;inputcheckbox&#039;,              false,                        &#039;post&#039; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CodeExamplesForm /&amp;gt;&lt;br /&gt;
&amp;lt;dpl&amp;gt;&lt;br /&gt;
noresultsheader=\n&lt;br /&gt;
category=JRequest::getBool&lt;br /&gt;
category=CodeExample&lt;br /&gt;
category=MethodExample&lt;br /&gt;
include=*&lt;br /&gt;
namespace=CodeExample&lt;br /&gt;
format= ,,,&lt;br /&gt;
&amp;lt;/dpl&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:JRequest]][[Category:JRequest::getBool]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=API17:JRequest&amp;diff=68109</id>
		<title>API17:JRequest</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=API17:JRequest&amp;diff=68109"/>
		<updated>2012-07-01T07:14:32Z</updated>

		<summary type="html">&lt;p&gt;BastianW: /* See also */ added link to &amp;quot;Retrieving and Filtering GET and POST requests with JRequest::getVar&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
=={{JVer|11.1}} JRequest==&lt;br /&gt;
===Description===&lt;br /&gt;
{{Description:JRequest}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[Description:JRequest|Edit Descripton]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
===Note===&lt;br /&gt;
JRequest is deprecated get the [[JInput/11.1]] object from the application instead&lt;br /&gt;
===Methods===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Visibility&lt;br /&gt;
!Method name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JRequest::_cleanArray/11.1|_cleanArray]]&lt;br /&gt;
|Adds an array to the GLOBALS array and checks that the GLOBALS variable is not being attacked. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JRequest::_cleanVar/11.1|_cleanVar]]&lt;br /&gt;
|Clean up an input variable. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JRequest::checkToken/11.1|checkToken]]&lt;br /&gt;
|Checks for a form token in the request. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JRequest::clean/11.1|clean]]&lt;br /&gt;
|Cleans the request from script injection. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JRequest::get/11.1|get]]&lt;br /&gt;
|Fetches and returns a request array. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JRequest::getBool/11.1|getBool]]&lt;br /&gt;
|Fetches and returns a given filtered variable. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JRequest::getCmd/11.1|getCmd]]&lt;br /&gt;
|Fetches and returns a given filtered variable. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JRequest::getFloat/11.1|getFloat]]&lt;br /&gt;
|Fetches and returns a given filtered variable. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JRequest::getInt/11.1|getInt]]&lt;br /&gt;
|Fetches and returns a given filtered variable. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JRequest::getMethod/11.1|getMethod]]&lt;br /&gt;
|Gets the request method. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JRequest::getString/11.1|getString]]&lt;br /&gt;
|Fetches and returns a given filtered variable. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JRequest::getURI/11.1|getURI]]&lt;br /&gt;
|Gets the full request path. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JRequest::getVar/11.1|getVar]]&lt;br /&gt;
|Fetches and returns a given variable. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JRequest::getWord/11.1|getWord]]&lt;br /&gt;
|Fetches and returns a given filtered variable. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JRequest::set/11.1|set]]&lt;br /&gt;
|Sets a request variable. &lt;br /&gt;
|-&lt;br /&gt;
|public static &lt;br /&gt;
|[[JRequest::setVar/11.1|setVar]]&lt;br /&gt;
|Set a variabe in one of the request variables. &lt;br /&gt;
|-&lt;br /&gt;
|protected static &lt;br /&gt;
|[[JRequest::_stripSlashesRecursive/11.1|_stripSlashesRecursive]]&lt;br /&gt;
|Strips slashes recursively on an array. &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Defined in&#039;&#039;&#039; libraries/joomla/environment/request.php&lt;br /&gt;
===Importing===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;jimport( &#039;joomla.environment.request&#039; );&amp;lt;/source&amp;gt;&lt;br /&gt;
===See also===&lt;br /&gt;
* {{JVer|11.1}} &#039;&#039;&#039;JRequest source code&#039;&#039;&#039; on [[jplatform:environment/request.php|BitBucket]]&lt;br /&gt;
* {{JVer|11.1}} Subpackage [[Subpackage Environment/11.1|Environment]]&lt;br /&gt;
* [[JRequest|Other versions of JRequest]]&lt;br /&gt;
* [[Retrieving_and_Filtering_GET_and_POST_requests_with_JRequest::getVar|Retrieving and Filtering GET and POST requests with JRequest::getVar]]&lt;br /&gt;
{{SeeAlso:JRequest}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[SeeAlso:JRequest|Edit See Also]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===User contributed notes===&lt;br /&gt;
&amp;lt;CodeExamplesForm /&amp;gt;&lt;br /&gt;
&amp;lt;dpl&amp;gt;&lt;br /&gt;
noresultsheader=\n&lt;br /&gt;
category=JRequest&lt;br /&gt;
category=CodeExample&lt;br /&gt;
category=ClassExample&lt;br /&gt;
include=*&lt;br /&gt;
namespace=CodeExample&lt;br /&gt;
format= ,,,&lt;br /&gt;
&amp;lt;/dpl&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Platform]][[Category:Platform 11.1]][[Category:JRequest]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Creating_a_search_plugin&amp;diff=68097</id>
		<title>J1.5:Creating a search plugin</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Creating_a_search_plugin&amp;diff=68097"/>
		<updated>2012-06-29T21:40:19Z</updated>

		<summary type="html">&lt;p&gt;BastianW: /* Coding examples */  added joomla 1.5 version tag&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
==Description==&lt;br /&gt;
This document is about how to create a Search Plugin. You can use a Search Plugin to search through the database of your Joomla! site. To create a plugin, you will at least need two files; an XML file and a PHP file. For internationalization it is good to create an INI file as well. &lt;br /&gt;
&lt;br /&gt;
==XML file==&lt;br /&gt;
The XML file is named the same as the PHP file, and is one of the two required files.&lt;br /&gt;
Always start off with the XML tag and define that it is written in a UTF-8 format.&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;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;!DOCTYPE install PUBLIC&lt;br /&gt;
    &amp;quot;-//Joomla! 1.5//DTD plugin 1.0//EN&amp;quot; &amp;quot;http://www.joomla.org/xml/dtd/1.5/plugin-install.dtd&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JVer|2.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To define that the plugin has to be a search plugin, add this line&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;install version=&amp;quot;1.5&amp;quot; type=&amp;quot;plugin&amp;quot; group=&amp;quot;search&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JVer|2.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;extension version=&amp;quot;2.5&amp;quot; type=&amp;quot;plugin&amp;quot; group=&amp;quot;search&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The type will define it is a plugin, the group defines the Plugin is in the group of search plugins.&lt;br /&gt;
&lt;br /&gt;
After that, add some information about yourself and the plugin:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;name&amp;gt;Name of your search plugin&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;lt;creationDate&amp;gt;Creation date&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
&amp;lt;author&amp;gt;Your name&amp;lt;/author&amp;gt;&lt;br /&gt;
&amp;lt;authorEmail&amp;gt;Your e-mail address&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
&amp;lt;authorUrl&amp;gt;Your website&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
&amp;lt;copyright&amp;gt;Copyright information&amp;lt;/copyright&amp;gt;&lt;br /&gt;
&amp;lt;license&amp;gt;License, for example GNU/GPL&amp;lt;/license&amp;gt;&lt;br /&gt;
&amp;lt;version&amp;gt;Version of the plugin&amp;lt;/version&amp;gt;&lt;br /&gt;
&amp;lt;description&amp;gt;Description of the plugin; shown during installation and when editing &lt;br /&gt;
the plugin in the Plugin Manager&amp;lt;/description&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
And now, include your PHP file to the Search Plugin. The name of this file should be the same as the name of this XML file. Put this name also behind the plugin=&amp;quot;&amp;quot; part. &lt;br /&gt;
&lt;br /&gt;
You could also add more files for your plugin, for example, an image. Just add another row between &amp;lt;files&amp;gt; and &amp;lt;/file&amp;gt;, and then place the file between &amp;lt;filename&amp;gt; tags.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;files&amp;gt;&lt;br /&gt;
   &amp;lt;filename plugin=&amp;quot;nameofplugin&amp;quot;&amp;gt;nameofplugin.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/files&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the internationalization, we will use language files. This is not required, but people from other countries will love it they can easily translate your plugin to their own language.&lt;br /&gt;
The language tags can be found here: [http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes] (use the ISO 639-1 column) and here: [http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements]&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;languages&amp;gt;&lt;br /&gt;
   &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.plg_search_nameofplugin.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/languages&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
Optionally, you could add some parameters to the plugin. These will look like this&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;params&amp;gt;&lt;br /&gt;
   &amp;lt;param name=&amp;quot;paramname&amp;quot; type=&amp;quot;typeofparameter&amp;quot; default=&amp;quot;defaultsetting&amp;quot; label=&amp;quot;title&amp;quot; description=&amp;quot;description&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/params&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Param name:&#039;&#039;&#039; The name of the parameter. You will need this when creating the PHP file.&lt;br /&gt;
*&#039;&#039;&#039;Param type:&#039;&#039;&#039; You could choose between several types of parameters. Look at this document to learn something about the different types: [http://docs.joomla.org/Using_the_core_parameter_types] &lt;br /&gt;
*&#039;&#039;&#039;Param default:&#039;&#039;&#039; The default setting for this parameter.&lt;br /&gt;
*&#039;&#039;&#039;Param label:&#039;&#039;&#039; The name of this parameter displayed in the edit screen of this plugin in the Plugin Manager.&lt;br /&gt;
*&#039;&#039;&#039;Param description:&#039;&#039;&#039; The text which appears as a tool tip for this parameter. &lt;br /&gt;
&lt;br /&gt;
{{JVer|2.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&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;
&lt;br /&gt;
			&amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;field name=&amp;quot;search_limit&amp;quot; type=&amp;quot;text&amp;quot;&lt;br /&gt;
					default=&amp;quot;50&amp;quot;&lt;br /&gt;
					description=&amp;quot;JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC&amp;quot;&lt;br /&gt;
					label=&amp;quot;JFIELD_PLG_SEARCH_SEARCHLIMIT_LABEL&amp;quot;&lt;br /&gt;
					size=&amp;quot;5&amp;quot;&lt;br /&gt;
				/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;field name=&amp;quot;search_content&amp;quot; type=&amp;quot;radio&amp;quot;&lt;br /&gt;
					default=&amp;quot;0&amp;quot;&lt;br /&gt;
					description=&amp;quot;JFIELD_PLG_SEARCH_ALL_DESC&amp;quot;&lt;br /&gt;
					label=&amp;quot;JFIELD_PLG_SEARCH_ALL_LABEL&amp;quot;&lt;br /&gt;
				&amp;gt;&lt;br /&gt;
					&amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JOFF&amp;lt;/option&amp;gt;&lt;br /&gt;
					&amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JON&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;/field&amp;gt;&lt;br /&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;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Do not forget to end your XML file with the following tag&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;/install&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JVer|2.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;/extension&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==PHP file==&lt;br /&gt;
The PHP file of your plugin is the most important file of the plugin. This is an example PHP file of a search plugin. The comments are included. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
//First start with information about the Plugin and yourself. For example:&lt;br /&gt;
/**&lt;br /&gt;
 * @version		$Id: nameofplugin.php versionnumber date author&lt;br /&gt;
 * @copyright	        Copyright&lt;br /&gt;
 * @license		License, for example GNU/GPL&lt;br /&gt;
 * All other information you would like to add&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
//To prevent accessing the document directly, enter this code:&lt;br /&gt;
// no direct access&lt;br /&gt;
defined( &#039;_JEXEC&#039; ) or die( &#039;Restricted access&#039; );&lt;br /&gt;
&lt;br /&gt;
//Define the registerEvent and the language file. Replace &#039;nameofplugin&#039; with the name of your plugin.&lt;br /&gt;
$mainframe-&amp;gt;registerEvent( &#039;onSearch&#039;, &#039;plgSearchnameofplugin&#039; );&lt;br /&gt;
$mainframe-&amp;gt;registerEvent( &#039;onSearchAreas&#039;, &#039;plgSearchnameofpluginAreas&#039; );&lt;br /&gt;
&lt;br /&gt;
JPlugin::loadLanguage( &#039;plg_search_nameofplugin&#039; );&lt;br /&gt;
&lt;br /&gt;
//Define a function to return an array of search areas. Replace &#039;nameofplugin&#039; with the name of your plugin.&lt;br /&gt;
function &amp;amp;plgSearchnameofpluginAreas()&lt;br /&gt;
{&lt;br /&gt;
	static $areas = array(&lt;br /&gt;
		&#039;nameofplugin&#039; =&amp;gt; &#039;Nameofplugin&#039;&lt;br /&gt;
	);&lt;br /&gt;
	return $areas;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//The real function has to be created. The database connection should be made. &lt;br /&gt;
//The function will be closed with an } at the end of the file.&lt;br /&gt;
function plgSearchnameofplugin( $text, $phrase=&#039;&#039;, $ordering=&#039;&#039;, $areas=null )&lt;br /&gt;
{&lt;br /&gt;
	$db		=&amp;amp; JFactory::getDBO();&lt;br /&gt;
	$user	=&amp;amp; JFactory::getUser(); &lt;br /&gt;
&lt;br /&gt;
//If the array is not correct, return it:&lt;br /&gt;
	if (is_array( $areas )) {&lt;br /&gt;
		if (!array_intersect( $areas, array_keys( plgSearchnameofpluginAreas() ) )) {&lt;br /&gt;
			return array();&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//Define the parameters. First get the right plugin; &#039;search&#039; (the group), &#039;nameofplugin&#039;. &lt;br /&gt;
$plugin =&amp;amp; JPluginHelper::getPlugin(&#039;search&#039;, &#039;nameofplugin&#039;);&lt;br /&gt;
&lt;br /&gt;
//Then load the parameters of the plugin.&lt;br /&gt;
$pluginParams = new JParameter( $plugin-&amp;gt;params );&lt;br /&gt;
&lt;br /&gt;
//Now define the parameters like this:&lt;br /&gt;
$limit = $pluginParams-&amp;gt;def( &#039;nameofparameter&#039;, defaultsetting );&lt;br /&gt;
&lt;br /&gt;
//Use the function trim to delete spaces in front of or at the back of the searching terms&lt;br /&gt;
$text = trim( $text );&lt;br /&gt;
&lt;br /&gt;
//Return Array when nothing was filled in.&lt;br /&gt;
if ($text == &#039;&#039;) {&lt;br /&gt;
		return array();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//After this, you have to add the database part. This will be the most difficult part, because this changes per situation.&lt;br /&gt;
//In the coding examples later on you will find some of the examples used by Joomla! 1.5 core Search Plugins.&lt;br /&gt;
//It will look something like this.&lt;br /&gt;
	$wheres = array();&lt;br /&gt;
	switch ($phrase) {&lt;br /&gt;
&lt;br /&gt;
//search exact&lt;br /&gt;
		case &#039;exact&#039;:&lt;br /&gt;
			$text		= $db-&amp;gt;Quote( &#039;%&#039;.$db-&amp;gt;getEscaped( $text, true ).&#039;%&#039;, false );&lt;br /&gt;
			$wheres2 	= array();&lt;br /&gt;
			$wheres2[] 	= &#039;LOWER(a.name) LIKE &#039;.$text;&lt;br /&gt;
			$where 		= &#039;(&#039; . implode( &#039;) OR (&#039;, $wheres2 ) . &#039;)&#039;;&lt;br /&gt;
			break;&lt;br /&gt;
&lt;br /&gt;
//search all or any&lt;br /&gt;
		case &#039;all&#039;:&lt;br /&gt;
		case &#039;any&#039;:&lt;br /&gt;
&lt;br /&gt;
//set default&lt;br /&gt;
		default:&lt;br /&gt;
			$words 	= explode( &#039; &#039;, $text );&lt;br /&gt;
			$wheres = array();&lt;br /&gt;
			foreach ($words as $word)&lt;br /&gt;
			{&lt;br /&gt;
				$word		= $db-&amp;gt;Quote( &#039;%&#039;.$db-&amp;gt;getEscaped( $word, true ).&#039;%&#039;, false );&lt;br /&gt;
				$wheres2 	= array();&lt;br /&gt;
				$wheres2[] 	= &#039;LOWER(a.name) LIKE &#039;.$word;&lt;br /&gt;
				$wheres[] 	= implode( &#039; OR &#039;, $wheres2 );&lt;br /&gt;
			}&lt;br /&gt;
			$where = &#039;(&#039; . implode( ($phrase == &#039;all&#039; ? &#039;) AND (&#039; : &#039;) OR (&#039;), $wheres ) . &#039;)&#039;;&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//ordering of the results&lt;br /&gt;
	switch ( $ordering ) {&lt;br /&gt;
&lt;br /&gt;
//alphabetic, ascending&lt;br /&gt;
		case &#039;alpha&#039;:&lt;br /&gt;
			$order = &#039;a.name ASC&#039;;&lt;br /&gt;
			break;&lt;br /&gt;
&lt;br /&gt;
//oldest first&lt;br /&gt;
		case &#039;oldest&#039;:&lt;br /&gt;
&lt;br /&gt;
//popular first&lt;br /&gt;
		case &#039;popular&#039;:&lt;br /&gt;
&lt;br /&gt;
//newest first&lt;br /&gt;
		case &#039;newest&#039;:&lt;br /&gt;
&lt;br /&gt;
//default setting: alphabetic, ascending&lt;br /&gt;
		default:&lt;br /&gt;
			$order = &#039;a.name ASC&#039;;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//replace nameofplugin&lt;br /&gt;
	$searchNameofplugin = JText::_( &#039;Nameofplugin&#039; );&lt;br /&gt;
&lt;br /&gt;
//the database query; differs per situation! It will look something like this:&lt;br /&gt;
	$query = &#039;SELECT a.name AS title,&#039;&lt;br /&gt;
	. &#039; CONCAT_WS( &amp;quot; / &amp;quot;, &#039;. $db-&amp;gt;Quote($searchNameofplugin) .&#039;, b.title )AS section,&#039;&lt;br /&gt;
	. &#039; &amp;quot;1&amp;quot; AS browsernav&#039;&lt;br /&gt;
	. &#039; FROM #__nameofplugin AS a&#039;&lt;br /&gt;
	. &#039; INNER JOIN #__categories AS b ON b.id = a.catid&#039;&lt;br /&gt;
	. &#039; WHERE ( &#039;. $where .&#039; )&#039;&lt;br /&gt;
	. &#039; AND a.published = 1&#039;&lt;br /&gt;
	. &#039; AND b.access &amp;lt;= &#039;. (int) $user-&amp;gt;get( &#039;aid&#039; )&lt;br /&gt;
	. &#039; ORDER BY &#039;. $order&lt;br /&gt;
	;&lt;br /&gt;
&lt;br /&gt;
//Set query&lt;br /&gt;
	$db-&amp;gt;setQuery( $query, 0, $limit );&lt;br /&gt;
	$rows = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&lt;br /&gt;
//The &#039;output&#039; of the displayed link&lt;br /&gt;
	foreach($rows as $key =&amp;gt; $row) {&lt;br /&gt;
		$rows[$key]-&amp;gt;href = &#039;index.php?option=com_newsfeeds&amp;amp;view=newsfeed&amp;amp;catid=&#039;.$row-&amp;gt;catslug.&#039;&amp;amp;id=&#039;.$row-&amp;gt;slug;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//Return the search results in an array&lt;br /&gt;
return $rows;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are four variables that get passed in. They are evident by their names and use in the above code.&lt;br /&gt;
What&#039;s not obvious is what the function should return: an array of objects that the search tool uses to display the results. The results could alternatively have been assembled like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;&lt;br /&gt;
$rows[] = (object) array(&lt;br /&gt;
			&#039;href&#039;        =&amp;gt; &#039;index.php?option=com_newsfeeds&amp;amp;view=newsfeed&amp;amp;catid=&#039;.$row-&amp;gt;catslug.&#039;&amp;amp;id=&#039;.$row-&amp;gt;slug,&lt;br /&gt;
			&#039;title&#039;       =&amp;gt; $row[&#039;name&#039;],&lt;br /&gt;
			&#039;section&#039;     =&amp;gt; $searchnameofplugin,&lt;br /&gt;
			&#039;created&#039;     =&amp;gt; $row[&#039;date&#039;],&lt;br /&gt;
			&#039;text&#039;        =&amp;gt; $row[&#039;name&#039;],&lt;br /&gt;
			&#039;browsernav&#039;  =&amp;gt; &#039;1&#039;&lt;br /&gt;
		);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==INI file(s)==&lt;br /&gt;
{{JVer|1.5}}{{JVer|1.6}}{{JVer|2.5}}&lt;br /&gt;
For internationalization it is good to use the INI files. You can add everything to the language file that outputs text to the user, in this order:&lt;br /&gt;
*XML description tag&lt;br /&gt;
*XML label and description attributes from parameters&lt;br /&gt;
*JText::_( &#039;string&#039; ) used by the plugin&lt;br /&gt;
&lt;br /&gt;
Start your INI file with something like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;INI&amp;quot;&amp;gt;# $Id: en-GB.plg_search_nameofplugin.ini&lt;br /&gt;
# Joomla! Project&lt;br /&gt;
# Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.&lt;br /&gt;
# License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php&lt;br /&gt;
# Note : All ini files need to be saved as UTF-8 - No BOM&amp;lt;/source&amp;gt;&lt;br /&gt;
Of course, you could also add other information, like the author. &lt;br /&gt;
&lt;br /&gt;
For example, this parameter:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;XML&amp;quot;&amp;gt;&amp;lt;param name=&amp;quot;search_limit&amp;quot; type=&amp;quot;text&amp;quot; size=&amp;quot;5&amp;quot; default=&amp;quot;50&amp;quot; label=&amp;quot;Search Limit&amp;quot; &lt;br /&gt;
description=&amp;quot;Number of Search items to return&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
Will cause the following output in the INI file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;INI&amp;quot;&amp;gt;&lt;br /&gt;
SEARCH LIMIT=Search Limit&lt;br /&gt;
NUMBER OF SEARCH ITEMS TO RETURN=Number of Search items to return&amp;lt;/source&amp;gt;&lt;br /&gt;
The file looks repetitive, but will be very useful for translators.&lt;br /&gt;
&lt;br /&gt;
When you want to make your search plugin available in more languages, first add them to the &amp;lt;languages&amp;gt; tag in the XML file. Then create the same INI file, and change the part after the =, for example the Dutch version would be:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;INI&amp;quot;&amp;gt;&lt;br /&gt;
SEARCH LIMIT=Zoek limiet&lt;br /&gt;
NUMBER OF SEARCH ITEMS TO RETURN=Aantal weer te geven zoekresultaten&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Coding examples==&lt;br /&gt;
==Joomla 1.5==&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
There are six Joomla! Core Search Plugins. If you look at them you can learn a lot, especially about the query part.&lt;br /&gt;
You can see them &#039;working&#039; when you go to the back-end of your Joomla! 1.5 installation. Go to the menu &#039;Extensions&#039; and select the &#039;Plugin Manager&#039;. Click on the name of the plugin to edit it and see it working.&lt;br /&gt;
*Plugin Search - Categories&lt;br /&gt;
**\plugins\search\categories.XML&lt;br /&gt;
**\plugins\search\categories.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_categories.INI&lt;br /&gt;
*Plugin Search - Contacts&lt;br /&gt;
**\plugins\search\contacts.XML&lt;br /&gt;
**\plugins\search\contacts.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_contacts.INI&lt;br /&gt;
*Plugin Search - Content&lt;br /&gt;
**\plugins\search\content.XML&lt;br /&gt;
**\plugins\search\content.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_content.INI&lt;br /&gt;
*Plugin Search - Newsfeeds&lt;br /&gt;
**\plugins\search\newsfeeds.XML&lt;br /&gt;
**\plugins\search\newsfeeds.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_newsfeeds.INI&lt;br /&gt;
*Plugin Search - Sections&lt;br /&gt;
**\plugins\search\sections.XML&lt;br /&gt;
**\plugins\search\sections.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_sections.INI&lt;br /&gt;
*Plugin Search - Weblinks&lt;br /&gt;
**\plugins\search\weblinks.XML&lt;br /&gt;
**\plugins\search\weblinks.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_weblinks.INI&lt;br /&gt;
&lt;br /&gt;
==Quick tips==&lt;br /&gt;
*In the PHP file, people often forget to place a semicolon (;) at the end of a line. This causes errors. Check this before you test your plugin.&lt;br /&gt;
*Make sure the parameters in the XML file are closed correctly. When you add an option, for example, you need to close it with &amp;lt;/param&amp;gt;.&lt;br /&gt;
*It is easy to test on a localhost when you are editing your plugin.&lt;br /&gt;
*When making a zip-file,do not forget to make the directories for the language files. A typical zip will contain the following:&lt;br /&gt;
**nameofplugin.xml&lt;br /&gt;
**nameofplugin.php&lt;br /&gt;
**language\en-GB\en-GB.plg_search_nameofplugin.ini&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Plugin Development]]&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Creating_a_search_plugin&amp;diff=68096</id>
		<title>J1.5:Creating a search plugin</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Creating_a_search_plugin&amp;diff=68096"/>
		<updated>2012-06-29T21:38:22Z</updated>

		<summary type="html">&lt;p&gt;BastianW: /* Quick tips */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
==Description==&lt;br /&gt;
This document is about how to create a Search Plugin. You can use a Search Plugin to search through the database of your Joomla! site. To create a plugin, you will at least need two files; an XML file and a PHP file. For internationalization it is good to create an INI file as well. &lt;br /&gt;
&lt;br /&gt;
==XML file==&lt;br /&gt;
The XML file is named the same as the PHP file, and is one of the two required files.&lt;br /&gt;
Always start off with the XML tag and define that it is written in a UTF-8 format.&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;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;!DOCTYPE install PUBLIC&lt;br /&gt;
    &amp;quot;-//Joomla! 1.5//DTD plugin 1.0//EN&amp;quot; &amp;quot;http://www.joomla.org/xml/dtd/1.5/plugin-install.dtd&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JVer|2.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To define that the plugin has to be a search plugin, add this line&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;install version=&amp;quot;1.5&amp;quot; type=&amp;quot;plugin&amp;quot; group=&amp;quot;search&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JVer|2.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;extension version=&amp;quot;2.5&amp;quot; type=&amp;quot;plugin&amp;quot; group=&amp;quot;search&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The type will define it is a plugin, the group defines the Plugin is in the group of search plugins.&lt;br /&gt;
&lt;br /&gt;
After that, add some information about yourself and the plugin:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;name&amp;gt;Name of your search plugin&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;lt;creationDate&amp;gt;Creation date&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
&amp;lt;author&amp;gt;Your name&amp;lt;/author&amp;gt;&lt;br /&gt;
&amp;lt;authorEmail&amp;gt;Your e-mail address&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
&amp;lt;authorUrl&amp;gt;Your website&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
&amp;lt;copyright&amp;gt;Copyright information&amp;lt;/copyright&amp;gt;&lt;br /&gt;
&amp;lt;license&amp;gt;License, for example GNU/GPL&amp;lt;/license&amp;gt;&lt;br /&gt;
&amp;lt;version&amp;gt;Version of the plugin&amp;lt;/version&amp;gt;&lt;br /&gt;
&amp;lt;description&amp;gt;Description of the plugin; shown during installation and when editing &lt;br /&gt;
the plugin in the Plugin Manager&amp;lt;/description&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
And now, include your PHP file to the Search Plugin. The name of this file should be the same as the name of this XML file. Put this name also behind the plugin=&amp;quot;&amp;quot; part. &lt;br /&gt;
&lt;br /&gt;
You could also add more files for your plugin, for example, an image. Just add another row between &amp;lt;files&amp;gt; and &amp;lt;/file&amp;gt;, and then place the file between &amp;lt;filename&amp;gt; tags.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;files&amp;gt;&lt;br /&gt;
   &amp;lt;filename plugin=&amp;quot;nameofplugin&amp;quot;&amp;gt;nameofplugin.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/files&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the internationalization, we will use language files. This is not required, but people from other countries will love it they can easily translate your plugin to their own language.&lt;br /&gt;
The language tags can be found here: [http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes] (use the ISO 639-1 column) and here: [http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements]&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;languages&amp;gt;&lt;br /&gt;
   &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.plg_search_nameofplugin.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/languages&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
Optionally, you could add some parameters to the plugin. These will look like this&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;params&amp;gt;&lt;br /&gt;
   &amp;lt;param name=&amp;quot;paramname&amp;quot; type=&amp;quot;typeofparameter&amp;quot; default=&amp;quot;defaultsetting&amp;quot; label=&amp;quot;title&amp;quot; description=&amp;quot;description&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/params&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Param name:&#039;&#039;&#039; The name of the parameter. You will need this when creating the PHP file.&lt;br /&gt;
*&#039;&#039;&#039;Param type:&#039;&#039;&#039; You could choose between several types of parameters. Look at this document to learn something about the different types: [http://docs.joomla.org/Using_the_core_parameter_types] &lt;br /&gt;
*&#039;&#039;&#039;Param default:&#039;&#039;&#039; The default setting for this parameter.&lt;br /&gt;
*&#039;&#039;&#039;Param label:&#039;&#039;&#039; The name of this parameter displayed in the edit screen of this plugin in the Plugin Manager.&lt;br /&gt;
*&#039;&#039;&#039;Param description:&#039;&#039;&#039; The text which appears as a tool tip for this parameter. &lt;br /&gt;
&lt;br /&gt;
{{JVer|2.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&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;
&lt;br /&gt;
			&amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;field name=&amp;quot;search_limit&amp;quot; type=&amp;quot;text&amp;quot;&lt;br /&gt;
					default=&amp;quot;50&amp;quot;&lt;br /&gt;
					description=&amp;quot;JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC&amp;quot;&lt;br /&gt;
					label=&amp;quot;JFIELD_PLG_SEARCH_SEARCHLIMIT_LABEL&amp;quot;&lt;br /&gt;
					size=&amp;quot;5&amp;quot;&lt;br /&gt;
				/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;field name=&amp;quot;search_content&amp;quot; type=&amp;quot;radio&amp;quot;&lt;br /&gt;
					default=&amp;quot;0&amp;quot;&lt;br /&gt;
					description=&amp;quot;JFIELD_PLG_SEARCH_ALL_DESC&amp;quot;&lt;br /&gt;
					label=&amp;quot;JFIELD_PLG_SEARCH_ALL_LABEL&amp;quot;&lt;br /&gt;
				&amp;gt;&lt;br /&gt;
					&amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JOFF&amp;lt;/option&amp;gt;&lt;br /&gt;
					&amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JON&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;/field&amp;gt;&lt;br /&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;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Do not forget to end your XML file with the following tag&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;/install&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JVer|2.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;/extension&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==PHP file==&lt;br /&gt;
The PHP file of your plugin is the most important file of the plugin. This is an example PHP file of a search plugin. The comments are included. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
//First start with information about the Plugin and yourself. For example:&lt;br /&gt;
/**&lt;br /&gt;
 * @version		$Id: nameofplugin.php versionnumber date author&lt;br /&gt;
 * @copyright	        Copyright&lt;br /&gt;
 * @license		License, for example GNU/GPL&lt;br /&gt;
 * All other information you would like to add&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
//To prevent accessing the document directly, enter this code:&lt;br /&gt;
// no direct access&lt;br /&gt;
defined( &#039;_JEXEC&#039; ) or die( &#039;Restricted access&#039; );&lt;br /&gt;
&lt;br /&gt;
//Define the registerEvent and the language file. Replace &#039;nameofplugin&#039; with the name of your plugin.&lt;br /&gt;
$mainframe-&amp;gt;registerEvent( &#039;onSearch&#039;, &#039;plgSearchnameofplugin&#039; );&lt;br /&gt;
$mainframe-&amp;gt;registerEvent( &#039;onSearchAreas&#039;, &#039;plgSearchnameofpluginAreas&#039; );&lt;br /&gt;
&lt;br /&gt;
JPlugin::loadLanguage( &#039;plg_search_nameofplugin&#039; );&lt;br /&gt;
&lt;br /&gt;
//Define a function to return an array of search areas. Replace &#039;nameofplugin&#039; with the name of your plugin.&lt;br /&gt;
function &amp;amp;plgSearchnameofpluginAreas()&lt;br /&gt;
{&lt;br /&gt;
	static $areas = array(&lt;br /&gt;
		&#039;nameofplugin&#039; =&amp;gt; &#039;Nameofplugin&#039;&lt;br /&gt;
	);&lt;br /&gt;
	return $areas;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//The real function has to be created. The database connection should be made. &lt;br /&gt;
//The function will be closed with an } at the end of the file.&lt;br /&gt;
function plgSearchnameofplugin( $text, $phrase=&#039;&#039;, $ordering=&#039;&#039;, $areas=null )&lt;br /&gt;
{&lt;br /&gt;
	$db		=&amp;amp; JFactory::getDBO();&lt;br /&gt;
	$user	=&amp;amp; JFactory::getUser(); &lt;br /&gt;
&lt;br /&gt;
//If the array is not correct, return it:&lt;br /&gt;
	if (is_array( $areas )) {&lt;br /&gt;
		if (!array_intersect( $areas, array_keys( plgSearchnameofpluginAreas() ) )) {&lt;br /&gt;
			return array();&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//Define the parameters. First get the right plugin; &#039;search&#039; (the group), &#039;nameofplugin&#039;. &lt;br /&gt;
$plugin =&amp;amp; JPluginHelper::getPlugin(&#039;search&#039;, &#039;nameofplugin&#039;);&lt;br /&gt;
&lt;br /&gt;
//Then load the parameters of the plugin.&lt;br /&gt;
$pluginParams = new JParameter( $plugin-&amp;gt;params );&lt;br /&gt;
&lt;br /&gt;
//Now define the parameters like this:&lt;br /&gt;
$limit = $pluginParams-&amp;gt;def( &#039;nameofparameter&#039;, defaultsetting );&lt;br /&gt;
&lt;br /&gt;
//Use the function trim to delete spaces in front of or at the back of the searching terms&lt;br /&gt;
$text = trim( $text );&lt;br /&gt;
&lt;br /&gt;
//Return Array when nothing was filled in.&lt;br /&gt;
if ($text == &#039;&#039;) {&lt;br /&gt;
		return array();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//After this, you have to add the database part. This will be the most difficult part, because this changes per situation.&lt;br /&gt;
//In the coding examples later on you will find some of the examples used by Joomla! 1.5 core Search Plugins.&lt;br /&gt;
//It will look something like this.&lt;br /&gt;
	$wheres = array();&lt;br /&gt;
	switch ($phrase) {&lt;br /&gt;
&lt;br /&gt;
//search exact&lt;br /&gt;
		case &#039;exact&#039;:&lt;br /&gt;
			$text		= $db-&amp;gt;Quote( &#039;%&#039;.$db-&amp;gt;getEscaped( $text, true ).&#039;%&#039;, false );&lt;br /&gt;
			$wheres2 	= array();&lt;br /&gt;
			$wheres2[] 	= &#039;LOWER(a.name) LIKE &#039;.$text;&lt;br /&gt;
			$where 		= &#039;(&#039; . implode( &#039;) OR (&#039;, $wheres2 ) . &#039;)&#039;;&lt;br /&gt;
			break;&lt;br /&gt;
&lt;br /&gt;
//search all or any&lt;br /&gt;
		case &#039;all&#039;:&lt;br /&gt;
		case &#039;any&#039;:&lt;br /&gt;
&lt;br /&gt;
//set default&lt;br /&gt;
		default:&lt;br /&gt;
			$words 	= explode( &#039; &#039;, $text );&lt;br /&gt;
			$wheres = array();&lt;br /&gt;
			foreach ($words as $word)&lt;br /&gt;
			{&lt;br /&gt;
				$word		= $db-&amp;gt;Quote( &#039;%&#039;.$db-&amp;gt;getEscaped( $word, true ).&#039;%&#039;, false );&lt;br /&gt;
				$wheres2 	= array();&lt;br /&gt;
				$wheres2[] 	= &#039;LOWER(a.name) LIKE &#039;.$word;&lt;br /&gt;
				$wheres[] 	= implode( &#039; OR &#039;, $wheres2 );&lt;br /&gt;
			}&lt;br /&gt;
			$where = &#039;(&#039; . implode( ($phrase == &#039;all&#039; ? &#039;) AND (&#039; : &#039;) OR (&#039;), $wheres ) . &#039;)&#039;;&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//ordering of the results&lt;br /&gt;
	switch ( $ordering ) {&lt;br /&gt;
&lt;br /&gt;
//alphabetic, ascending&lt;br /&gt;
		case &#039;alpha&#039;:&lt;br /&gt;
			$order = &#039;a.name ASC&#039;;&lt;br /&gt;
			break;&lt;br /&gt;
&lt;br /&gt;
//oldest first&lt;br /&gt;
		case &#039;oldest&#039;:&lt;br /&gt;
&lt;br /&gt;
//popular first&lt;br /&gt;
		case &#039;popular&#039;:&lt;br /&gt;
&lt;br /&gt;
//newest first&lt;br /&gt;
		case &#039;newest&#039;:&lt;br /&gt;
&lt;br /&gt;
//default setting: alphabetic, ascending&lt;br /&gt;
		default:&lt;br /&gt;
			$order = &#039;a.name ASC&#039;;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//replace nameofplugin&lt;br /&gt;
	$searchNameofplugin = JText::_( &#039;Nameofplugin&#039; );&lt;br /&gt;
&lt;br /&gt;
//the database query; differs per situation! It will look something like this:&lt;br /&gt;
	$query = &#039;SELECT a.name AS title,&#039;&lt;br /&gt;
	. &#039; CONCAT_WS( &amp;quot; / &amp;quot;, &#039;. $db-&amp;gt;Quote($searchNameofplugin) .&#039;, b.title )AS section,&#039;&lt;br /&gt;
	. &#039; &amp;quot;1&amp;quot; AS browsernav&#039;&lt;br /&gt;
	. &#039; FROM #__nameofplugin AS a&#039;&lt;br /&gt;
	. &#039; INNER JOIN #__categories AS b ON b.id = a.catid&#039;&lt;br /&gt;
	. &#039; WHERE ( &#039;. $where .&#039; )&#039;&lt;br /&gt;
	. &#039; AND a.published = 1&#039;&lt;br /&gt;
	. &#039; AND b.access &amp;lt;= &#039;. (int) $user-&amp;gt;get( &#039;aid&#039; )&lt;br /&gt;
	. &#039; ORDER BY &#039;. $order&lt;br /&gt;
	;&lt;br /&gt;
&lt;br /&gt;
//Set query&lt;br /&gt;
	$db-&amp;gt;setQuery( $query, 0, $limit );&lt;br /&gt;
	$rows = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&lt;br /&gt;
//The &#039;output&#039; of the displayed link&lt;br /&gt;
	foreach($rows as $key =&amp;gt; $row) {&lt;br /&gt;
		$rows[$key]-&amp;gt;href = &#039;index.php?option=com_newsfeeds&amp;amp;view=newsfeed&amp;amp;catid=&#039;.$row-&amp;gt;catslug.&#039;&amp;amp;id=&#039;.$row-&amp;gt;slug;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//Return the search results in an array&lt;br /&gt;
return $rows;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are four variables that get passed in. They are evident by their names and use in the above code.&lt;br /&gt;
What&#039;s not obvious is what the function should return: an array of objects that the search tool uses to display the results. The results could alternatively have been assembled like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;&lt;br /&gt;
$rows[] = (object) array(&lt;br /&gt;
			&#039;href&#039;        =&amp;gt; &#039;index.php?option=com_newsfeeds&amp;amp;view=newsfeed&amp;amp;catid=&#039;.$row-&amp;gt;catslug.&#039;&amp;amp;id=&#039;.$row-&amp;gt;slug,&lt;br /&gt;
			&#039;title&#039;       =&amp;gt; $row[&#039;name&#039;],&lt;br /&gt;
			&#039;section&#039;     =&amp;gt; $searchnameofplugin,&lt;br /&gt;
			&#039;created&#039;     =&amp;gt; $row[&#039;date&#039;],&lt;br /&gt;
			&#039;text&#039;        =&amp;gt; $row[&#039;name&#039;],&lt;br /&gt;
			&#039;browsernav&#039;  =&amp;gt; &#039;1&#039;&lt;br /&gt;
		);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==INI file(s)==&lt;br /&gt;
{{JVer|1.5}}{{JVer|1.6}}{{JVer|2.5}}&lt;br /&gt;
For internationalization it is good to use the INI files. You can add everything to the language file that outputs text to the user, in this order:&lt;br /&gt;
*XML description tag&lt;br /&gt;
*XML label and description attributes from parameters&lt;br /&gt;
*JText::_( &#039;string&#039; ) used by the plugin&lt;br /&gt;
&lt;br /&gt;
Start your INI file with something like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;INI&amp;quot;&amp;gt;# $Id: en-GB.plg_search_nameofplugin.ini&lt;br /&gt;
# Joomla! Project&lt;br /&gt;
# Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.&lt;br /&gt;
# License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php&lt;br /&gt;
# Note : All ini files need to be saved as UTF-8 - No BOM&amp;lt;/source&amp;gt;&lt;br /&gt;
Of course, you could also add other information, like the author. &lt;br /&gt;
&lt;br /&gt;
For example, this parameter:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;XML&amp;quot;&amp;gt;&amp;lt;param name=&amp;quot;search_limit&amp;quot; type=&amp;quot;text&amp;quot; size=&amp;quot;5&amp;quot; default=&amp;quot;50&amp;quot; label=&amp;quot;Search Limit&amp;quot; &lt;br /&gt;
description=&amp;quot;Number of Search items to return&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
Will cause the following output in the INI file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;INI&amp;quot;&amp;gt;&lt;br /&gt;
SEARCH LIMIT=Search Limit&lt;br /&gt;
NUMBER OF SEARCH ITEMS TO RETURN=Number of Search items to return&amp;lt;/source&amp;gt;&lt;br /&gt;
The file looks repetitive, but will be very useful for translators.&lt;br /&gt;
&lt;br /&gt;
When you want to make your search plugin available in more languages, first add them to the &amp;lt;languages&amp;gt; tag in the XML file. Then create the same INI file, and change the part after the =, for example the Dutch version would be:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;INI&amp;quot;&amp;gt;&lt;br /&gt;
SEARCH LIMIT=Zoek limiet&lt;br /&gt;
NUMBER OF SEARCH ITEMS TO RETURN=Aantal weer te geven zoekresultaten&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Coding examples==&lt;br /&gt;
There are six Joomla! Core Search Plugins. If you look at them you can learn a lot, especially about the query part.&lt;br /&gt;
You can see them &#039;working&#039; when you go to the back-end of your Joomla! 1.5 installation. Go to the menu &#039;Extensions&#039; and select the &#039;Plugin Manager&#039;. Click on the name of the plugin to edit it and see it working.&lt;br /&gt;
*Plugin Search - Categories&lt;br /&gt;
**\plugins\search\categories.XML&lt;br /&gt;
**\plugins\search\categories.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_categories.INI&lt;br /&gt;
*Plugin Search - Contacts&lt;br /&gt;
**\plugins\search\contacts.XML&lt;br /&gt;
**\plugins\search\contacts.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_contacts.INI&lt;br /&gt;
*Plugin Search - Content&lt;br /&gt;
**\plugins\search\content.XML&lt;br /&gt;
**\plugins\search\content.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_content.INI&lt;br /&gt;
*Plugin Search - Newsfeeds&lt;br /&gt;
**\plugins\search\newsfeeds.XML&lt;br /&gt;
**\plugins\search\newsfeeds.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_newsfeeds.INI&lt;br /&gt;
*Plugin Search - Sections&lt;br /&gt;
**\plugins\search\sections.XML&lt;br /&gt;
**\plugins\search\sections.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_sections.INI&lt;br /&gt;
*Plugin Search - Weblinks&lt;br /&gt;
**\plugins\search\weblinks.XML&lt;br /&gt;
**\plugins\search\weblinks.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_weblinks.INI&lt;br /&gt;
&lt;br /&gt;
==Quick tips==&lt;br /&gt;
*In the PHP file, people often forget to place a semicolon (;) at the end of a line. This causes errors. Check this before you test your plugin.&lt;br /&gt;
*Make sure the parameters in the XML file are closed correctly. When you add an option, for example, you need to close it with &amp;lt;/param&amp;gt;.&lt;br /&gt;
*It is easy to test on a localhost when you are editing your plugin.&lt;br /&gt;
*When making a zip-file,do not forget to make the directories for the language files. A typical zip will contain the following:&lt;br /&gt;
**nameofplugin.xml&lt;br /&gt;
**nameofplugin.php&lt;br /&gt;
**language\en-GB\en-GB.plg_search_nameofplugin.ini&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Plugin Development]]&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Creating_a_search_plugin&amp;diff=68095</id>
		<title>J1.5:Creating a search plugin</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Creating_a_search_plugin&amp;diff=68095"/>
		<updated>2012-06-29T21:37:10Z</updated>

		<summary type="html">&lt;p&gt;BastianW: /* INI file(s) */ added version tags&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
==Description==&lt;br /&gt;
This document is about how to create a Search Plugin. You can use a Search Plugin to search through the database of your Joomla! site. To create a plugin, you will at least need two files; an XML file and a PHP file. For internationalization it is good to create an INI file as well. &lt;br /&gt;
&lt;br /&gt;
==XML file==&lt;br /&gt;
The XML file is named the same as the PHP file, and is one of the two required files.&lt;br /&gt;
Always start off with the XML tag and define that it is written in a UTF-8 format.&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;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;!DOCTYPE install PUBLIC&lt;br /&gt;
    &amp;quot;-//Joomla! 1.5//DTD plugin 1.0//EN&amp;quot; &amp;quot;http://www.joomla.org/xml/dtd/1.5/plugin-install.dtd&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JVer|2.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To define that the plugin has to be a search plugin, add this line&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;install version=&amp;quot;1.5&amp;quot; type=&amp;quot;plugin&amp;quot; group=&amp;quot;search&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JVer|2.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;extension version=&amp;quot;2.5&amp;quot; type=&amp;quot;plugin&amp;quot; group=&amp;quot;search&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The type will define it is a plugin, the group defines the Plugin is in the group of search plugins.&lt;br /&gt;
&lt;br /&gt;
After that, add some information about yourself and the plugin:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;name&amp;gt;Name of your search plugin&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;lt;creationDate&amp;gt;Creation date&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
&amp;lt;author&amp;gt;Your name&amp;lt;/author&amp;gt;&lt;br /&gt;
&amp;lt;authorEmail&amp;gt;Your e-mail address&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
&amp;lt;authorUrl&amp;gt;Your website&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
&amp;lt;copyright&amp;gt;Copyright information&amp;lt;/copyright&amp;gt;&lt;br /&gt;
&amp;lt;license&amp;gt;License, for example GNU/GPL&amp;lt;/license&amp;gt;&lt;br /&gt;
&amp;lt;version&amp;gt;Version of the plugin&amp;lt;/version&amp;gt;&lt;br /&gt;
&amp;lt;description&amp;gt;Description of the plugin; shown during installation and when editing &lt;br /&gt;
the plugin in the Plugin Manager&amp;lt;/description&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
And now, include your PHP file to the Search Plugin. The name of this file should be the same as the name of this XML file. Put this name also behind the plugin=&amp;quot;&amp;quot; part. &lt;br /&gt;
&lt;br /&gt;
You could also add more files for your plugin, for example, an image. Just add another row between &amp;lt;files&amp;gt; and &amp;lt;/file&amp;gt;, and then place the file between &amp;lt;filename&amp;gt; tags.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;files&amp;gt;&lt;br /&gt;
   &amp;lt;filename plugin=&amp;quot;nameofplugin&amp;quot;&amp;gt;nameofplugin.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/files&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the internationalization, we will use language files. This is not required, but people from other countries will love it they can easily translate your plugin to their own language.&lt;br /&gt;
The language tags can be found here: [http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes] (use the ISO 639-1 column) and here: [http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements]&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;languages&amp;gt;&lt;br /&gt;
   &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.plg_search_nameofplugin.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/languages&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
Optionally, you could add some parameters to the plugin. These will look like this&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;params&amp;gt;&lt;br /&gt;
   &amp;lt;param name=&amp;quot;paramname&amp;quot; type=&amp;quot;typeofparameter&amp;quot; default=&amp;quot;defaultsetting&amp;quot; label=&amp;quot;title&amp;quot; description=&amp;quot;description&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/params&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Param name:&#039;&#039;&#039; The name of the parameter. You will need this when creating the PHP file.&lt;br /&gt;
*&#039;&#039;&#039;Param type:&#039;&#039;&#039; You could choose between several types of parameters. Look at this document to learn something about the different types: [http://docs.joomla.org/Using_the_core_parameter_types] &lt;br /&gt;
*&#039;&#039;&#039;Param default:&#039;&#039;&#039; The default setting for this parameter.&lt;br /&gt;
*&#039;&#039;&#039;Param label:&#039;&#039;&#039; The name of this parameter displayed in the edit screen of this plugin in the Plugin Manager.&lt;br /&gt;
*&#039;&#039;&#039;Param description:&#039;&#039;&#039; The text which appears as a tool tip for this parameter. &lt;br /&gt;
&lt;br /&gt;
{{JVer|2.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&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;
&lt;br /&gt;
			&amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;field name=&amp;quot;search_limit&amp;quot; type=&amp;quot;text&amp;quot;&lt;br /&gt;
					default=&amp;quot;50&amp;quot;&lt;br /&gt;
					description=&amp;quot;JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC&amp;quot;&lt;br /&gt;
					label=&amp;quot;JFIELD_PLG_SEARCH_SEARCHLIMIT_LABEL&amp;quot;&lt;br /&gt;
					size=&amp;quot;5&amp;quot;&lt;br /&gt;
				/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;field name=&amp;quot;search_content&amp;quot; type=&amp;quot;radio&amp;quot;&lt;br /&gt;
					default=&amp;quot;0&amp;quot;&lt;br /&gt;
					description=&amp;quot;JFIELD_PLG_SEARCH_ALL_DESC&amp;quot;&lt;br /&gt;
					label=&amp;quot;JFIELD_PLG_SEARCH_ALL_LABEL&amp;quot;&lt;br /&gt;
				&amp;gt;&lt;br /&gt;
					&amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JOFF&amp;lt;/option&amp;gt;&lt;br /&gt;
					&amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JON&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;/field&amp;gt;&lt;br /&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;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Do not forget to end your XML file with the following tag&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;/install&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JVer|2.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;/extension&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==PHP file==&lt;br /&gt;
The PHP file of your plugin is the most important file of the plugin. This is an example PHP file of a search plugin. The comments are included. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
//First start with information about the Plugin and yourself. For example:&lt;br /&gt;
/**&lt;br /&gt;
 * @version		$Id: nameofplugin.php versionnumber date author&lt;br /&gt;
 * @copyright	        Copyright&lt;br /&gt;
 * @license		License, for example GNU/GPL&lt;br /&gt;
 * All other information you would like to add&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
//To prevent accessing the document directly, enter this code:&lt;br /&gt;
// no direct access&lt;br /&gt;
defined( &#039;_JEXEC&#039; ) or die( &#039;Restricted access&#039; );&lt;br /&gt;
&lt;br /&gt;
//Define the registerEvent and the language file. Replace &#039;nameofplugin&#039; with the name of your plugin.&lt;br /&gt;
$mainframe-&amp;gt;registerEvent( &#039;onSearch&#039;, &#039;plgSearchnameofplugin&#039; );&lt;br /&gt;
$mainframe-&amp;gt;registerEvent( &#039;onSearchAreas&#039;, &#039;plgSearchnameofpluginAreas&#039; );&lt;br /&gt;
&lt;br /&gt;
JPlugin::loadLanguage( &#039;plg_search_nameofplugin&#039; );&lt;br /&gt;
&lt;br /&gt;
//Define a function to return an array of search areas. Replace &#039;nameofplugin&#039; with the name of your plugin.&lt;br /&gt;
function &amp;amp;plgSearchnameofpluginAreas()&lt;br /&gt;
{&lt;br /&gt;
	static $areas = array(&lt;br /&gt;
		&#039;nameofplugin&#039; =&amp;gt; &#039;Nameofplugin&#039;&lt;br /&gt;
	);&lt;br /&gt;
	return $areas;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//The real function has to be created. The database connection should be made. &lt;br /&gt;
//The function will be closed with an } at the end of the file.&lt;br /&gt;
function plgSearchnameofplugin( $text, $phrase=&#039;&#039;, $ordering=&#039;&#039;, $areas=null )&lt;br /&gt;
{&lt;br /&gt;
	$db		=&amp;amp; JFactory::getDBO();&lt;br /&gt;
	$user	=&amp;amp; JFactory::getUser(); &lt;br /&gt;
&lt;br /&gt;
//If the array is not correct, return it:&lt;br /&gt;
	if (is_array( $areas )) {&lt;br /&gt;
		if (!array_intersect( $areas, array_keys( plgSearchnameofpluginAreas() ) )) {&lt;br /&gt;
			return array();&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//Define the parameters. First get the right plugin; &#039;search&#039; (the group), &#039;nameofplugin&#039;. &lt;br /&gt;
$plugin =&amp;amp; JPluginHelper::getPlugin(&#039;search&#039;, &#039;nameofplugin&#039;);&lt;br /&gt;
&lt;br /&gt;
//Then load the parameters of the plugin.&lt;br /&gt;
$pluginParams = new JParameter( $plugin-&amp;gt;params );&lt;br /&gt;
&lt;br /&gt;
//Now define the parameters like this:&lt;br /&gt;
$limit = $pluginParams-&amp;gt;def( &#039;nameofparameter&#039;, defaultsetting );&lt;br /&gt;
&lt;br /&gt;
//Use the function trim to delete spaces in front of or at the back of the searching terms&lt;br /&gt;
$text = trim( $text );&lt;br /&gt;
&lt;br /&gt;
//Return Array when nothing was filled in.&lt;br /&gt;
if ($text == &#039;&#039;) {&lt;br /&gt;
		return array();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//After this, you have to add the database part. This will be the most difficult part, because this changes per situation.&lt;br /&gt;
//In the coding examples later on you will find some of the examples used by Joomla! 1.5 core Search Plugins.&lt;br /&gt;
//It will look something like this.&lt;br /&gt;
	$wheres = array();&lt;br /&gt;
	switch ($phrase) {&lt;br /&gt;
&lt;br /&gt;
//search exact&lt;br /&gt;
		case &#039;exact&#039;:&lt;br /&gt;
			$text		= $db-&amp;gt;Quote( &#039;%&#039;.$db-&amp;gt;getEscaped( $text, true ).&#039;%&#039;, false );&lt;br /&gt;
			$wheres2 	= array();&lt;br /&gt;
			$wheres2[] 	= &#039;LOWER(a.name) LIKE &#039;.$text;&lt;br /&gt;
			$where 		= &#039;(&#039; . implode( &#039;) OR (&#039;, $wheres2 ) . &#039;)&#039;;&lt;br /&gt;
			break;&lt;br /&gt;
&lt;br /&gt;
//search all or any&lt;br /&gt;
		case &#039;all&#039;:&lt;br /&gt;
		case &#039;any&#039;:&lt;br /&gt;
&lt;br /&gt;
//set default&lt;br /&gt;
		default:&lt;br /&gt;
			$words 	= explode( &#039; &#039;, $text );&lt;br /&gt;
			$wheres = array();&lt;br /&gt;
			foreach ($words as $word)&lt;br /&gt;
			{&lt;br /&gt;
				$word		= $db-&amp;gt;Quote( &#039;%&#039;.$db-&amp;gt;getEscaped( $word, true ).&#039;%&#039;, false );&lt;br /&gt;
				$wheres2 	= array();&lt;br /&gt;
				$wheres2[] 	= &#039;LOWER(a.name) LIKE &#039;.$word;&lt;br /&gt;
				$wheres[] 	= implode( &#039; OR &#039;, $wheres2 );&lt;br /&gt;
			}&lt;br /&gt;
			$where = &#039;(&#039; . implode( ($phrase == &#039;all&#039; ? &#039;) AND (&#039; : &#039;) OR (&#039;), $wheres ) . &#039;)&#039;;&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//ordering of the results&lt;br /&gt;
	switch ( $ordering ) {&lt;br /&gt;
&lt;br /&gt;
//alphabetic, ascending&lt;br /&gt;
		case &#039;alpha&#039;:&lt;br /&gt;
			$order = &#039;a.name ASC&#039;;&lt;br /&gt;
			break;&lt;br /&gt;
&lt;br /&gt;
//oldest first&lt;br /&gt;
		case &#039;oldest&#039;:&lt;br /&gt;
&lt;br /&gt;
//popular first&lt;br /&gt;
		case &#039;popular&#039;:&lt;br /&gt;
&lt;br /&gt;
//newest first&lt;br /&gt;
		case &#039;newest&#039;:&lt;br /&gt;
&lt;br /&gt;
//default setting: alphabetic, ascending&lt;br /&gt;
		default:&lt;br /&gt;
			$order = &#039;a.name ASC&#039;;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//replace nameofplugin&lt;br /&gt;
	$searchNameofplugin = JText::_( &#039;Nameofplugin&#039; );&lt;br /&gt;
&lt;br /&gt;
//the database query; differs per situation! It will look something like this:&lt;br /&gt;
	$query = &#039;SELECT a.name AS title,&#039;&lt;br /&gt;
	. &#039; CONCAT_WS( &amp;quot; / &amp;quot;, &#039;. $db-&amp;gt;Quote($searchNameofplugin) .&#039;, b.title )AS section,&#039;&lt;br /&gt;
	. &#039; &amp;quot;1&amp;quot; AS browsernav&#039;&lt;br /&gt;
	. &#039; FROM #__nameofplugin AS a&#039;&lt;br /&gt;
	. &#039; INNER JOIN #__categories AS b ON b.id = a.catid&#039;&lt;br /&gt;
	. &#039; WHERE ( &#039;. $where .&#039; )&#039;&lt;br /&gt;
	. &#039; AND a.published = 1&#039;&lt;br /&gt;
	. &#039; AND b.access &amp;lt;= &#039;. (int) $user-&amp;gt;get( &#039;aid&#039; )&lt;br /&gt;
	. &#039; ORDER BY &#039;. $order&lt;br /&gt;
	;&lt;br /&gt;
&lt;br /&gt;
//Set query&lt;br /&gt;
	$db-&amp;gt;setQuery( $query, 0, $limit );&lt;br /&gt;
	$rows = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&lt;br /&gt;
//The &#039;output&#039; of the displayed link&lt;br /&gt;
	foreach($rows as $key =&amp;gt; $row) {&lt;br /&gt;
		$rows[$key]-&amp;gt;href = &#039;index.php?option=com_newsfeeds&amp;amp;view=newsfeed&amp;amp;catid=&#039;.$row-&amp;gt;catslug.&#039;&amp;amp;id=&#039;.$row-&amp;gt;slug;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//Return the search results in an array&lt;br /&gt;
return $rows;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are four variables that get passed in. They are evident by their names and use in the above code.&lt;br /&gt;
What&#039;s not obvious is what the function should return: an array of objects that the search tool uses to display the results. The results could alternatively have been assembled like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;&lt;br /&gt;
$rows[] = (object) array(&lt;br /&gt;
			&#039;href&#039;        =&amp;gt; &#039;index.php?option=com_newsfeeds&amp;amp;view=newsfeed&amp;amp;catid=&#039;.$row-&amp;gt;catslug.&#039;&amp;amp;id=&#039;.$row-&amp;gt;slug,&lt;br /&gt;
			&#039;title&#039;       =&amp;gt; $row[&#039;name&#039;],&lt;br /&gt;
			&#039;section&#039;     =&amp;gt; $searchnameofplugin,&lt;br /&gt;
			&#039;created&#039;     =&amp;gt; $row[&#039;date&#039;],&lt;br /&gt;
			&#039;text&#039;        =&amp;gt; $row[&#039;name&#039;],&lt;br /&gt;
			&#039;browsernav&#039;  =&amp;gt; &#039;1&#039;&lt;br /&gt;
		);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==INI file(s)==&lt;br /&gt;
{{JVer|1.5}}{{JVer|1.6}}{{JVer|2.5}}&lt;br /&gt;
For internationalization it is good to use the INI files. You can add everything to the language file that outputs text to the user, in this order:&lt;br /&gt;
*XML description tag&lt;br /&gt;
*XML label and description attributes from parameters&lt;br /&gt;
*JText::_( &#039;string&#039; ) used by the plugin&lt;br /&gt;
&lt;br /&gt;
Start your INI file with something like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;INI&amp;quot;&amp;gt;# $Id: en-GB.plg_search_nameofplugin.ini&lt;br /&gt;
# Joomla! Project&lt;br /&gt;
# Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.&lt;br /&gt;
# License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php&lt;br /&gt;
# Note : All ini files need to be saved as UTF-8 - No BOM&amp;lt;/source&amp;gt;&lt;br /&gt;
Of course, you could also add other information, like the author. &lt;br /&gt;
&lt;br /&gt;
For example, this parameter:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;XML&amp;quot;&amp;gt;&amp;lt;param name=&amp;quot;search_limit&amp;quot; type=&amp;quot;text&amp;quot; size=&amp;quot;5&amp;quot; default=&amp;quot;50&amp;quot; label=&amp;quot;Search Limit&amp;quot; &lt;br /&gt;
description=&amp;quot;Number of Search items to return&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
Will cause the following output in the INI file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;INI&amp;quot;&amp;gt;&lt;br /&gt;
SEARCH LIMIT=Search Limit&lt;br /&gt;
NUMBER OF SEARCH ITEMS TO RETURN=Number of Search items to return&amp;lt;/source&amp;gt;&lt;br /&gt;
The file looks repetitive, but will be very useful for translators.&lt;br /&gt;
&lt;br /&gt;
When you want to make your search plugin available in more languages, first add them to the &amp;lt;languages&amp;gt; tag in the XML file. Then create the same INI file, and change the part after the =, for example the Dutch version would be:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;INI&amp;quot;&amp;gt;&lt;br /&gt;
SEARCH LIMIT=Zoek limiet&lt;br /&gt;
NUMBER OF SEARCH ITEMS TO RETURN=Aantal weer te geven zoekresultaten&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Coding examples==&lt;br /&gt;
There are six Joomla! Core Search Plugins. If you look at them you can learn a lot, especially about the query part.&lt;br /&gt;
You can see them &#039;working&#039; when you go to the back-end of your Joomla! 1.5 installation. Go to the menu &#039;Extensions&#039; and select the &#039;Plugin Manager&#039;. Click on the name of the plugin to edit it and see it working.&lt;br /&gt;
*Plugin Search - Categories&lt;br /&gt;
**\plugins\search\categories.XML&lt;br /&gt;
**\plugins\search\categories.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_categories.INI&lt;br /&gt;
*Plugin Search - Contacts&lt;br /&gt;
**\plugins\search\contacts.XML&lt;br /&gt;
**\plugins\search\contacts.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_contacts.INI&lt;br /&gt;
*Plugin Search - Content&lt;br /&gt;
**\plugins\search\content.XML&lt;br /&gt;
**\plugins\search\content.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_content.INI&lt;br /&gt;
*Plugin Search - Newsfeeds&lt;br /&gt;
**\plugins\search\newsfeeds.XML&lt;br /&gt;
**\plugins\search\newsfeeds.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_newsfeeds.INI&lt;br /&gt;
*Plugin Search - Sections&lt;br /&gt;
**\plugins\search\sections.XML&lt;br /&gt;
**\plugins\search\sections.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_sections.INI&lt;br /&gt;
*Plugin Search - Weblinks&lt;br /&gt;
**\plugins\search\weblinks.XML&lt;br /&gt;
**\plugins\search\weblinks.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_weblinks.INI&lt;br /&gt;
&lt;br /&gt;
==Quick tips==&lt;br /&gt;
*In the PHP file, people often forget to place a semicolon (;) at the end of a line. This causes errors. Check this before you test your plugin.&lt;br /&gt;
*Make sure the parameters in the XML file are closed correctly. When you add an option, for example, you need to close it with &amp;lt;/param&amp;gt;.&lt;br /&gt;
*It is easy to test on a localhost when you are editing your plugin.&lt;br /&gt;
*When making a zip-file,do not forget to make the directories for the language files. A typical zip will contain the following:&lt;br /&gt;
**nameofplugin.XML&lt;br /&gt;
**nameofplugin.PHP&lt;br /&gt;
**language\en-GB\en-GB.plg_search_nameofplugin.INI&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Plugin Development]]&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:Creating_a_search_plugin&amp;diff=68094</id>
		<title>J1.5:Creating a search plugin</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:Creating_a_search_plugin&amp;diff=68094"/>
		<updated>2012-06-29T21:33:42Z</updated>

		<summary type="html">&lt;p&gt;BastianW: /* XML file */ updated section with joomla 2.5 infos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{review}}&lt;br /&gt;
==Description==&lt;br /&gt;
This document is about how to create a Search Plugin. You can use a Search Plugin to search through the database of your Joomla! site. To create a plugin, you will at least need two files; an XML file and a PHP file. For internationalization it is good to create an INI file as well. &lt;br /&gt;
&lt;br /&gt;
==XML file==&lt;br /&gt;
The XML file is named the same as the PHP file, and is one of the two required files.&lt;br /&gt;
Always start off with the XML tag and define that it is written in a UTF-8 format.&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;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;!DOCTYPE install PUBLIC&lt;br /&gt;
    &amp;quot;-//Joomla! 1.5//DTD plugin 1.0//EN&amp;quot; &amp;quot;http://www.joomla.org/xml/dtd/1.5/plugin-install.dtd&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JVer|2.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To define that the plugin has to be a search plugin, add this line&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;install version=&amp;quot;1.5&amp;quot; type=&amp;quot;plugin&amp;quot; group=&amp;quot;search&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JVer|2.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;extension version=&amp;quot;2.5&amp;quot; type=&amp;quot;plugin&amp;quot; group=&amp;quot;search&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The type will define it is a plugin, the group defines the Plugin is in the group of search plugins.&lt;br /&gt;
&lt;br /&gt;
After that, add some information about yourself and the plugin:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;name&amp;gt;Name of your search plugin&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;lt;creationDate&amp;gt;Creation date&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
&amp;lt;author&amp;gt;Your name&amp;lt;/author&amp;gt;&lt;br /&gt;
&amp;lt;authorEmail&amp;gt;Your e-mail address&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
&amp;lt;authorUrl&amp;gt;Your website&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
&amp;lt;copyright&amp;gt;Copyright information&amp;lt;/copyright&amp;gt;&lt;br /&gt;
&amp;lt;license&amp;gt;License, for example GNU/GPL&amp;lt;/license&amp;gt;&lt;br /&gt;
&amp;lt;version&amp;gt;Version of the plugin&amp;lt;/version&amp;gt;&lt;br /&gt;
&amp;lt;description&amp;gt;Description of the plugin; shown during installation and when editing &lt;br /&gt;
the plugin in the Plugin Manager&amp;lt;/description&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
And now, include your PHP file to the Search Plugin. The name of this file should be the same as the name of this XML file. Put this name also behind the plugin=&amp;quot;&amp;quot; part. &lt;br /&gt;
&lt;br /&gt;
You could also add more files for your plugin, for example, an image. Just add another row between &amp;lt;files&amp;gt; and &amp;lt;/file&amp;gt;, and then place the file between &amp;lt;filename&amp;gt; tags.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;files&amp;gt;&lt;br /&gt;
   &amp;lt;filename plugin=&amp;quot;nameofplugin&amp;quot;&amp;gt;nameofplugin.php&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/files&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the internationalization, we will use language files. This is not required, but people from other countries will love it they can easily translate your plugin to their own language.&lt;br /&gt;
The language tags can be found here: [http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes] (use the ISO 639-1 column) and here: [http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements]&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;languages&amp;gt;&lt;br /&gt;
   &amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.plg_search_nameofplugin.ini&amp;lt;/language&amp;gt;&lt;br /&gt;
&amp;lt;/languages&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
Optionally, you could add some parameters to the plugin. These will look like this&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;params&amp;gt;&lt;br /&gt;
   &amp;lt;param name=&amp;quot;paramname&amp;quot; type=&amp;quot;typeofparameter&amp;quot; default=&amp;quot;defaultsetting&amp;quot; label=&amp;quot;title&amp;quot; description=&amp;quot;description&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/params&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Param name:&#039;&#039;&#039; The name of the parameter. You will need this when creating the PHP file.&lt;br /&gt;
*&#039;&#039;&#039;Param type:&#039;&#039;&#039; You could choose between several types of parameters. Look at this document to learn something about the different types: [http://docs.joomla.org/Using_the_core_parameter_types] &lt;br /&gt;
*&#039;&#039;&#039;Param default:&#039;&#039;&#039; The default setting for this parameter.&lt;br /&gt;
*&#039;&#039;&#039;Param label:&#039;&#039;&#039; The name of this parameter displayed in the edit screen of this plugin in the Plugin Manager.&lt;br /&gt;
*&#039;&#039;&#039;Param description:&#039;&#039;&#039; The text which appears as a tool tip for this parameter. &lt;br /&gt;
&lt;br /&gt;
{{JVer|2.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&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;
&lt;br /&gt;
			&amp;lt;fieldset name=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;field name=&amp;quot;search_limit&amp;quot; type=&amp;quot;text&amp;quot;&lt;br /&gt;
					default=&amp;quot;50&amp;quot;&lt;br /&gt;
					description=&amp;quot;JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC&amp;quot;&lt;br /&gt;
					label=&amp;quot;JFIELD_PLG_SEARCH_SEARCHLIMIT_LABEL&amp;quot;&lt;br /&gt;
					size=&amp;quot;5&amp;quot;&lt;br /&gt;
				/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;field name=&amp;quot;search_content&amp;quot; type=&amp;quot;radio&amp;quot;&lt;br /&gt;
					default=&amp;quot;0&amp;quot;&lt;br /&gt;
					description=&amp;quot;JFIELD_PLG_SEARCH_ALL_DESC&amp;quot;&lt;br /&gt;
					label=&amp;quot;JFIELD_PLG_SEARCH_ALL_LABEL&amp;quot;&lt;br /&gt;
				&amp;gt;&lt;br /&gt;
					&amp;lt;option value=&amp;quot;0&amp;quot;&amp;gt;JOFF&amp;lt;/option&amp;gt;&lt;br /&gt;
					&amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;JON&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;/field&amp;gt;&lt;br /&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;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Do not forget to end your XML file with the following tag&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;/install&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{JVer|2.5}}&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;/extension&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==PHP file==&lt;br /&gt;
The PHP file of your plugin is the most important file of the plugin. This is an example PHP file of a search plugin. The comments are included. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
//First start with information about the Plugin and yourself. For example:&lt;br /&gt;
/**&lt;br /&gt;
 * @version		$Id: nameofplugin.php versionnumber date author&lt;br /&gt;
 * @copyright	        Copyright&lt;br /&gt;
 * @license		License, for example GNU/GPL&lt;br /&gt;
 * All other information you would like to add&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
//To prevent accessing the document directly, enter this code:&lt;br /&gt;
// no direct access&lt;br /&gt;
defined( &#039;_JEXEC&#039; ) or die( &#039;Restricted access&#039; );&lt;br /&gt;
&lt;br /&gt;
//Define the registerEvent and the language file. Replace &#039;nameofplugin&#039; with the name of your plugin.&lt;br /&gt;
$mainframe-&amp;gt;registerEvent( &#039;onSearch&#039;, &#039;plgSearchnameofplugin&#039; );&lt;br /&gt;
$mainframe-&amp;gt;registerEvent( &#039;onSearchAreas&#039;, &#039;plgSearchnameofpluginAreas&#039; );&lt;br /&gt;
&lt;br /&gt;
JPlugin::loadLanguage( &#039;plg_search_nameofplugin&#039; );&lt;br /&gt;
&lt;br /&gt;
//Define a function to return an array of search areas. Replace &#039;nameofplugin&#039; with the name of your plugin.&lt;br /&gt;
function &amp;amp;plgSearchnameofpluginAreas()&lt;br /&gt;
{&lt;br /&gt;
	static $areas = array(&lt;br /&gt;
		&#039;nameofplugin&#039; =&amp;gt; &#039;Nameofplugin&#039;&lt;br /&gt;
	);&lt;br /&gt;
	return $areas;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//The real function has to be created. The database connection should be made. &lt;br /&gt;
//The function will be closed with an } at the end of the file.&lt;br /&gt;
function plgSearchnameofplugin( $text, $phrase=&#039;&#039;, $ordering=&#039;&#039;, $areas=null )&lt;br /&gt;
{&lt;br /&gt;
	$db		=&amp;amp; JFactory::getDBO();&lt;br /&gt;
	$user	=&amp;amp; JFactory::getUser(); &lt;br /&gt;
&lt;br /&gt;
//If the array is not correct, return it:&lt;br /&gt;
	if (is_array( $areas )) {&lt;br /&gt;
		if (!array_intersect( $areas, array_keys( plgSearchnameofpluginAreas() ) )) {&lt;br /&gt;
			return array();&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//Define the parameters. First get the right plugin; &#039;search&#039; (the group), &#039;nameofplugin&#039;. &lt;br /&gt;
$plugin =&amp;amp; JPluginHelper::getPlugin(&#039;search&#039;, &#039;nameofplugin&#039;);&lt;br /&gt;
&lt;br /&gt;
//Then load the parameters of the plugin.&lt;br /&gt;
$pluginParams = new JParameter( $plugin-&amp;gt;params );&lt;br /&gt;
&lt;br /&gt;
//Now define the parameters like this:&lt;br /&gt;
$limit = $pluginParams-&amp;gt;def( &#039;nameofparameter&#039;, defaultsetting );&lt;br /&gt;
&lt;br /&gt;
//Use the function trim to delete spaces in front of or at the back of the searching terms&lt;br /&gt;
$text = trim( $text );&lt;br /&gt;
&lt;br /&gt;
//Return Array when nothing was filled in.&lt;br /&gt;
if ($text == &#039;&#039;) {&lt;br /&gt;
		return array();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//After this, you have to add the database part. This will be the most difficult part, because this changes per situation.&lt;br /&gt;
//In the coding examples later on you will find some of the examples used by Joomla! 1.5 core Search Plugins.&lt;br /&gt;
//It will look something like this.&lt;br /&gt;
	$wheres = array();&lt;br /&gt;
	switch ($phrase) {&lt;br /&gt;
&lt;br /&gt;
//search exact&lt;br /&gt;
		case &#039;exact&#039;:&lt;br /&gt;
			$text		= $db-&amp;gt;Quote( &#039;%&#039;.$db-&amp;gt;getEscaped( $text, true ).&#039;%&#039;, false );&lt;br /&gt;
			$wheres2 	= array();&lt;br /&gt;
			$wheres2[] 	= &#039;LOWER(a.name) LIKE &#039;.$text;&lt;br /&gt;
			$where 		= &#039;(&#039; . implode( &#039;) OR (&#039;, $wheres2 ) . &#039;)&#039;;&lt;br /&gt;
			break;&lt;br /&gt;
&lt;br /&gt;
//search all or any&lt;br /&gt;
		case &#039;all&#039;:&lt;br /&gt;
		case &#039;any&#039;:&lt;br /&gt;
&lt;br /&gt;
//set default&lt;br /&gt;
		default:&lt;br /&gt;
			$words 	= explode( &#039; &#039;, $text );&lt;br /&gt;
			$wheres = array();&lt;br /&gt;
			foreach ($words as $word)&lt;br /&gt;
			{&lt;br /&gt;
				$word		= $db-&amp;gt;Quote( &#039;%&#039;.$db-&amp;gt;getEscaped( $word, true ).&#039;%&#039;, false );&lt;br /&gt;
				$wheres2 	= array();&lt;br /&gt;
				$wheres2[] 	= &#039;LOWER(a.name) LIKE &#039;.$word;&lt;br /&gt;
				$wheres[] 	= implode( &#039; OR &#039;, $wheres2 );&lt;br /&gt;
			}&lt;br /&gt;
			$where = &#039;(&#039; . implode( ($phrase == &#039;all&#039; ? &#039;) AND (&#039; : &#039;) OR (&#039;), $wheres ) . &#039;)&#039;;&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//ordering of the results&lt;br /&gt;
	switch ( $ordering ) {&lt;br /&gt;
&lt;br /&gt;
//alphabetic, ascending&lt;br /&gt;
		case &#039;alpha&#039;:&lt;br /&gt;
			$order = &#039;a.name ASC&#039;;&lt;br /&gt;
			break;&lt;br /&gt;
&lt;br /&gt;
//oldest first&lt;br /&gt;
		case &#039;oldest&#039;:&lt;br /&gt;
&lt;br /&gt;
//popular first&lt;br /&gt;
		case &#039;popular&#039;:&lt;br /&gt;
&lt;br /&gt;
//newest first&lt;br /&gt;
		case &#039;newest&#039;:&lt;br /&gt;
&lt;br /&gt;
//default setting: alphabetic, ascending&lt;br /&gt;
		default:&lt;br /&gt;
			$order = &#039;a.name ASC&#039;;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//replace nameofplugin&lt;br /&gt;
	$searchNameofplugin = JText::_( &#039;Nameofplugin&#039; );&lt;br /&gt;
&lt;br /&gt;
//the database query; differs per situation! It will look something like this:&lt;br /&gt;
	$query = &#039;SELECT a.name AS title,&#039;&lt;br /&gt;
	. &#039; CONCAT_WS( &amp;quot; / &amp;quot;, &#039;. $db-&amp;gt;Quote($searchNameofplugin) .&#039;, b.title )AS section,&#039;&lt;br /&gt;
	. &#039; &amp;quot;1&amp;quot; AS browsernav&#039;&lt;br /&gt;
	. &#039; FROM #__nameofplugin AS a&#039;&lt;br /&gt;
	. &#039; INNER JOIN #__categories AS b ON b.id = a.catid&#039;&lt;br /&gt;
	. &#039; WHERE ( &#039;. $where .&#039; )&#039;&lt;br /&gt;
	. &#039; AND a.published = 1&#039;&lt;br /&gt;
	. &#039; AND b.access &amp;lt;= &#039;. (int) $user-&amp;gt;get( &#039;aid&#039; )&lt;br /&gt;
	. &#039; ORDER BY &#039;. $order&lt;br /&gt;
	;&lt;br /&gt;
&lt;br /&gt;
//Set query&lt;br /&gt;
	$db-&amp;gt;setQuery( $query, 0, $limit );&lt;br /&gt;
	$rows = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&lt;br /&gt;
//The &#039;output&#039; of the displayed link&lt;br /&gt;
	foreach($rows as $key =&amp;gt; $row) {&lt;br /&gt;
		$rows[$key]-&amp;gt;href = &#039;index.php?option=com_newsfeeds&amp;amp;view=newsfeed&amp;amp;catid=&#039;.$row-&amp;gt;catslug.&#039;&amp;amp;id=&#039;.$row-&amp;gt;slug;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
//Return the search results in an array&lt;br /&gt;
return $rows;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are four variables that get passed in. They are evident by their names and use in the above code.&lt;br /&gt;
What&#039;s not obvious is what the function should return: an array of objects that the search tool uses to display the results. The results could alternatively have been assembled like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;PHP&amp;quot;&amp;gt;&lt;br /&gt;
$rows[] = (object) array(&lt;br /&gt;
			&#039;href&#039;        =&amp;gt; &#039;index.php?option=com_newsfeeds&amp;amp;view=newsfeed&amp;amp;catid=&#039;.$row-&amp;gt;catslug.&#039;&amp;amp;id=&#039;.$row-&amp;gt;slug,&lt;br /&gt;
			&#039;title&#039;       =&amp;gt; $row[&#039;name&#039;],&lt;br /&gt;
			&#039;section&#039;     =&amp;gt; $searchnameofplugin,&lt;br /&gt;
			&#039;created&#039;     =&amp;gt; $row[&#039;date&#039;],&lt;br /&gt;
			&#039;text&#039;        =&amp;gt; $row[&#039;name&#039;],&lt;br /&gt;
			&#039;browsernav&#039;  =&amp;gt; &#039;1&#039;&lt;br /&gt;
		);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==INI file(s)==&lt;br /&gt;
For internationalization it is good to use the INI files. You can add everything to the language file that outputs text to the user, in this order:&lt;br /&gt;
*XML description tag&lt;br /&gt;
*XML label and description attributes from parameters&lt;br /&gt;
*JText::_( &#039;string&#039; ) used by the plugin&lt;br /&gt;
&lt;br /&gt;
Start your INI file with something like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;INI&amp;quot;&amp;gt;# $Id: en-GB.plg_search_nameofplugin.ini&lt;br /&gt;
# Joomla! Project&lt;br /&gt;
# Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.&lt;br /&gt;
# License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php&lt;br /&gt;
# Note : All ini files need to be saved as UTF-8 - No BOM&amp;lt;/source&amp;gt;&lt;br /&gt;
Of course, you could also add other information, like the author. &lt;br /&gt;
&lt;br /&gt;
For example, this parameter:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;XML&amp;quot;&amp;gt;&amp;lt;param name=&amp;quot;search_limit&amp;quot; type=&amp;quot;text&amp;quot; size=&amp;quot;5&amp;quot; default=&amp;quot;50&amp;quot; label=&amp;quot;Search Limit&amp;quot; &lt;br /&gt;
description=&amp;quot;Number of Search items to return&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
Will cause the following output in the INI file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;INI&amp;quot;&amp;gt;&lt;br /&gt;
SEARCH LIMIT=Search Limit&lt;br /&gt;
NUMBER OF SEARCH ITEMS TO RETURN=Number of Search items to return&amp;lt;/source&amp;gt;&lt;br /&gt;
The file looks repetitive, but will be very useful for translators.&lt;br /&gt;
&lt;br /&gt;
When you want to make your search plugin available in more languages, first add them to the &amp;lt;languages&amp;gt; tag in the XML file. Then create the same INI file, and change the part after the =, for example the Dutch version would be:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;INI&amp;quot;&amp;gt;&lt;br /&gt;
SEARCH LIMIT=Zoek limiet&lt;br /&gt;
NUMBER OF SEARCH ITEMS TO RETURN=Aantal weer te geven zoekresultaten&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Coding examples==&lt;br /&gt;
There are six Joomla! Core Search Plugins. If you look at them you can learn a lot, especially about the query part.&lt;br /&gt;
You can see them &#039;working&#039; when you go to the back-end of your Joomla! 1.5 installation. Go to the menu &#039;Extensions&#039; and select the &#039;Plugin Manager&#039;. Click on the name of the plugin to edit it and see it working.&lt;br /&gt;
*Plugin Search - Categories&lt;br /&gt;
**\plugins\search\categories.XML&lt;br /&gt;
**\plugins\search\categories.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_categories.INI&lt;br /&gt;
*Plugin Search - Contacts&lt;br /&gt;
**\plugins\search\contacts.XML&lt;br /&gt;
**\plugins\search\contacts.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_contacts.INI&lt;br /&gt;
*Plugin Search - Content&lt;br /&gt;
**\plugins\search\content.XML&lt;br /&gt;
**\plugins\search\content.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_content.INI&lt;br /&gt;
*Plugin Search - Newsfeeds&lt;br /&gt;
**\plugins\search\newsfeeds.XML&lt;br /&gt;
**\plugins\search\newsfeeds.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_newsfeeds.INI&lt;br /&gt;
*Plugin Search - Sections&lt;br /&gt;
**\plugins\search\sections.XML&lt;br /&gt;
**\plugins\search\sections.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_sections.INI&lt;br /&gt;
*Plugin Search - Weblinks&lt;br /&gt;
**\plugins\search\weblinks.XML&lt;br /&gt;
**\plugins\search\weblinks.PHP&lt;br /&gt;
**\language\en-GB\en-GB.plg_search_weblinks.INI&lt;br /&gt;
&lt;br /&gt;
==Quick tips==&lt;br /&gt;
*In the PHP file, people often forget to place a semicolon (;) at the end of a line. This causes errors. Check this before you test your plugin.&lt;br /&gt;
*Make sure the parameters in the XML file are closed correctly. When you add an option, for example, you need to close it with &amp;lt;/param&amp;gt;.&lt;br /&gt;
*It is easy to test on a localhost when you are editing your plugin.&lt;br /&gt;
*When making a zip-file,do not forget to make the directories for the language files. A typical zip will contain the following:&lt;br /&gt;
**nameofplugin.XML&lt;br /&gt;
**nameofplugin.PHP&lt;br /&gt;
**language\en-GB\en-GB.plg_search_nameofplugin.INI&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Plugin Development]]&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:How_to_add_breadcrumbs&amp;diff=68070</id>
		<title>J1.5:How to add breadcrumbs</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:How_to_add_breadcrumbs&amp;diff=68070"/>
		<updated>2012-06-28T17:55:04Z</updated>

		<summary type="html">&lt;p&gt;BastianW: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Breadcrumbs are nice way to display the connection from the root. It gives you a hierarchical representation with click able links so that user can visit upper links easily. Breadcrumbs can be added in templates by using the object returned by $mainframe-&amp;gt;getPathWay(). The member function addItem() allows to add a breadcrumb with the title of choice. &lt;br /&gt;
&lt;br /&gt;
There are two parameters used for breadcrumbs creation process, and the first parameter is the title for the breadcrumb and the second parameter is the URL. If we do not need the breadcrumb to work like a link then we need to simply pass a blank string and then it will not work like a click able URL. This term is useful for hierarchical components where we have subcategories: we can generate a link to each and then end with the title of the current record or category.&lt;br /&gt;
&lt;br /&gt;
The JPathway is currently used by the breadcrumbs module. If you are adding a new component and have already configured breadcrumbs, you may need to go into the breadcrumbs configuration and add the menu item for you component to the selection on the menu selelist.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
{{JVer|1.5}}{{JVer|1.6}}This example was written for Joomla 1.5, however the differences to Joomla 1.6 are minor.&lt;br /&gt;
A view&#039;s view.php could look something like this.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class exampleViewdefault extends JView {&lt;br /&gt;
	function display($tpl = null) {&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
		$mainframe = &amp;amp;JFactory::getApplication();&lt;br /&gt;
		$document  = &amp;amp;JFactory::getDocument();		&lt;br /&gt;
		$pathway   =&amp;amp; $mainframe-&amp;gt;getPathway();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		JHTML::_(&#039;behavior.modal&#039;);&lt;br /&gt;
		$model =&amp;amp; $this-&amp;gt;getModel();&lt;br /&gt;
		$data = $model-&amp;gt;getData();&lt;br /&gt;
&lt;br /&gt;
		$this-&amp;gt;assignRef( &#039;events&#039;, $data);&lt;br /&gt;
&lt;br /&gt;
		$document-&amp;gt;setTitle( $this-&amp;gt;events[&#039;name&#039;] );		&lt;br /&gt;
		$pathway-&amp;gt;addItem($this-&amp;gt;events[&#039;name&#039;], &#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{JVer|2.5}} The display function from a view&#039;s view.php for joomla 2.5 could look something like this.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public function display($tpl = null) &lt;br /&gt;
{&lt;br /&gt;
        &lt;br /&gt;
$app	= JFactory::getApplication();&lt;br /&gt;
$pathway = $app-&amp;gt;getPathway();&lt;br /&gt;
$pathway-&amp;gt;addItem(&#039;My Added Breadcrumb Link&#039;, &#039;http://www.yourdomain.tld&#039;);&lt;br /&gt;
&lt;br /&gt;
parent::display($tpl);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also==&lt;br /&gt;
* http://docs.joomla.org/JPathway&lt;br /&gt;
* http://api.joomla.org/1.5/Joomla-Framework/Application/JPathway.html&lt;br /&gt;
* http://api.joomla.org/11.4/Joomla-Platform/Application/JPathway.html&lt;br /&gt;
* http://docs.joomla.org/API16:JPathway&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]][[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:How_to_add_breadcrumbs&amp;diff=68069</id>
		<title>J1.5:How to add breadcrumbs</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:How_to_add_breadcrumbs&amp;diff=68069"/>
		<updated>2012-06-28T17:50:36Z</updated>

		<summary type="html">&lt;p&gt;BastianW: added joomla 2.5 example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Breadcrumbs are nice way to display the connection from the root. It gives you a hierarchical representation with click able links so that user can visit upper links easily. Breadcrumbs can be added in templates by using the object returned by $mainframe-&amp;gt;getPathWay(). The member function addItem() allows to add a breadcrumb with the title of choice. &lt;br /&gt;
&lt;br /&gt;
There are two parameters used for breadcrumbs creation process, and the first parameter is the title for the breadcrumb and the second parameter is the URL. If we do not need the breadcrumb to work like a link then we need to simply pass a blank string and then it will not work like a click able URL. This term is useful for hierarchical components where we have subcategories: we can generate a link to each and then end with the title of the current record or category.&lt;br /&gt;
&lt;br /&gt;
The JPathway is currently used by the breadcrumbs module. If you are adding a new component and have already configured breadcrumbs, you may need to go into the breadcrumbs configuration and add the menu item for you component to the selection on the menu selelist.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
{{JVer|1.5}}{{JVer|1.6}}This example was written for Joomla 1.5, however the differences to Joomla 1.6 are minor.&lt;br /&gt;
A view&#039;s view.php could look something like this.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class exampleViewdefault extends JView {&lt;br /&gt;
	function display($tpl = null) {&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
		$mainframe = &amp;amp;JFactory::getApplication();&lt;br /&gt;
		$document  = &amp;amp;JFactory::getDocument();		&lt;br /&gt;
		$pathway   =&amp;amp; $mainframe-&amp;gt;getPathway();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		JHTML::_(&#039;behavior.modal&#039;);&lt;br /&gt;
		$model =&amp;amp; $this-&amp;gt;getModel();&lt;br /&gt;
		$data = $model-&amp;gt;getData();&lt;br /&gt;
&lt;br /&gt;
		$this-&amp;gt;assignRef( &#039;events&#039;, $data);&lt;br /&gt;
&lt;br /&gt;
		$document-&amp;gt;setTitle( $this-&amp;gt;events[&#039;name&#039;] );		&lt;br /&gt;
		$pathway-&amp;gt;addItem($this-&amp;gt;events[&#039;name&#039;], &#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{JVer|2.5}} The display function from a view&#039;s view.php for joomla 2.5 could look something like this.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public function display($tpl = null) &lt;br /&gt;
{&lt;br /&gt;
        &lt;br /&gt;
$app	= JFactory::getApplication();&lt;br /&gt;
$this-&amp;gt;state = $this-&amp;gt;get(&#039;State&#039;);&lt;br /&gt;
$this-&amp;gt;item = $this-&amp;gt;get(&#039;Item&#039;);&lt;br /&gt;
&lt;br /&gt;
$pathway = $app-&amp;gt;getPathway();&lt;br /&gt;
$pathway-&amp;gt;addItem(&#039;My Added Breadcrumb Link&#039;, &#039;http://www.yourdomain.tld&#039;);&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
// Check for errors.&lt;br /&gt;
if (count($errors = $this-&amp;gt;get(&#039;Errors&#039;)))&lt;br /&gt;
{&lt;br /&gt;
    JError::raiseError(500, implode(&amp;quot;\n&amp;quot;, $errors));&lt;br /&gt;
    return false;&lt;br /&gt;
}&lt;br /&gt;
        &lt;br /&gt;
$this-&amp;gt;_prepareDocument();&lt;br /&gt;
parent::display($tpl);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also==&lt;br /&gt;
* http://docs.joomla.org/JPathway&lt;br /&gt;
* http://api.joomla.org/1.5/Joomla-Framework/Application/JPathway.html&lt;br /&gt;
* http://api.joomla.org/11.4/Joomla-Platform/Application/JPathway.html&lt;br /&gt;
* http://docs.joomla.org/API16:JPathway&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]][[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:How_to_add_breadcrumbs&amp;diff=68068</id>
		<title>J1.5:How to add breadcrumbs</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:How_to_add_breadcrumbs&amp;diff=68068"/>
		<updated>2012-06-28T17:34:11Z</updated>

		<summary type="html">&lt;p&gt;BastianW: /* See Also */  added API16 Link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{JVer|1.5}}{{JVer|1.6}}This tutorial was written for Joomla 1.5, however the differences to Joomla 1.6 are minor.&lt;br /&gt;
&lt;br /&gt;
Breadcrumbs are nice way to display the connection from the root. It gives you a hierarchical representation with click able links so that user can visit upper links easily. Breadcrumbs can be added in templates by using the object returned by $mainframe-&amp;gt;getPathWay(). The member function addItem() allows to add a breadcrumb with the title of choice. &lt;br /&gt;
&lt;br /&gt;
There are two parameters used for breadcrumbs creation process, and the first parameter is the title for the breadcrumb and the second parameter is the URL. If we do not need the breadcrumb to work like a link then we need to simply pass a blank string and then it will not work like a click able URL. This term is useful for hierarchical components where we have subcategories: we can generate a link to each and then end with the title of the current record or category.&lt;br /&gt;
&lt;br /&gt;
The JPathway is currently used by the breadcrumbs module. If you are adding a new component and have already configured breadcrumbs, you may need to go into the breadcrumbs configuration and add the menu item for you component to the selection on the menu selelist.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
A view&#039;s view.php could look something like this.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class exampleViewdefault extends JView {&lt;br /&gt;
	function display($tpl = null) {&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
		$mainframe = &amp;amp;JFactory::getApplication();&lt;br /&gt;
		$document  = &amp;amp;JFactory::getDocument();		&lt;br /&gt;
		$pathway   =&amp;amp; $mainframe-&amp;gt;getPathway();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		JHTML::_(&#039;behavior.modal&#039;);&lt;br /&gt;
		$model =&amp;amp; $this-&amp;gt;getModel();&lt;br /&gt;
		$data = $model-&amp;gt;getData();&lt;br /&gt;
&lt;br /&gt;
		$this-&amp;gt;assignRef( &#039;events&#039;, $data);&lt;br /&gt;
&lt;br /&gt;
		$document-&amp;gt;setTitle( $this-&amp;gt;events[&#039;name&#039;] );		&lt;br /&gt;
		$pathway-&amp;gt;addItem($this-&amp;gt;events[&#039;name&#039;], &#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also==&lt;br /&gt;
* http://docs.joomla.org/JPathway&lt;br /&gt;
* http://api.joomla.org/1.5/Joomla-Framework/Application/JPathway.html&lt;br /&gt;
* http://api.joomla.org/11.4/Joomla-Platform/Application/JPathway.html&lt;br /&gt;
* http://docs.joomla.org/API16:JPathway&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]][[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:BastianW&amp;diff=68067</id>
		<title>User:BastianW</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:BastianW&amp;diff=68067"/>
		<updated>2012-06-28T17:21:52Z</updated>

		<summary type="html">&lt;p&gt;BastianW: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I´m a Joomla developer and in my spare free time I add some content to the Joomla Wiki ;-).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------&lt;br /&gt;
Elements I often use (as a kind of notepad) ;-)&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
{{JVer|1.6}}&lt;br /&gt;
{{JVer|2.5}}&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:BastianW&amp;diff=68066</id>
		<title>User:BastianW</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:BastianW&amp;diff=68066"/>
		<updated>2012-06-28T17:21:32Z</updated>

		<summary type="html">&lt;p&gt;BastianW: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I´m a Joomla developer and in my spare free time I add some content to the Joomla Wiki ;-).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------&lt;br /&gt;
Elements I often use (as a kind of notepad) ;-)&lt;br /&gt;
&lt;br /&gt;
{{JVer|1.5}}&lt;br /&gt;
{{JVer|1.6}}&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:How_to_add_breadcrumbs&amp;diff=68065</id>
		<title>J1.5:How to add breadcrumbs</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:How_to_add_breadcrumbs&amp;diff=68065"/>
		<updated>2012-06-28T17:20:29Z</updated>

		<summary type="html">&lt;p&gt;BastianW: added information that this section is only for joomla 1.5/1.6&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{JVer|1.5}}{{JVer|1.6}}This tutorial was written for Joomla 1.5, however the differences to Joomla 1.6 are minor.&lt;br /&gt;
&lt;br /&gt;
Breadcrumbs are nice way to display the connection from the root. It gives you a hierarchical representation with click able links so that user can visit upper links easily. Breadcrumbs can be added in templates by using the object returned by $mainframe-&amp;gt;getPathWay(). The member function addItem() allows to add a breadcrumb with the title of choice. &lt;br /&gt;
&lt;br /&gt;
There are two parameters used for breadcrumbs creation process, and the first parameter is the title for the breadcrumb and the second parameter is the URL. If we do not need the breadcrumb to work like a link then we need to simply pass a blank string and then it will not work like a click able URL. This term is useful for hierarchical components where we have subcategories: we can generate a link to each and then end with the title of the current record or category.&lt;br /&gt;
&lt;br /&gt;
The JPathway is currently used by the breadcrumbs module. If you are adding a new component and have already configured breadcrumbs, you may need to go into the breadcrumbs configuration and add the menu item for you component to the selection on the menu selelist.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
A view&#039;s view.php could look something like this.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class exampleViewdefault extends JView {&lt;br /&gt;
	function display($tpl = null) {&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
		$mainframe = &amp;amp;JFactory::getApplication();&lt;br /&gt;
		$document  = &amp;amp;JFactory::getDocument();		&lt;br /&gt;
		$pathway   =&amp;amp; $mainframe-&amp;gt;getPathway();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		JHTML::_(&#039;behavior.modal&#039;);&lt;br /&gt;
		$model =&amp;amp; $this-&amp;gt;getModel();&lt;br /&gt;
		$data = $model-&amp;gt;getData();&lt;br /&gt;
&lt;br /&gt;
		$this-&amp;gt;assignRef( &#039;events&#039;, $data);&lt;br /&gt;
&lt;br /&gt;
		$document-&amp;gt;setTitle( $this-&amp;gt;events[&#039;name&#039;] );		&lt;br /&gt;
		$pathway-&amp;gt;addItem($this-&amp;gt;events[&#039;name&#039;], &#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also==&lt;br /&gt;
* http://docs.joomla.org/JPathway&lt;br /&gt;
* http://api.joomla.org/1.5/Joomla-Framework/Application/JPathway.html&lt;br /&gt;
* http://api.joomla.org/11.4/Joomla-Platform/Application/JPathway.html&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]][[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5:How_to_add_breadcrumbs&amp;diff=68064</id>
		<title>J1.5:How to add breadcrumbs</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5:How_to_add_breadcrumbs&amp;diff=68064"/>
		<updated>2012-06-28T17:14:41Z</updated>

		<summary type="html">&lt;p&gt;BastianW: /* See Also */ Fixed URLs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Breadcrumbs are nice way to display the connection from the root. It gives you a hierarchical representation with click able links so that user can visit upper links easily. Breadcrumbs can be added in templates by using the object returned by $mainframe-&amp;gt;getPathWay(). The member function addItem() allows to add a breadcrumb with the title of choice. &lt;br /&gt;
&lt;br /&gt;
There are two parameters used for breadcrumbs creation process, and the first parameter is the title for the breadcrumb and the second parameter is the URL. If we do not need the breadcrumb to work like a link then we need to simply pass a blank string and then it will not work like a click able URL. This term is useful for hierarchical components where we have subcategories: we can generate a link to each and then end with the title of the current record or category.&lt;br /&gt;
&lt;br /&gt;
The JPathway is currently used by the breadcrumbs module. If you are adding a new component and have already configured breadcrumbs, you may need to go into the breadcrumbs configuration and add the menu item for you component to the selection on the menu selelist.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
A view&#039;s view.php could look something like this.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class exampleViewdefault extends JView {&lt;br /&gt;
	function display($tpl = null) {&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
		$mainframe = &amp;amp;JFactory::getApplication();&lt;br /&gt;
		$document  = &amp;amp;JFactory::getDocument();		&lt;br /&gt;
		$pathway   =&amp;amp; $mainframe-&amp;gt;getPathway();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		JHTML::_(&#039;behavior.modal&#039;);&lt;br /&gt;
		$model =&amp;amp; $this-&amp;gt;getModel();&lt;br /&gt;
		$data = $model-&amp;gt;getData();&lt;br /&gt;
&lt;br /&gt;
		$this-&amp;gt;assignRef( &#039;events&#039;, $data);&lt;br /&gt;
&lt;br /&gt;
		$document-&amp;gt;setTitle( $this-&amp;gt;events[&#039;name&#039;] );		&lt;br /&gt;
		$pathway-&amp;gt;addItem($this-&amp;gt;events[&#039;name&#039;], &#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
		parent::display($tpl);&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also==&lt;br /&gt;
* http://docs.joomla.org/JPathway&lt;br /&gt;
* http://api.joomla.org/1.5/Joomla-Framework/Application/JPathway.html&lt;br /&gt;
* http://api.joomla.org/11.4/Joomla-Platform/Application/JPathway.html&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]][[Category:Component Development]]&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=API17:JDatabase::loadObjectList&amp;diff=68040</id>
		<title>API17:JDatabase::loadObjectList</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=API17:JDatabase::loadObjectList&amp;diff=68040"/>
		<updated>2012-06-26T21:33:01Z</updated>

		<summary type="html">&lt;p&gt;BastianW: addes small example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
=={{JVer|11.1}} JDatabase::loadObjectList==&lt;br /&gt;
===Description===&lt;br /&gt;
Method to get an array of the result set rows from the database query where each row is an object. &lt;br /&gt;
&lt;br /&gt;
{{Description:JDatabase::loadObjectList}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[Description:JDatabase::loadObjectList|Edit Descripton]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public function loadObjectList (&lt;br /&gt;
        $key=&#039;&#039;&lt;br /&gt;
        $class= &#039;stdClass&#039;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameter&lt;br /&gt;
!Type&lt;br /&gt;
!Default&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|$key&lt;br /&gt;
|&lt;br /&gt;
|&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|$class&lt;br /&gt;
|&lt;br /&gt;
|&#039;stdClass&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Returns&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;Defined&#039;&#039;&#039; on line 707 of libraries/joomla/database/database.php&lt;br /&gt;
===See also===&lt;br /&gt;
* {{JVer|11.1}} &#039;&#039;&#039;JDatabase::loadObjectList source code&#039;&#039;&#039; on [[jplatform:database/database.php#cl-699|BitBucket]]&lt;br /&gt;
* {{JVer|11.1}} Class [[JDatabase/11.1|JDatabase]]&lt;br /&gt;
* {{JVer|11.1}} Subpackage [[Subpackage_Database/11.1|Database]]&lt;br /&gt;
* [[JDatabase::loadObjectList|Other versions of JDatabase::loadObjectList]]&lt;br /&gt;
{{SeeAlso:JDatabase::loadObjectList}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[SeeAlso:JDatabase::loadObjectList|Edit See Also]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
===User contributed notes===&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Create a new query object.		&lt;br /&gt;
$db = &amp;amp;JFactory::getDBO();&lt;br /&gt;
$query = $db-&amp;gt;getQuery(true);&lt;br /&gt;
$query-&amp;gt;select(&#039;cats.description AS description, cats.title AS titel&#039;);&lt;br /&gt;
$query-&amp;gt;from(&#039;#__categories AS cats&#039;);&lt;br /&gt;
$query-&amp;gt;where(&#039;cats.id=&amp;quot;1&amp;quot;&#039;);&lt;br /&gt;
$db-&amp;gt;setQuery($query);&lt;br /&gt;
$Category = $db-&amp;gt;loadObjectList();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CodeExamplesForm /&amp;gt;&lt;br /&gt;
&amp;lt;dpl&amp;gt;&lt;br /&gt;
noresultsheader=\n&lt;br /&gt;
category=JDatabase::loadObjectList&lt;br /&gt;
category=CodeExample&lt;br /&gt;
category=MethodExample&lt;br /&gt;
include=*&lt;br /&gt;
namespace=CodeExample&lt;br /&gt;
format= ,,,&lt;br /&gt;
&amp;lt;/dpl&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:JDatabase]][[Category:JDatabase::loadObjectList]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=API17:JApplication::enqueueMessage&amp;diff=67833</id>
		<title>API17:JApplication::enqueueMessage</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=API17:JApplication::enqueueMessage&amp;diff=67833"/>
		<updated>2012-06-23T06:59:35Z</updated>

		<summary type="html">&lt;p&gt;BastianW: /* Examples */  added frontent example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
=={{JVer|11.1}} JApplication::enqueueMessage==&lt;br /&gt;
===Description===&lt;br /&gt;
Enqueue a system message. &lt;br /&gt;
&lt;br /&gt;
{{Description:JApplication::enqueueMessage}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[Description:JApplication::enqueueMessage|Edit Descripton]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public function enqueueMessage (&lt;br /&gt;
        $msg&lt;br /&gt;
        $type= &#039;message&#039;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameter&lt;br /&gt;
!Type&lt;br /&gt;
!Default&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|$msg&lt;br /&gt;
|string&lt;br /&gt;
|&lt;br /&gt;
|The message to enqueue. &lt;br /&gt;
|-&lt;br /&gt;
|$type&lt;br /&gt;
|string&lt;br /&gt;
|&#039;message&#039;&lt;br /&gt;
|The message type. &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Returns&#039;&#039;&#039; void&lt;br /&gt;
* &#039;&#039;&#039;Defined&#039;&#039;&#039; on line 390 of libraries/joomla/application/application.php&lt;br /&gt;
* &#039;&#039;&#039;Since&#039;&#039;&#039; {{JVer|11.1 }}&lt;br /&gt;
===See also===&lt;br /&gt;
* {{JVer|11.1}} &#039;&#039;&#039;JApplication::enqueueMessage source code&#039;&#039;&#039; on [[jplatform:application/application.php#cl-382|BitBucket]]&lt;br /&gt;
* {{JVer|11.1}} Class [[JApplication/11.1|JApplication]]&lt;br /&gt;
* {{JVer|11.1}} Subpackage [[Subpackage_Application/11.1|Application]]&lt;br /&gt;
* [[JApplication::enqueueMessage|Other versions of JApplication::enqueueMessage]]&lt;br /&gt;
{{SeeAlso:JApplication::enqueueMessage}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[SeeAlso:JApplication::enqueueMessage|Edit See Also]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
To enqueue a message (in a module) for a administration/backend component:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;_mainframe-&amp;gt;enqueueMessage(&#039;YOUR MESSAGE GOES HERE&#039;, &#039;message&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enqueue a message (in a module) for a website/frontent component:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JFactory::getApplication()-&amp;gt;enqueueMessage(&#039;YOUR MESSAGE GOES HERE&#039;, &#039;message&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===User contributed notes===&lt;br /&gt;
&amp;lt;CodeExamplesForm /&amp;gt;&lt;br /&gt;
&amp;lt;dpl&amp;gt;&lt;br /&gt;
noresultsheader=\n&lt;br /&gt;
category=JApplication::enqueueMessage&lt;br /&gt;
category=CodeExample&lt;br /&gt;
category=MethodExample&lt;br /&gt;
include=*&lt;br /&gt;
namespace=CodeExample&lt;br /&gt;
format= ,,,&lt;br /&gt;
&amp;lt;/dpl&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:JApplication]][[Category:JApplication::enqueueMessage]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=API17:JApplication::enqueueMessage&amp;diff=67832</id>
		<title>API17:JApplication::enqueueMessage</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=API17:JApplication::enqueueMessage&amp;diff=67832"/>
		<updated>2012-06-23T06:48:02Z</updated>

		<summary type="html">&lt;p&gt;BastianW: Added &amp;quot;Examples&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
=={{JVer|11.1}} JApplication::enqueueMessage==&lt;br /&gt;
===Description===&lt;br /&gt;
Enqueue a system message. &lt;br /&gt;
&lt;br /&gt;
{{Description:JApplication::enqueueMessage}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[Description:JApplication::enqueueMessage|Edit Descripton]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public function enqueueMessage (&lt;br /&gt;
        $msg&lt;br /&gt;
        $type= &#039;message&#039;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameter&lt;br /&gt;
!Type&lt;br /&gt;
!Default&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|$msg&lt;br /&gt;
|string&lt;br /&gt;
|&lt;br /&gt;
|The message to enqueue. &lt;br /&gt;
|-&lt;br /&gt;
|$type&lt;br /&gt;
|string&lt;br /&gt;
|&#039;message&#039;&lt;br /&gt;
|The message type. &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
* &#039;&#039;&#039;Returns&#039;&#039;&#039; void&lt;br /&gt;
* &#039;&#039;&#039;Defined&#039;&#039;&#039; on line 390 of libraries/joomla/application/application.php&lt;br /&gt;
* &#039;&#039;&#039;Since&#039;&#039;&#039; {{JVer|11.1 }}&lt;br /&gt;
===See also===&lt;br /&gt;
* {{JVer|11.1}} &#039;&#039;&#039;JApplication::enqueueMessage source code&#039;&#039;&#039; on [[jplatform:application/application.php#cl-382|BitBucket]]&lt;br /&gt;
* {{JVer|11.1}} Class [[JApplication/11.1|JApplication]]&lt;br /&gt;
* {{JVer|11.1}} Subpackage [[Subpackage_Application/11.1|Application]]&lt;br /&gt;
* [[JApplication::enqueueMessage|Other versions of JApplication::enqueueMessage]]&lt;br /&gt;
{{SeeAlso:JApplication::enqueueMessage}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[SeeAlso:JApplication::enqueueMessage|Edit See Also]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
To enqueue a message (in the module) for a administration/backend component:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;_mainframe-&amp;gt;enqueueMessage(&#039;LoremImpsum&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===User contributed notes===&lt;br /&gt;
&amp;lt;CodeExamplesForm /&amp;gt;&lt;br /&gt;
&amp;lt;dpl&amp;gt;&lt;br /&gt;
noresultsheader=\n&lt;br /&gt;
category=JApplication::enqueueMessage&lt;br /&gt;
category=CodeExample&lt;br /&gt;
category=MethodExample&lt;br /&gt;
include=*&lt;br /&gt;
namespace=CodeExample&lt;br /&gt;
format= ,,,&lt;br /&gt;
&amp;lt;/dpl&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:JApplication]][[Category:JApplication::enqueueMessage]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:BastianW&amp;diff=67816</id>
		<title>User:BastianW</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:BastianW&amp;diff=67816"/>
		<updated>2012-06-22T20:42:19Z</updated>

		<summary type="html">&lt;p&gt;BastianW: Created page with &amp;quot;I´m a Joomla developer and in my spare free time I add some content to the Joomla Wiki ;-).&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I´m a Joomla developer and in my spare free time I add some content to the Joomla Wiki ;-).&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=API16:JDatabaseQuery/order&amp;diff=67815</id>
		<title>API16:JDatabaseQuery/order</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=API16:JDatabaseQuery/order&amp;diff=67815"/>
		<updated>2012-06-22T20:39:08Z</updated>

		<summary type="html">&lt;p&gt;BastianW: /* Examples */ Added a small order example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[Description:JDatabaseQuery/order|Edit Descripton]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Description:JDatabaseQuery/order}}&lt;br /&gt;
&lt;br /&gt;
===Syntax===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;order($columns)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Parameter Name&lt;br /&gt;
!Default Value&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
| $columns&lt;br /&gt;
| &lt;br /&gt;
|  A string or array of ordering columns &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Defined in===&lt;br /&gt;
libraries/joomla/database/databasequery.php&lt;br /&gt;
===Importing===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;jimport( &#039;joomla.database.databasequery&#039; );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Source Body===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
public function order($columns)&lt;br /&gt;
{&lt;br /&gt;
        if (is_null($this-&amp;gt;_order)) {&lt;br /&gt;
                $this-&amp;gt;_order = new JDatabaseQueryElement(&#039;ORDER BY&#039;, $columns);&lt;br /&gt;
        } else {&lt;br /&gt;
                $this-&amp;gt;_order-&amp;gt;append($columns);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        return $this;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;editsection&amp;quot; style=&amp;quot;font-size:76%;&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[SeeAlso:JDatabaseQuery/order|Edit See Also]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
{{SeeAlso:JDatabaseQuery/order}}&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&amp;lt;CodeExamplesForm /&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$query-&amp;gt;from(&#039;`#__categories` AS a&#039;);		&lt;br /&gt;
$query-&amp;gt;where(&#039;a.extension = &amp;quot;com_weblinks&amp;quot; and a.published = &amp;quot;1&amp;quot;&#039;);		&lt;br /&gt;
$query-&amp;gt;order(&#039;a.title ASC&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dpl&amp;gt;&lt;br /&gt;
 noresultsheader=\n&lt;br /&gt;
 category=order&lt;br /&gt;
 category=JDatabaseQuery&lt;br /&gt;
 category=CodeExample&lt;br /&gt;
 category=MethodExample&lt;br /&gt;
 include=*&lt;br /&gt;
 format= ,,,&lt;br /&gt;
&amp;lt;/dpl&amp;gt;&lt;/div&gt;</summary>
		<author><name>BastianW</name></author>
	</entry>
</feed>