Joomla plugin’s – copying, fixing or creating them
Aug22Difficulty: 




It happens to me, every now and then.
I’m working on a great Joomla site and I need that module or plugin which I used on one of my previous project.
Bad luck! I lost the installation zip and the plugin is not available online anymore.
Though you can not install it now via the Joomla Installation manager I can get the module or plugin working.
Let’s say we have a plugin called: myPlugin (type=system), I had it installed on Joomla website X.
I need to install this plugin on Joomla website Y. I can copy from X the files to Y, that’s no big deal. However, the Joomla manager does not recognize your new transfered files.
With my below logics, you can get a broken plugin to work in Joomla. Or even create your own plugins!
- Copy the myPlugin.php and myPlugin.xml from the plugin/system/ folder of server X. (Note the folder ’system’, in my case the plugin type is called ’system’)
- Open up the myPlugin.xml file. If you don’t have the xml file anymore, so only the php file, it’s still fine.
You can create the XML file by yourself. It should have the same file name as the PHP file, but with XML extension.Usually the xml file should look something like this:
<?xml version="1.0" encoding="utf-8"?> <install version="1.5" type="plugin" group="system"> <name>System - MyPlugin</name> <author>Leee Boonstra</author> <creationDate>August 2009</creationDate> <copyright>(C) 2009 Lee Boonstra</copyright> <license>GNU/GPL</license> <authorEmail>mailadres@mail.com</authorEmail> <authorUrl>http://www.ladysign.nl</authorUrl> <version>1.0</version> <description>The description of myPlugin</description> <files> <filename plugin="myPlugin">myPlugin.php</filename> </files> <languages> <language tag="en-GB">language/en-GB/en-GB.plg_system_myPlugin.ini</language> </languages> <params addpath="/plugins/system"> <param name="myPluginFormField" type="text" size="20" label="PARAM_LABEL_FORMFIELD" default="" description="PARAM_DESC_FORMFIELD"/> </params> </install> - Within the XML file you can see in which folder the language files are stored. (see the language tag).
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.
Incase you don’t have the language files, you can create your own. (Unless you don’t care to read uppercase-code-labels in your Administration
panel instead of real translations.)en-GB.plg_system_myPlugin.ini
PARAM_LABEL_FORMFIELD=Form Field PARAM_DESC_FORMFIELD=Please fill in some text.
- After copying over all the required files, you will notice that the plugin is not visible in your Joomla plugin manager.
So how to proceed?Well Joomla stores the installed plugin information in your database! Knowing this, it’s not so hard to enable your plugin.
Open your database structure for website X in for example phpMyAdmin.
Open the plugins table (jos_plugins). - Export the row of the to be copied plugin: (myPlugin).
It’s also possible to write this SQL by yourself, it should look like this: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');
(In my database the parameter myPluginFormField has no value stored yet.)
- Before running the above SQL query on the database of server Y, make sure that the table prefix (’jos_’) is similar to server Y. Also the ‘id’ number is an increment to the id number of the last jos_plugin table row on database of server Y.
- That did the trick. Open your plugin manager in Joomla Admin panel, and you can see that the plugin is finally visible and enabled.
In this case myPlugin contains a form with a field: myPluginFormField, which will be a parameter used in the actual myPlugin.php file).
Now copy both files over to server of Joomla website Y.
Now when you know my above logics, you can understand that creating your own plugins in Joomla is not that hard at all.
One Response to “Joomla plugin’s – copying, fixing or creating them”
hi…..
i tried twice… but it is not working for shape5 Flexmenu Extention….
u can post other solution
Comments
- Pulkit Singhal
- Neil
- mike nittmann
- geniutrixone
- Mika
- Romfrosk
- steve
- shahzad
- Maurice
- Lee
- Oskar Krawczyk