<?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; php</title>
	<atom:link href="http://www.ladysign-apps.com/blog/category/code/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ladysign-apps.com/blog</link>
	<description>Girls can code.</description>
	<lastBuildDate>Mon, 12 Dec 2011 16:58:15 +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><p class='read-more'><a href='http://www.ladysign-apps.com/blog/code/php/joomla-plugins-copying-fixing-or-creating-them/'>继续阅读</a></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; title: ;">&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; title: ;">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; title: ;">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>1</slash:comments>
		</item>
		<item>
		<title>Migrating from Joomla to Wordpress</title>
		<link>http://www.ladysign-apps.com/blog/code/sql/migrating-from-joomla-to-wordpress/</link>
		<comments>http://www.ladysign-apps.com/blog/code/sql/migrating-from-joomla-to-wordpress/#comments</comments>
		<pubDate>Sun, 03 May 2009 09:09:29 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[joomla]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Joomla to Wordpress]]></category>
		<category><![CDATA[Mambo]]></category>
		<category><![CDATA[Mambo to Joomla]]></category>
		<category><![CDATA[MD5]]></category>
		<category><![CDATA[Migration]]></category>
		<category><![CDATA[password encryption]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[Porting]]></category>

		<guid isPermaLink="false">http://ladysign-apps.com/blog/?p=664</guid>
		<description><![CDATA[<p><strong>Difficulty:</strong> 2 out of 5 stars</p>
<p>One of my websites is build on the CMS Joomla. These days I&#8217;m much more comfortable with Wordpress.<br />
Today I will gu[......]</p><p class='read-more'><a href='http://www.ladysign-apps.com/blog/code/sql/migrating-from-joomla-to-wordpress/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>Difficulty:</strong> 2 out of 5 stars</p>
<p>One of my websites is build on the CMS Joomla. These days I&#8217;m much more comfortable with Wordpress.<br />
Today I will guide you, how to easy migrate from Joomla/Mambo to Wordpress.</p>
<p><strong>Migrating Articles from Mambo/Joomla to Wordpress</strong><br />
With <a href="http://www.blevins.nl/missiontech/">this wizzard from Rodney Blevins </a>you can migrate Mambo/Joomla articles and links very easy to Wordpress.<br />
Unfortunately migrating the links didn&#8217;t really work for my Wordpress 2.7.</p>
<p><em>Notice that for this wizzard, both installations of Mambo/Joomla and Wordpress need to be on the same webserver installed.</em></p>
<ol>
<li>Download the wizzard from the above link.</li>
<li>Create a new folder &#8220;export&#8221; in the root of your Wordpress installation.</li>
<li>Edit the config.php file, with the database name, username, password of Mambo/Joomla and Wordpress database settings.</li>
<li>Incase you have Joomla installed, or you changed the database prefix; you&#8217;ll have to edit the var: &#8220;$dbprefix&#8221; to your prefix. For example: &#8220;mos_&#8221; to: &#8220;jos_&#8221;.</li>
<li>Incase the database prefix for the Wordpress DB is different then &#8220;wp_&#8221;; open up the index.php file, and search / replace all: &#8220;wp_&#8221; and change it manually to your prefix. For example: &#8220;wp_&#8221; to &#8220;lee_&#8221;.</li>
<li>Now save and upload the index.php and config.php files to the export folder</li>
<li>Surf to http://your-wp-installation/export and follow the steps to import your articles or links into Wordpress.</li>
</ol>
<p><strong>Removing Mambo/Joomla tags from Wordpress posts</strong><br />
Now when your done, it could be that your Wordpress post message contain Joomla tags in the post.<br />
Tags like: &#8220;{mosimage}&#8221; or plugin based tags like: &#8220;{rokaccess}&#8221;.<br />
You can easily remove these tags from all your post with some database queries.<br />
Open phpMyAdmin and within your Wordpress database, press the SQL tab.</p>
<p>To see how many post I have with Mambo/Joomla tags, I used this query:</p>
<pre class="brush: sql; title: ;">
SELECT * FROM wp_posts WHERE post_content LIKE &amp;quot;%{%&amp;quot;
</pre>
<p>I noticed by the retrieved list, that some of my posts contain the {mosimage} tag.<br />
To remove (replace to empty string) these tags and update my posts, I used the following query:</p>
<pre class="brush: sql; title: ;">
UPDATE wp_posts SET post_content = replace(post_content, &amp;quot;{mosimage}&amp;quot;, &amp;quot;&amp;quot;);
</pre>
<p>Just another check, to see if 0 posts return, if I search in my Wordpress database for the {mosimage} tag:</p>
<pre class="brush: sql; title: ;">
SELECT * FROM wp_posts WHERE post_content LIKE &amp;quot;{mosimage}&amp;quot;
</pre>
<p><strong>Migrating users</strong><br />
The next important thing to migrate, will be the user database.<br />
Let&#8217;s compare both XML exports from phpMyAdmin, to see the table structures:</p>
<p>Joomla Export:</p>
<pre class="brush: xml; title: ;">
&amp;lt;jos_users&amp;gt;
    &amp;lt;id&amp;gt;64&amp;lt;/id&amp;gt;
    &amp;lt;name&amp;gt;Lee&amp;lt;/name&amp;gt;
    &amp;lt;username&amp;gt;Lee&amp;lt;/username&amp;gt;
    &amp;lt;email&amp;gt;my@email.nl&amp;lt;/email&amp;gt;
    &amp;lt;password&amp;gt;###&amp;lt;/password&amp;gt;
    &amp;lt;usertype&amp;gt;Super Administrator&amp;lt;/usertype&amp;gt;
    &amp;lt;block&amp;gt;0&amp;lt;/block&amp;gt;
    &amp;lt;sendEmail&amp;gt;0&amp;lt;/sendEmail&amp;gt;
    &amp;lt;gid&amp;gt;25&amp;lt;/gid&amp;gt;
    &amp;lt;registerDate&amp;gt;2007-07-25 21:57:51&amp;lt;/registerDate&amp;gt;
    &amp;lt;lastvisitDate&amp;gt;2009-05-01 18:01:52&amp;lt;/lastvisitDate&amp;gt;
    &amp;lt;activation&amp;gt;&amp;lt;/activation&amp;gt;
    &amp;lt;params&amp;gt;editor=none&amp;lt;/params&amp;gt;
&amp;lt;/jos_users&amp;gt;
</pre>
<p>Same Export in Wordpress would be:</p>
<pre class="brush: xml; title: ;">
&amp;lt;wp_users&amp;gt;
    &amp;lt;user_login&amp;gt;Lee&amp;lt;/user_login&amp;gt;
    &amp;lt;user_pass&amp;gt;&amp;lt;/user_pass&amp;gt;
    &amp;lt;user_nicename&amp;gt;Lee&amp;lt;/user_nicename&amp;gt;
    &amp;lt;user_email&amp;gt;my@email.nl&amp;lt;/user_email&amp;gt;
    &amp;lt;user_url&amp;gt;http://www.ladysign.nl&amp;lt;/user_url&amp;gt;
    &amp;lt;user_registered&amp;gt;2007-07-25 21:57:51&amp;lt;&amp;lt;/user_registered&amp;gt;
    &amp;lt;user_activation_key&amp;gt;&amp;lt;/user_activation_key&amp;gt;
    &amp;lt;user_status&amp;gt;0&amp;lt;/user_status&amp;gt;
    &amp;lt;display_name&amp;gt;Lee&amp;lt;/display_name&amp;gt;
&amp;lt;/wp_users&amp;gt;
</pre>
<p>Be replacing the table names in the export, or writing a nice script which creates a INSERT INTO query,<br />
you can prefill the Wordpress database with the users from the Mambo/Joomla user table.<br />
However, there will be one problem.</p>
<p><strong>Password encryption</strong><br />
And that problem is setting over the passwords.<br />
Joomla! 1.5 uses MD5 to hash the passwords.  When the passwords are created, they are hashed with a 32 character salt that is appended to the end of the password string.<br />
The password is stored as {TOTAL HASH}:{ORIGINAL SALT}.<br />
That&#8217;s diffrent then the MD5 encryption of Wordpress.<br />
For now I&#8217;ll solve this, by removing all the Wordpress passwords, and let the user recreate a new one via &#8216;lost password&#8217;.<br />
This is ofcourse not a nice solution. Does anyone has an idea?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ladysign-apps.com/blog/code/sql/migrating-from-joomla-to-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wordpress: user restrictions tags</title>
		<link>http://www.ladysign-apps.com/blog/code/php/wordpress-user-restrictions-tags/</link>
		<comments>http://www.ladysign-apps.com/blog/code/php/wordpress-user-restrictions-tags/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 20:38:45 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[current_user]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[user levels]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress user restrictions]]></category>

		<guid isPermaLink="false">http://ladysign-apps.com/blog/?p=516</guid>
		<description><![CDATA[<p><strong>Difficulty:</strong> 1 out of 5 stars<br />
I was working on a Wordpress blog, where I wanted to put some handy coding information, just for myself and my colleague&#038;[......]</p><p class='read-more'><a href='http://www.ladysign-apps.com/blog/code/php/wordpress-user-restrictions-tags/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>Difficulty:</strong> 1 out of 5 stars<br />
I was working on a Wordpress blog, where I wanted to put some handy coding information, just for myself and my colleague&#8217;s. Ofcourse I don&#8217;t want the whole world to read it and luckily Wordpress can set the visibility of posts to private.</p>
<p>That&#8217;s nice, but when you have only private posts in a menu category, this menu option won&#8217;t be shown on the page. So, what I did, is placing a first category post (with a date of early history), in front of it. And this page contains no secret information.<br />
Well yeah, ok, then the category option is visible in my menu, but when unknown blog readers click on this link, they will see a useless blogpost.</p>
<p>To solve this you need to script some php / wordpress function tags in your template.<br />
Let&#8217;s use the current_user object. It can retrieve the level of the user.<br />
The user level of an &#8216;Admin&#8217; is 10, the level of a &#8220;Contributor&#8221; 1.<br />
What I want is to show my &#8220;secret&#8221; menu, for everybody of userlevel 1 or above.<br />
And to display to everybody the &#8220;normal&#8221; menu.<br />
This is the code for in my sidebar.php:</p>
<pre class="brush: php; title: ;">
//my normal menu, excluding the (id of the) secret menu
	&lt;?php wp_list_categories('exclude=10'); ?&gt;
//my secret menu, excluding the (id of the) normal menu
	&lt;?php global $current_user;
		get_currentuserinfo();
		if($current_user-&gt;user_level &gt;= 1){
			wp_list_categories('exclude=11');
		}
	?&gt;
</pre>
<p>Now you just have to create some level 1 or higher, users!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ladysign-apps.com/blog/code/php/wordpress-user-restrictions-tags/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

