﻿<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ladysign Dev Blog &#187; fixing plugins</title>
	<atom:link href="http://www.ladysign-apps.com/blog/tag/fixing-plugins/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ladysign-apps.com/blog</link>
	<description>Girls can code.</description>
	<lastBuildDate>Mon, 01 Feb 2010 09:44:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Joomla plugin&#8217;s &#8211; copying, fixing or creating them</title>
		<link>http://www.ladysign-apps.com/blog/code/php/joomla-plugins-copying-fixing-or-creating-them/</link>
		<comments>http://www.ladysign-apps.com/blog/code/php/joomla-plugins-copying-fixing-or-creating-them/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 15:23:58 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[joomla]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[create your own Joomla plugin module]]></category>
		<category><![CDATA[creating own Joomla plugins]]></category>
		<category><![CDATA[fixing plugins]]></category>
		<category><![CDATA[installing Joomla modules]]></category>
		<category><![CDATA[installing Joomla plugins]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://ladysign-apps.com/blog/?p=834</guid>
		<description><![CDATA[<p><strong>Difficulty:</strong> 3 out of 5 stars<br />
<b>It happens to me, every now and then.<br />
I&#8217;m working on a great Joomla site and I need that module or plugin which I u[......]</b></p>]]></description>
			<content:encoded><![CDATA[<p><strong>Difficulty:</strong> 3 out of 5 stars<br />
<b>It happens to me, every now and then.<br />
I&#8217;m working on a great Joomla site and I need that module or plugin which I used on one of my previous project.</p>
<p>Bad luck! I lost the installation zip and the plugin is not available online anymore.<br />
Though you can not install it now via the Joomla Installation manager I can get the module or plugin working.</b></p>
<p>Let&#8217;s say we have a plugin called: myPlugin (type=system), I had it installed on Joomla website X.<br />
I need to install this plugin on Joomla website Y. I can copy from X the files to Y, that&#8217;s no big deal. However, the Joomla manager does not recognize your new transfered files.</p>
<p>With my below logics, you can get a broken plugin to work in Joomla. Or even create your own plugins!</p>
<ul>
<li>Copy the myPlugin.php and myPlugin.xml from the plugin/system/ folder of server X.  (Note the folder &#8217;system&#8217;, in my case the plugin type is called &#8217;system&#8217;)</li>
<li>Open up the myPlugin.xml file. If you don&#8217;t have the xml file anymore, so only the php file, it&#8217;s still fine.<br />
You can create the XML file by yourself. It should have the same file name as the PHP file, but with XML extension.</p>
<p>Usually the xml file should look something like this:</p>
<pre class="brush: xml;">&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;
&amp;lt;install version=&amp;quot;1.5&amp;quot; type=&amp;quot;plugin&amp;quot; group=&amp;quot;system&amp;quot;&amp;gt;
    &amp;lt;name&amp;gt;System - MyPlugin&amp;lt;/name&amp;gt;
    &amp;lt;author&amp;gt;Leee Boonstra&amp;lt;/author&amp;gt;
    &amp;lt;creationDate&amp;gt;August 2009&amp;lt;/creationDate&amp;gt;
    &amp;lt;copyright&amp;gt;(C) 2009 Lee Boonstra&amp;lt;/copyright&amp;gt;
    &amp;lt;license&amp;gt;GNU/GPL&amp;lt;/license&amp;gt;
    &amp;lt;authorEmail&amp;gt;mailadres@mail.com&amp;lt;/authorEmail&amp;gt;
    &amp;lt;authorUrl&amp;gt;http://www.ladysign.nl&amp;lt;/authorUrl&amp;gt;
    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;
    &amp;lt;description&amp;gt;The description of myPlugin&amp;lt;/description&amp;gt;
    &amp;lt;files&amp;gt;
        &amp;lt;filename plugin=&amp;quot;myPlugin&amp;quot;&amp;gt;myPlugin.php&amp;lt;/filename&amp;gt;
    &amp;lt;/files&amp;gt;
    &amp;lt;languages&amp;gt;
	&amp;lt;language tag=&amp;quot;en-GB&amp;quot;&amp;gt;language/en-GB/en-GB.plg_system_myPlugin.ini&amp;lt;/language&amp;gt;
    &amp;lt;/languages&amp;gt;
    &amp;lt;params addpath=&amp;quot;/plugins/system&amp;quot;&amp;gt;
	&amp;lt;param name=&amp;quot;myPluginFormField&amp;quot; type=&amp;quot;text&amp;quot; size=&amp;quot;20&amp;quot; label=&amp;quot;PARAM_LABEL_FORMFIELD&amp;quot; default=&amp;quot;&amp;quot; description=&amp;quot;PARAM_DESC_FORMFIELD&amp;quot;/&amp;gt;
 &amp;lt;/params&amp;gt;
&amp;lt;/install&amp;gt;</pre>
</li>
<p>In this case myPlugin contains a form with a field: myPluginFormField, which will be a parameter used in the actual myPlugin.php file).<br />
Now copy both files over to server of Joomla website Y.
</li>
<li>Within the XML file you can see in which folder the language files are stored.  (see the language tag).<br />
You can look up the language files on the server of Joomla Website X and copy them over to the same path on the server of website Y.<br />
Incase you don&#8217;t have the language files, you can create your own. (Unless you don&#8217;t care to read uppercase-code-labels in your Administration<br />
panel instead of real translations.)</p>
<p>en-GB.plg_system_myPlugin.ini</p>
<pre class="brush: jscript;">PARAM_LABEL_FORMFIELD=Form Field
PARAM_DESC_FORMFIELD=Please fill in some text.</pre>
</li>
<li>After copying over all the required files, you will notice that the plugin is not visible in your Joomla plugin manager.<br />
So how to proceed?</p>
<p>Well Joomla stores the installed plugin information in your database! Knowing this, it&#8217;s not so hard to enable your plugin.<br />
Open your database structure for website X in for example phpMyAdmin.<br />
Open the plugins table (jos_plugins).</li>
<li>Export the row of the to be copied plugin: (myPlugin).<br />
It&#8217;s also possible to write this SQL by yourself, it should look like this:</p>
<pre class="brush: sql;">INSERT INTO `jos_plugins` (`id`, `name`, `element`, `folder`, `access`, `ordering`, `published`, `iscore`, `client_id`, `checked_out`, `checked_out_time`, `params`) VALUES
(37, 'System - MyPlugin', 'myPlugin', 'system', 0, 0, 1, 0, 0, 0, '0000-00-00 00:00:00', 'myPluginFormField=\n');</pre>
<p>(In my database the parameter myPluginFormField has no value stored yet.)
</li>
<li>Before running the above SQL query on the database of server Y, make sure that the table prefix (&#8217;jos_&#8217;) is similar to server Y. Also the &#8216;id&#8217; number is an increment to the id number of the last jos_plugin table row on database of server Y.</li>
<li>That did the trick. Open your plugin manager in Joomla Admin panel, and you can see that the plugin is finally visible and enabled.
</ul>
<p>Now when you know my above logics, you can understand that creating your own plugins in Joomla is not that hard at all.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ladysign-apps.com/blog/code/php/joomla-plugins-copying-fixing-or-creating-them/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
