<?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=JulienV</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=JulienV"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/JulienV"/>
	<updated>2026-08-19T17:59:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Triggering_content_plugins_in_your_extension&amp;diff=166813</id>
		<title>J3.x:Triggering content plugins in your extension</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Triggering_content_plugins_in_your_extension&amp;diff=166813"/>
		<updated>2015-03-27T17:13:35Z</updated>

		<summary type="html">&lt;p&gt;JulienV: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version|2.5,3.x}}&lt;br /&gt;
A common example of [[Supporting plugins in your component|using plugins]] is to run the &#039;&#039;&#039;content plugins&#039;&#039;&#039; on some text. This is useful if you want to support plugins that usually work on Content from a custom extension. For the content prepare trigger you can simply call:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$text = JHtml::_(&#039;content.prepare&#039;, $text);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For any other content triggers you must call:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$article = new stdClass;&lt;br /&gt;
$article-&amp;gt;text = $text;&lt;br /&gt;
&lt;br /&gt;
// add more to parameters if needed&lt;br /&gt;
$params = new JObject;&lt;br /&gt;
&lt;br /&gt;
// Note JDispatcher is deprecated in favour of JEventDispatcher in Joomla 3.x however still works.&lt;br /&gt;
JPluginHelper::importPlugin(&#039;content&#039;);&lt;br /&gt;
$dispatcher = JDispatcher::getInstance();&lt;br /&gt;
$dispatcher-&amp;gt;trigger(&#039;onContentPrepare&#039;, array(&#039;some.context&#039;, &amp;amp;$article, &amp;amp;$params, 0));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You might want to look at core components (for example com_content) for an example. See the [[Plugin/Events|triggers page]] for the possible content plugin triggers.&lt;br /&gt;
&lt;br /&gt;
Also for PHP5.3 compliance please look at the discussion page.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Extension development]][[Category:Plugins]]&lt;br /&gt;
[[Category:Plugin Development]]&lt;br /&gt;
[[Category:Development Recommended Reading]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>JulienV</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Triggering_content_plugins_in_your_extension&amp;diff=166812</id>
		<title>J3.x:Triggering content plugins in your extension</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Triggering_content_plugins_in_your_extension&amp;diff=166812"/>
		<updated>2015-03-27T17:09:29Z</updated>

		<summary type="html">&lt;p&gt;JulienV: The example was using onPrepareContent instead of onContentPrepare&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{version|2.5,3.x}}&lt;br /&gt;
A common example of [[Supporting plugins in your component|using plugins]] is to run the &#039;&#039;&#039;content plugins&#039;&#039;&#039; on some text. This is useful if you want to support plugins that usually work on Content from a custom extension. For the content prepare trigger you can simply call:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$text = JHtml::_(&#039;content.prepare&#039;, $text);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For any other content triggers you must call:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Note JDispatcher is deprecated in favour of JEventDispatcher in Joomla 3.x however still works.&lt;br /&gt;
$dispatcher = JDispatcher::getInstance();&lt;br /&gt;
$item-&amp;gt;text = your_text_area_item;  &lt;br /&gt;
$item-&amp;gt;params = new JRegistry;&lt;br /&gt;
JPluginHelper::importPlugin(&#039;content&#039;); &lt;br /&gt;
$dispatcher-&amp;gt;trigger(&#039;onContentPrepare&#039;, array (&#039;some.context&#039;, &amp;amp;$item, 0)); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You might want to look at core components (for example com_content) for an example. See the [[Plugin/Events|triggers page]] for the possible content plugin triggers.&lt;br /&gt;
&lt;br /&gt;
Also for PHP5.3 compliance please look at the discussion page.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Extension development]][[Category:Plugins]]&lt;br /&gt;
[[Category:Plugin Development]]&lt;br /&gt;
[[Category:Development Recommended Reading]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>JulienV</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Joomla_CodeSniffer&amp;diff=101402</id>
		<title>Joomla CodeSniffer</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Joomla_CodeSniffer&amp;diff=101402"/>
		<updated>2013-07-05T22:03:08Z</updated>

		<summary type="html">&lt;p&gt;JulienV: /* PHPStorm: added method to add joomla code style */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{page|needs technical review|This page needs expanded installation instructions, especially for Windows-based systems}}&lt;br /&gt;
