<?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>Tutorials, scripts, templates and tips &#187; PHP</title>
	<atom:link href="http://www.bloggpro.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bloggpro.com</link>
	<description>Excel, Wordpress, MS Office tips, CSS, PHP, MySQL scripting and web publishing</description>
	<lastBuildDate>Sun, 21 Aug 2011 05:45:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Add a simple map in your WordPress sidebar</title>
		<link>http://www.bloggpro.com/add-a-simple-map-in-your-wordpress-sidebar/</link>
		<comments>http://www.bloggpro.com/add-a-simple-map-in-your-wordpress-sidebar/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 15:09:48 +0000</pubDate>
		<dc:creator>Jesper</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.bloggpro.com/?p=376</guid>
		<description><![CDATA[This small script for WordPress allows you to add a small map with a custom marker in your sidebar in single post view by simply adding a custom field to the post called city_name and in the value you enter &#8230; <a href="http://www.bloggpro.com/add-a-simple-map-in-your-wordpress-sidebar/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.bloggpro.com/wp-content/uploads/2011/03/map.bmp"><img class="alignright size-full wp-image-377" title="map" src="http://www.bloggpro.com/wp-content/uploads/2011/03/map.bmp" alt="" /></a>This small script for WordPress allows you to add a small map with a custom marker in your sidebar in single post view by simply adding a custom field to the post called</p>
<p><code>city_name</code></p>
<p>and in the value you enter the name of the city (or place) that you wish to point out with a marker.</p>
<p><span id="more-376"></span></p>
<p>You can download the script and insert into your theme sidebar.php file, and make the necessary changes to fit your needs.</p>
<p><a href="http://www.bloggpro.com/wp-content/uploads/2011/03/map_script.zip">Download code here</a></p>
<p>You will need to add latitude and longitude coordinates for the map centre, as well as the API key that you can <a href="http://code.google.com/apis/maps/signup.html">get from Google</a>.</p>
<p>You probably also will have to edit the DOM/div tags to fit your particular theme.</p>
<p>You can also change other parameters to you liking.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggpro.com/add-a-simple-map-in-your-wordpress-sidebar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding links to specific adress using xpath</title>
		<link>http://www.bloggpro.com/finding-links-to-specific-adress-using-xpath/</link>
		<comments>http://www.bloggpro.com/finding-links-to-specific-adress-using-xpath/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 10:38:17 +0000</pubDate>
		<dc:creator>Jesper</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.bloggpro.com/?p=291</guid>
		<description><![CDATA[Xpath is apowerful method available in php to select specific elemts in the DOM structure of any xml document, and also html document. The code below can be used for example to check for back links, in a robust way. &#8230; <a href="http://www.bloggpro.com/finding-links-to-specific-adress-using-xpath/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Xpath is apowerful method available in php to select specific elemts in the DOM structure of any xml document, and also html document. The code below can be used for example to check for back links, in a robust way. The code below allows for back links to any page or subpage on your domain, but can easily be changed to be more discriminating.<br />
<span id="more-291"></span></p>
<pre><span style="color: #008000;">$page = file_get_contents('http://www.pagetobechecked.com');
		$dom = new DOMDocument();
		@$dom-&gt;loadHTML($page);
		$xpath = new DOMXPath($dom);
		$hrefs = $xpath-&gt;evaluate("/html/body//a[substring(@href,1,25)='http://www.yourdomain.com']");
		</span><span style="color: #008000;">if($hrefs-&gt;length&gt;0) {$link_exists = true;} else {$link_exists = false;}</span><span style="color: #008000;">
}</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggpro.com/finding-links-to-specific-adress-using-xpath/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Google Maps plugin for wordpress</title>
		<link>http://www.bloggpro.com/simple-google-maps-plugin-for-wordpress/</link>
		<comments>http://www.bloggpro.com/simple-google-maps-plugin-for-wordpress/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 01:53:22 +0000</pubDate>
		<dc:creator>Jesper</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.bloggpro.com/simple-google-maps-plugin-for-wordpress/</guid>
		<description><![CDATA[What is it? This is a demo post for a little plugin I wrote that uses custom fields in WordPress together with Google&#8217;s HTTP geo coding API and Google Maps to produce a map with a marker in the post. &#8230; <a href="http://www.bloggpro.com/simple-google-maps-plugin-for-wordpress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>What is it?</strong><br />
This is a demo post for a little plugin I wrote that uses custom fields in WordPress together with Google&#8217;s HTTP geo coding API and Google Maps to produce a map with a marker in the post. The current version (0.5) of the plugin takes the following custom keys and use them to geocode the location (Zip, City, Address, Country) and also display them in the info window popup in the map. Keys marked with a * are required for the plugin to output the map.</p>
<ul class="inpost">
<li>Zip</li>
<li>City*</li>
<li>Address</li>
<li>Country*</li>
<li>Phone</li>
<li>Misc</li>
</ul>
<p><strong>Installation and useage<br />
</strong><span id="more-264"></span></p>
<ul class="inpost">
<li><a href="http://www.bloggpro.com/downloads/GMaps%20plugin">Download</a> the plugin file and upload it to your plugin directory.</li>
<li>Activate the plugin.</li>
<li>Go to <a href="http://code.google.com/apis/maps/signup.html">Google Maps API</a> and sign up for an API key.</li>
<li>Go to the <em>GMaps plugin configuration page</em> (in <em>Options</em>) and enter your API key (and select default Zoom level).</li>
<li>In your header.php template file, change <code>&lt;body&gt;</code> to <code>&lt;body onload="load()" onunload="GUnload()"&gt;</code>.</li>
<li>Make a new post.</li>
<li>Add at least the <em>City</em> and <em>Country</em> custom keys, and add the tag  <code>[ GMaps ]</code> (without extra spaces) where you want the map to render.</li>
<li>Done!</li>
</ul>
<p><strong>Download</strong></p>
<p><a href="http://www.bloggpro.com/downloads/GMaps%20plugin">GMaps plugin v0.5</a> (downloaded 810 times)</p>
<h2>Plugin output</h2>
<div id="map" style="width:400px;height:300px"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggpro.com/simple-google-maps-plugin-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>PHPMailer : Language string failed to load: instantiate</title>
		<link>http://www.bloggpro.com/phpmailer-language-string-failed-to-load-instantiate/</link>
		<comments>http://www.bloggpro.com/phpmailer-language-string-failed-to-load-instantiate/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 13:38:13 +0000</pubDate>
		<dc:creator>Jesper</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.bloggpro.com/phpmailer-language-string-failed-to-load-instantiate/</guid>
		<description><![CDATA[This problem were driving me nuts for a couple of hours so I decided to post it here, to the benefit of others. Using the PHPMailer class to send mail to members from one of our sites I were writing &#8230; <a href="http://www.bloggpro.com/phpmailer-language-string-failed-to-load-instantiate/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This problem were driving me nuts for a couple of hours so I decided to post it here, to the benefit of others. Using the PHPMailer class to send mail to members from one of our sites I were writing a new function, but all of a sudden my mailing function refused to cooperate, and would return the error:</p>
<blockquote><p><code>Language string failed to load: instantiate</code></p></blockquote>
<p>This mysterious error came out of the blue, since I&#8217;d been using the same function for a long time without any hassle. After going through every bit of the problem it boiled down to not having anything to do with any Language string, which one would believe, but the interesting part of the error message is<em>  instantiate. </em></p>
<p><span id="more-261"></span></p>
<p>It turned out that I was sending a subject header encoded as UTF-8, which the PHPMailer class would reject since it contained a perculiar swedish letter, namely &#8220;å&#8221;. Other swedish letters like &#8220;ä&#8221; and &#8220;ö&#8221; will work just fine encoded as UTF-8. But not &#8220;å&#8221;.</p>
<p>The solution? Simple enough, as always:</p>
<blockquote><p><code>$subject = utf8_decode("Någon har svarat på din fråga på $site");</code></p></blockquote>
<p>This converts the string to ISO-8859-1 encoding, which, of course, worked fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggpro.com/phpmailer-language-string-failed-to-load-instantiate/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