&lt;br /&gt;
== A Nose For Joomla ==&lt;br /&gt;
&lt;br /&gt;
This is a custom coding standard for the PHP CodeSniffer that attempts to codify and enforce the Joomla coding standards.&lt;br /&gt;
&lt;br /&gt;
==Why?==&lt;br /&gt;
&lt;br /&gt;
- Coherent and consisting coding practice makes the files look more professional. Conflicting styles in the same project (or worse, the same file) not only look sloppy, they encourage further sloppiness.&lt;br /&gt;
&lt;br /&gt;
- When all code complies with the same standard, bad code is easier for everyone to spot.&lt;br /&gt;
&lt;br /&gt;
- It makes it easier for someone new to a particular file in the project to find and fix errors, or extend functionality.&lt;br /&gt;
&lt;br /&gt;
- If there is no consistent standard maintained, the sometimes developers will reformat the code to suit themselves. This causes a wide range of changes in the code repository, and if there is a later problem, a significant change could be lost in the chaff produced by a diff.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
First of all you have to install the [http://pear.php.net/package/PHP_CodeSniffer/ PHP CodeSniffer]. This set of files is intended to work with phpcs version 1.4, so behavior with any other version is undefined. One way to do this is to start the console (cmd.exe in windows environments) and type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pear install PHP_CodeSniffer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To specify a specific version of the PHP CodeSniffer, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pear install PHP_CodeSniffer-1.4.x&amp;lt;/code&amp;gt; (specify a number for x, versions 1.4.0 through 1.4.5 are available)&lt;br /&gt;
&lt;br /&gt;
Pear will handle the whole installation by itself.&lt;br /&gt;
&lt;br /&gt;
Then download and unzip the [https://github.com/joomla/coding-standards Joomla! CodeSniffer] and copy the contents of it into /path/to/PHP_CodeSniffer/Standards/Joomla.&lt;br /&gt;
&lt;br /&gt;
In Unix systems this path is usually /usr/lib/php/PHP/PHP_CodeSniffer/Standards/Joomla but this varies from system to system. In Xubuntu 12.04, the path is /usr/share/php/PHP/CodeSniffer/Standards/Joomla.&lt;br /&gt;
Windows based system with XAMPP have the following path: PATH_TO_XAMMP\php\PEAR\PHP\CodeSniffer\Standards (for example: C:\xampp\php\PEAR\PHP\CodeSniffer\Standards)&lt;br /&gt;
&lt;br /&gt;
Use &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pear config-get php_dir&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to find out where the PEAR directory is on your system, then add &amp;quot;/PHP/PHP_CodeSniffer/Standards&amp;quot; to it.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
You invoke the custom standard by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;phpcs --standard=Joomla file/to/sniff&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test a platform file using the provided platform coding standards use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;phpcs --standard=build/phpcs/Joomla path/to/file/or/folder&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further documentation on the use of phpcs can be found at: [http://pear.php.net/package/PHP_CodeSniffer/docs]&lt;br /&gt;
&lt;br /&gt;
==IDE integration==&lt;br /&gt;
&lt;br /&gt;
While everybody loves the console as it is with no doubt the most effective way to do whatever you need to do.. sometimes even linux gurus need a little bit of comfort.&lt;br /&gt;
&lt;br /&gt;
Fortunately there is a plugin available for eclipse and netbeans that integrates the CodeSniffer in our favorite IDE, so any coding standard violations are shown like &amp;quot;normal&amp;quot; errors.&lt;br /&gt;
&lt;br /&gt;
=== Netbeans ===&lt;br /&gt;
&lt;br /&gt;
For netbeans you have to install the sniffer plugin first. You can download the plugin [http://sourceforge.net/projects/phpmdnb/files/nbm/ here].&lt;br /&gt;
&lt;br /&gt;
# Start your netbeans IDE&lt;br /&gt;
# Open Tools =&amp;gt; Plugins =&amp;gt; Downloaded and press &#039;&#039;Add Plugin&#039;&#039;&lt;br /&gt;
# Choose the loaded nbm file and confirm the installation&lt;br /&gt;
# Now there is a new tab in Tools =&amp;gt; Options =&amp;gt; PHP called &amp;quot;PHPCodeSniffer&amp;quot;&lt;br /&gt;
# You have to set the path to the &#039;&#039;phpcs.bat&#039;&#039; from the installed PHP_CodeSniffer PEAR package&lt;br /&gt;
#* for Unix based systems the path is something like /usr/bin/phpcs&lt;br /&gt;
#* in XAMPP (windows) you can find the file in the php root folder (e.g. C:\xampp\php\phpcs.bat)&lt;br /&gt;
# As &amp;quot;standard&amp;quot; type &amp;quot;Joomla&amp;quot; to use the Joomla! standard&lt;br /&gt;
# now you can click &#039;&#039;test Settings&#039;&#039; to check the settings and finish the installation by pressing &#039;&#039;Ok&#039;&#039;&lt;br /&gt;
# Open he task window (Window =&amp;gt; Tasks) to sniff your code.&lt;br /&gt;
# Most time it is a good idea to filter the task (show only in edited file or create an own filter which displays only sniff errors)&lt;br /&gt;
&lt;br /&gt;
=== Eclipse ===&lt;br /&gt;
[[Image:eclipse_pti.png|left|thumb|200px|1) Eclipse PTI]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
Installation is a breeze and follows the usual pattern:&lt;br /&gt;
# &amp;lt;tt&amp;gt;Help =&amp;gt; Install new Software...&amp;lt;/tt&amp;gt;&lt;br /&gt;
# &amp;lt;tt&amp;gt;Work with:&amp;lt;/tt&amp;gt; Fill in one of the update site URLs found here: http://www.phpsrc.org/eclipse/pti/&lt;br /&gt;
# Select the desired tools&lt;br /&gt;
# Restart Eclipse.&lt;br /&gt;
&lt;br /&gt;
[[Image:eclipse_pti_settings.png|right|thumb|150px|2) Eclipse PTI settings]]&lt;br /&gt;
You are now able to sniff for code violations against common standards like PEAR or Zend etc.&lt;br /&gt;
&lt;br /&gt;
To sniff against your own standards, all you have to do is specify their location and activate them (see screen shot 2)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;tt&amp;gt;Window =&amp;gt; Preferences&amp;lt;/tt&amp;gt;&lt;br /&gt;
# &amp;lt;tt&amp;gt;PHP Tools =&amp;gt; PHP CodeSniffer&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Happy sniffing&lt;br /&gt;
&lt;br /&gt;
=== PHPStorm ===&lt;br /&gt;
&lt;br /&gt;
==== PHPStorm ====&lt;br /&gt;
[[Image:PhpStorm4CodeSniffer.png|left|thumb|200px|1) PHPStorm  4.x CodeSniffer]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CodeSniffer is supported out of the box in PHPStorm, just go to settings, and under &amp;quot;Inspections&amp;quot; you will see the list of Sniff you have installed.&lt;br /&gt;
&lt;br /&gt;
See: the [http://www.jetbrains.com/phpstorm/webhelp/using-php-code-sniffer-tool.html JetBrains documentation page for setting the Code Sniffer]  and also  [http://blog.jetbrains.com/webide/2012/03/checking-your-code-with-php-code-sniffer-in-phpstorm-4-0/ phpStorm Blog])&lt;br /&gt;
&lt;br /&gt;
For users on ubuntu using phpStorm. Don&#039;t listen instructions at http://www.jetbrains.com/phpstorm/webhelp/using-php-code-sniffer-tool.html#d59626e1126 because there is no working bat (windows file) on linux system. To validate your CodeSniffer choose /usr/bin/phpcs launcher.&lt;br /&gt;
&lt;br /&gt;
Under Settings-&amp;gt;Inspections when you choose joomla profile, in the tree below, search for PHP and open it and than make sure that PHP Code Sniffer validation checkbox is checked. Otherwise PHP Code Sniffer won&#039;t sniff your code.&lt;br /&gt;
&lt;br /&gt;
On ubuntu you install code standards with:&lt;br /&gt;
cd /usr/share/php/PHP/CodeSniffer/Standards&lt;br /&gt;
sudo git clone http://github.com/joomla/coding-standards.git Joomla&lt;br /&gt;
===== Installing Joomla Sniff =====&lt;br /&gt;
&lt;br /&gt;
# get the sniffers from the [https://github.com/joomla/coding-standards coding standards repo]&lt;br /&gt;
# unpack Joomla CodeSniffer rules under:&lt;br /&gt;
## If you are using XAMPP &#039;&#039;\xampp\php\PEAR\PHP\CodeSniffer\Standards\Joomla&#039;&#039;&lt;br /&gt;
## If not maybe you should check here: &#039;&#039;/usr/share/php/PHP/CodeSniffer/Standards&#039;&#039;&lt;br /&gt;
# Go to Settings (CTRL-ALT-S) and search for &amp;quot;PHP Code Sniffer Validation&amp;quot;, click the button Validate to force reload of rules from disk&lt;br /&gt;
# Joomla should be now available in the list. See following image:&lt;br /&gt;
&lt;br /&gt;
[[Image:PhpStorm6CodeSniffer.png|left|thumb|200px|1) PHPStorm  6.x CodeSniffer]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Installing Joomla Code style =====&lt;br /&gt;
 &lt;br /&gt;
It&#039;s nice to be able to check that the standards are respected, but it&#039;s even nicer if phpstorm helps you formatting properly too as you are coding.&lt;br /&gt;
To add joomla code style to phpstorm&lt;br /&gt;
# first get the xml scheme file from here: https://github.com/betweenbrain/phpstorm-joomla-code-style&lt;br /&gt;
# Then save the file in phpstorm [http://www.jetbrains.com/phpstorm/webhelp/project-and-ide-settings.html#d231397e460 home directory]: &amp;lt;phpstorm home directory&amp;gt;/config/codestyles/Joomla.xml&lt;br /&gt;
# restart phpstorm, and you should be able to select Joomla from the Code Style &amp;gt; Scheme select box&lt;br /&gt;
&lt;br /&gt;
==== PHP PSR-0, PSR-1 and PSR-2 ====&lt;br /&gt;
* https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md&lt;br /&gt;
* https://github.com/pmjones/fig-standards/blob/psr-1-style-guide/proposed/PSR-1-basic.md&lt;br /&gt;
* https://github.com/pmjones/fig-standards/blob/psr-1-style-guide/proposed/PSR-2-advanced.md&lt;br /&gt;
&lt;br /&gt;
===== Installing PHP PSR-0, PSR-1 and PSR-2 Sniff =====&lt;br /&gt;
&lt;br /&gt;
A CodeSniffer sniff to check against the PSR-x Coding Standard&lt;br /&gt;
&lt;br /&gt;
Download files at&lt;br /&gt;
* https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards&lt;br /&gt;
&lt;br /&gt;
if you are using Xampp, &lt;br /&gt;
# unpack PSR-1 CodeSniffer rules under \xampp\php\PEAR\PHP\CodeSniffer\Standards\PSR (SPR or any directory will work)&lt;br /&gt;
# Go to Settings (CTRL-ALT-S) and search for &amp;quot;PHP Code Sniffer Validation&amp;quot;, click the button Validate to force reload of rules from disk&lt;br /&gt;
# PSR is available in the list&lt;br /&gt;
&lt;br /&gt;
==== PHPStorm  3.x / Alternative method ====&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: This method is outdated, but it might be useful if you are looking for a different integration. It also demonstrates the use of external tools in PHPStorm - so it shouldn&#039;t be deleted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;del&amp;gt;There is currently no plugin available&amp;lt;/del&amp;gt; The CodeSniffer can also be integrated easily as an external tool. PHPStorm will display the output in the console, including clickable links containing line and column numbers to the files that contain errors.&lt;br /&gt;
&lt;br /&gt;
* Click on &amp;quot;Settings&amp;quot; and search for &amp;quot;External tools&amp;quot;&lt;br /&gt;
* Click &amp;quot;Add...&amp;quot;&lt;br /&gt;
* Choose a &amp;quot;name&amp;quot;, &amp;quot;Group&amp;quot; and &amp;quot;Description&amp;quot;.&lt;br /&gt;
* Click &amp;quot;Output Filters&amp;quot;&lt;br /&gt;
** Click &amp;quot;Add...&amp;quot;, Choose a name and enter under &amp;quot;Regular expression to match output&amp;quot; the value: &amp;lt;tt&amp;gt;$FILE_PATH$:$LINE$:$COLUMN$&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;quot;Program&amp;quot;: Search for the phpcs executable on your system. You have to set the path to the &#039;&#039;phpcs.bat&#039;&#039; from the installed PHP_CodeSniffer PEAR package&lt;br /&gt;
** for Unix based systems the path is something like /usr/bin/phpcs&lt;br /&gt;
** in XAMPP (windows) you can find the file in the php root folder (e.g. C:\xampp\php\phpcs.bat)&lt;br /&gt;
* &amp;quot;Paramaters&amp;quot;:&lt;br /&gt;
** &amp;lt;tt&amp;gt;--standard=&amp;lt;path/to/joomla-platform&amp;gt;/build/phpcs/Joomla&amp;lt;/tt&amp;gt; The path to the Joomla! coding standards.&lt;br /&gt;
** &amp;lt;tt&amp;gt;--report=emacs&amp;lt;/tt&amp;gt; The will generate a simple list containing links to the error files&lt;br /&gt;
** Optional you may want to specify &amp;lt;tt&amp;gt;-p&amp;lt;/tt&amp;gt; for &amp;quot;progress&amp;quot; or &amp;lt;tt&amp;gt;-n&amp;lt;/tt&amp;gt; for &amp;quot;errors only&amp;quot;.&lt;br /&gt;
** The last parameter has to be &amp;lt;tt&amp;gt;$FilePath$&amp;lt;/tt&amp;gt; specifying the file or folder you want to sniff.&lt;br /&gt;
&lt;br /&gt;
A typical &amp;quot;Parameters&amp;quot; line on a Linux system might look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;-np --standard=/home/elkuku/libs/joomla/build/phpcs/Joomla --report=emacs $FilePath$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may now right click any file or folder and choose the sniffer from the context menu or add a new toolbar button with a nice Joomla! logo [[File:icon-16-joomla.png]].&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
* http://www.phpsrc.org/ PTI - PHP tools integration for Eclipse&lt;br /&gt;
* http://sourceforge.net/projects/phpmdnb/ Netbeans plugin&lt;br /&gt;
* http://hakre.wordpress.com/2010/03/06/php-code-sniffer-eclipse-and-wordpress/ - Excellent article. Just change &amp;quot;Wordpress&amp;quot; for &amp;quot;Joomla!&amp;quot; ;)&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]][[Category:Bug Squad]]&lt;/div&gt;</summary>
		<author><name>JulienV</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:Calendar_form_field_type&amp;diff=66750</id>
		<title>Talk:Calendar form field type</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Calendar_form_field_type&amp;diff=66750"/>
		<updated>2012-04-19T08:41:30Z</updated>

		<summary type="html">&lt;p&gt;JulienV: Created page with &amp;quot;it seems like the &amp;#039;format&amp;#039; uses the one from strftime, not date. Maybe it would be best to indeed change to date format anyway, but as it is, the documentation points to the wron...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;it seems like the &#039;format&#039; uses the one from strftime, not date. Maybe it would be best to indeed change to date format anyway, but as it is, the documentation points to the wrong information&lt;/div&gt;</summary>
		<author><name>JulienV</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Adapting_a_Joomla_1.5_extension_to_Joomla_2.5&amp;diff=62809</id>
		<title>Archived talk:Adapting a Joomla 1.5 extension to Joomla 2.5</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Archived_talk:Adapting_a_Joomla_1.5_extension_to_Joomla_2.5&amp;diff=62809"/>
		<updated>2011-11-02T18:35:57Z</updated>

		<summary type="html">&lt;p&gt;JulienV: regular expressions for language strings&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I believe that was valuable information (including the link to Andrew Eddies site)&lt;br /&gt;
http://docs.joomla.org/index.php?title=Upgrading_a_Joomla_1.5_extension_to_Joomla_1.6&amp;amp;diff=0&amp;amp;oldid=35451&lt;br /&gt;
--[[User:Elkuku|Elkuku]] 18:31, 18 January 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
There are several reasons for removing external links.  We don&#039;t have the resources that would be required to monitor the sites being linked to; links can easily be turned into malware distribution sites.  I&#039;m not saying that that is the case here, but such links are often added for commercial reasons, in order to drive traffic to sites that carry advertisements or products for sale or simply to increase search-engine ranking.  In order that the wiki does not become a link-fest for every commercial organisation in the community hoping to grab traffic, it is only fair that no such links are allowed.  Although Andrew has the highest standing within the community I&#039;m sure he would agree that it would be unfair to allow links to his site but not to others.  But perhaps most importantly, the presence of external links discourages potential contributors from improving the documentation here on the wiki.  I would prefer that anyone considering adding a link to an external site instead think about how the information in the wiki can be added to or improved for the benefit of all our users.  Perhaps the author of the external site can even be persuaded to donate the material; I know that Andrew has already contributed a great deal in that way so perhaps others can too. [[User:Chris Davenport|Chris Davenport]] 18:59, 18 January 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some more useful regular expressions to adapt language files and language strings to 1.7&lt;br /&gt;
* to make sure all keys are properly prefixed, for example by the component name: search ^(?!COM_MYCOMP)([^\n=]+)= replace with COM_MYCOMP_$1=&lt;br /&gt;
* to replace spaces before the = sign replace (COM_MYCOMP[^\s\n=]*)( )([^\n=]*)= with $1_$3= (run several times...)&lt;br /&gt;
* find keys with illegal characters in language files: ^([\w]+([^\w=])[^\n=]*)=&lt;br /&gt;
* for xml files, label and descriptions prefixes, replace (label|description)=&amp;quot;(?!COM_MYCOMP)([^&amp;quot;]+)&amp;quot; with $1=&amp;quot;COM_MYCOMP_$2&amp;quot;&lt;br /&gt;
* for xml files, label and descriptions spaces replace (label|description)=&amp;quot;([^\s&amp;quot;]*)[\s]+([^&amp;quot;]*)&amp;quot; with $1=&amp;quot;$2_$3&amp;quot; (several times)&lt;br /&gt;
* in php files, for prefixes replace JText::_\(\s*\&#039;(?!COM_MYCOMP)([^&#039;]*)\&#039; with JText::_(&#039;COM_MYCOMP_$1&#039; (same with sprintf, and you might need to run it with double quote too)&lt;br /&gt;
* in php files, for spaces replace JText::_\(\s*&#039;([^&#039;\s]*)( )([^&#039;]*)&#039; with JText::_(&#039;$1_$3&#039;&lt;br /&gt;
([[User:JulienV|JulienV]] 13:35, 2 November 2011 (CDT))&lt;/div&gt;</summary>
		<author><name>JulienV</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:JulienV&amp;diff=59186</id>
		<title>User:JulienV</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:JulienV&amp;diff=59186"/>
		<updated>2011-06-02T10:11:32Z</updated>

		<summary type="html">&lt;p&gt;JulienV: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://www.jlv-solutions.com&lt;br /&gt;
jlv [a] jlv-solutions.com&lt;/div&gt;</summary>
		<author><name>JulienV</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Creating_a_search_plugin&amp;diff=59185</id>
		<title>J1.5 talk:Creating a search plugin</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Creating_a_search_plugin&amp;diff=59185"/>
		<updated>2011-06-02T10:09:28Z</updated>

		<summary type="html">&lt;p&gt;JulienV: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;the php file presented here is written in a procedural way.&lt;br /&gt;
&lt;br /&gt;
For joomla 1.5, it&#039;s better to write it using a class, as explained here: http://docs.joomla.org/Creating_a_Plugin_for_Joomla_1.5&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;
// Import library dependencies&lt;br /&gt;
jimport(&#039;joomla.plugin.plugin&#039;);&lt;br /&gt;
&lt;br /&gt;
//Load the language file. Replace &#039;nameofplugin&#039; with the name of your plugin.&lt;br /&gt;
JPlugin::loadLanguage( &#039;plg_search_nameofplugin&#039; );&lt;br /&gt;
&lt;br /&gt;
class plgSearchnameofplugin extends JPlugin {&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * plugin &#039;areas&#039;, i.e. it&#039;s differents search sections&lt;br /&gt;
	 * for this example, we us only one section, but you could have several (e.g: articles, categories, author...)&lt;br /&gt;
	 * @var array&lt;br /&gt;
	 */&lt;br /&gt;
	var $_areas  = array(&lt;br /&gt;
		&#039;mypluginsearcha&#039; =&amp;gt; &#039;PLG_MYSEARCHPLUGIN_AREA_A&#039;&lt;br /&gt;
	); &lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Handles onSearchAreas Event&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return array&lt;br /&gt;
	 */&lt;br /&gt;
	function onSearchAreas()&lt;br /&gt;
	{&lt;br /&gt;
		return $this-&amp;gt;_areas;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/** &lt;br /&gt;
	 * Handles onSearchAreas event&lt;br /&gt;
	 * &lt;br /&gt;
	 * @param string $text the text to search&lt;br /&gt;
	 * @param string $phrase the type of search (exact/all/any)&lt;br /&gt;
	 * @param string $ordering ordering of the results (alpha/newest/...)&lt;br /&gt;
	 * @param array $areas areas to be search&lt;br /&gt;
	 * @return array matches&lt;br /&gt;
	 */&lt;br /&gt;
	function onSearch( $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( $this-&amp;gt;_areas ) )) {&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;
		// in case of multiple sectionS, just repeat and adapt for each, merging each section results, &lt;br /&gt;
		// and filtering with an if statement: if (!$areas || in_array(&#039;mypluginsearcha&#039;, $areas))) {...}&lt;br /&gt;
		// It will look something like this, if you have only one section &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;
	}&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
[[User:JulienV|JulienV]] 05:09, 2 June 2011 (CDT)&lt;/div&gt;</summary>
		<author><name>JulienV</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=User:JulienV&amp;diff=59184</id>
		<title>User:JulienV</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=User:JulienV&amp;diff=59184"/>
		<updated>2011-06-02T10:06:23Z</updated>

		<summary type="html">&lt;p&gt;JulienV: Created page with &amp;quot;http://www.jlv-solutions.com&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://www.jlv-solutions.com&lt;/div&gt;</summary>
		<author><name>JulienV</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Creating_a_search_plugin&amp;diff=59183</id>
		<title>J1.5 talk:Creating a search plugin</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Creating_a_search_plugin&amp;diff=59183"/>
		<updated>2011-06-02T10:05:20Z</updated>

		<summary type="html">&lt;p&gt;JulienV: proposed object oriented version of the search plugin&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;the php file presented here is written in a procedural way.&lt;br /&gt;
&lt;br /&gt;
For joomla 1.5, it&#039;s better to write it using a class, as explained here: http://docs.joomla.org/Creating_a_Plugin_for_Joomla_1.5&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;
// Import library dependencies&lt;br /&gt;
jimport(&#039;joomla.plugin.plugin&#039;);&lt;br /&gt;
&lt;br /&gt;
//Load the language file. Replace &#039;nameofplugin&#039; with the name of your plugin.&lt;br /&gt;
JPlugin::loadLanguage( &#039;plg_search_nameofplugin&#039; );&lt;br /&gt;
&lt;br /&gt;
class plgSearchnameofplugin extends JPlugin {&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * plugin &#039;areas&#039;, i.e. it&#039;s differents search sections&lt;br /&gt;
	 * for this example, we us only one section, but you could have several (e.g: articles, categories, author...)&lt;br /&gt;
	 * @var array&lt;br /&gt;
	 */&lt;br /&gt;
	var $_areas  = array(&lt;br /&gt;
		&#039;mypluginsearcha&#039; =&amp;gt; &#039;PLG_MYSEARCHPLUGIN_AREA_A&#039;&lt;br /&gt;
	); &lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * Handles onSearchAreas Event&lt;br /&gt;
	 *&lt;br /&gt;
	 * @return array&lt;br /&gt;
	 */&lt;br /&gt;
	function onSearchAreas()&lt;br /&gt;
	{&lt;br /&gt;
		return $this-&amp;gt;_areas;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/** &lt;br /&gt;
	 * Handles onSearchAreas event&lt;br /&gt;
	 * &lt;br /&gt;
	 * @param string $text the text to search&lt;br /&gt;
	 * @param string $phrase the type of search (exact/all/any)&lt;br /&gt;
	 * @param string $ordering ordering of the results (alpha/newest/...)&lt;br /&gt;
	 * @param array $areas areas to be search&lt;br /&gt;
	 * @return array matches&lt;br /&gt;
	 */&lt;br /&gt;
	function onSearch( $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( $this-&amp;gt;_areas ) )) {&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;
		// in case of multiple sectionS, just repeat and adapt for each, merging each section results, &lt;br /&gt;
		// and filtering with an if statement: if (!$areas || in_array(&#039;mypluginsearcha&#039;, $areas))) {...}&lt;br /&gt;
		// It will look something like this, if you have only one section &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;
	}&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>JulienV</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Client-side_form_validation&amp;diff=9410</id>
		<title>Client-side form validation</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Client-side_form_validation&amp;diff=9410"/>
		<updated>2008-07-25T13:51:09Z</updated>

		<summary type="html">&lt;p&gt;JulienV: changed short open tag to &amp;#039;&amp;lt;?php echo&amp;#039;. Short open tags are deprecated in php 6.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Development]]&lt;br /&gt;
&lt;br /&gt;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
Joomla 1.5 contains a behavior &#039;&#039;&#039;JHTMLBehavior::formvalidation()&#039;&#039;&#039; which enables the script &#039;&#039;&#039;validate.js&#039;&#039;&#039;.&lt;br /&gt;
It uses &#039;&#039;&#039;mootools&#039;&#039;&#039; (I think) and allows your form and its elements to be validated.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; For more recent versions of Joomla (1.5.2) use &#039;&#039;&#039;JHTML::_(&#039;behavior.formvalidation&#039;)&#039;&#039;&#039; instead of &#039;&#039;&#039;JHTMLBehavior::formvalidation()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== To enable the validation ==&lt;br /&gt;
The only thing you have to do is set the &#039;&#039;&#039;classes&#039;&#039;&#039; of the form and elements to specified meanings.&lt;br /&gt;
Classes:&lt;br /&gt;
=== Form ===&lt;br /&gt;
* form-validate -&amp;gt; enable validation&lt;br /&gt;
=== Form elements ===&lt;br /&gt;
* required&lt;br /&gt;
* validate-username&lt;br /&gt;
* validate-password&lt;br /&gt;
* validate-numeric&lt;br /&gt;
* validate-email&lt;br /&gt;
* validate-[custom] -&amp;gt; custom handlers have to be set then!&lt;br /&gt;
== Style invalid elements ==&lt;br /&gt;
If some elements don&#039;t validate they will get the class&lt;br /&gt;
* invalid&lt;br /&gt;
If you style this to e.g. red background and white foreground, your users will be able to see which fields are wrong.&lt;br /&gt;
&lt;br /&gt;
== Really only accept form after validation ==&lt;br /&gt;
If you don&#039;t want the form to submit anything unless the values are validated, here&#039;s a nice script:&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php JHTMLBehavior::formvalidation(); ?&amp;gt;&lt;br /&gt;
&amp;lt;script language=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function myValidate(f) {&lt;br /&gt;
	if (document.formvalidator.isValid(f)) {&lt;br /&gt;
		f.check.value=&#039;&amp;lt;?php echo JUtility::getToken(); ?&amp;gt;&#039;;//send token&lt;br /&gt;
		return true; &lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		alert(&#039;Some values are not acceptable.  Please retry.&#039;);&lt;br /&gt;
	}&lt;br /&gt;
	return false;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;form id=&amp;quot;WV-form&amp;quot; method=&amp;quot;post&amp;quot; class=&amp;quot;form-validate&amp;quot; onSubmit=&amp;quot;return myValidate(this);&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;check&amp;quot; value=&amp;quot;post&amp;quot;/&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;email&amp;quot; size=&amp;quot;30&amp;quot;  class=&amp;quot;required validate-email&amp;quot;/&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Submit&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The page that receives the value can check several things:&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
defined( &#039;_JEXEC&#039; ) or die( &#039;Restricted access&#039; );  //Verify Joomla enabled&lt;br /&gt;
&lt;br /&gt;
$jAp=&amp;amp; JFactory::getApplication();&lt;br /&gt;
if ($_POST[&#039;check&#039;]!=JUtility::getToken()) {&lt;br /&gt;
	//First verify if by a javascript error or other possibilities the form has not been submitted without the validation&lt;br /&gt;
	if ($_POST[&#039;check&#039;]==&#039;post&#039;)	$jAp-&amp;gt;enqueueMessage(&#039;Please check all the fields of the form, aub.&amp;lt;br/&amp;gt;&lt;br /&gt;
If your browser blocks javascript, then this form will never be succesfull.  This is a security measure.&#039;,&#039;error&#039;);&lt;br /&gt;
	//If then still the check isn&#039;t a valid token, do nothing as this might be a spoof attack or other invalid form submission&lt;br /&gt;
	return false;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Custom handlers ==&lt;br /&gt;
If you want a custome handler, you can add one to the class, as follow example (defined AFTER the validate.js):&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;Window.onDomReady(function() {&lt;br /&gt;
	document.formvalidator.setHandler(&#039;birth&#039;, function(value) {&lt;br /&gt;
		regex=/^\d{4}(-\d{2}){2}$/;&lt;br /&gt;
		return regex.test(value);&lt;br /&gt;
	})&lt;br /&gt;
})&amp;lt;/source&amp;gt;&lt;br /&gt;
You can then set any class to validate-birth to make it validate as yyyy-mm-dd.  (Valid date is not checked!)&lt;/div&gt;</summary>
		<author><name>JulienV</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Using_the_core_parameter_types&amp;diff=7371</id>
		<title>J1.5 talk:Using the core parameter types</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J1.5_talk:Using_the_core_parameter_types&amp;diff=7371"/>
		<updated>2008-05-27T13:45:46Z</updated>

		<summary type="html">&lt;p&gt;JulienV: change &amp;#039;type&amp;#039; value first letter to lowercase ?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;It seems to me that the first letter of type parameter should be lowercase: e.g. &#039;type=&amp;quot;calendar&amp;quot;&#039;&lt;br /&gt;
&lt;br /&gt;
otherwise, it doesn&#039;t work (element not defined). Now, maybe this is for next version, I&#039;m not sure, so i didn&#039;t edited myself !&lt;/div&gt;</summary>
		<author><name>JulienV</name></author>
	</entry>
</feed>