<?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>feisley &#187; PHP</title>
	<atom:link href="http://feisley.com/category/coding/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://feisley.com</link>
	<description>programming with a side of life</description>
	<lastBuildDate>Thu, 15 Apr 2010 07:33:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Add a Little Privacy to Google Latitude</title>
		<link>http://feisley.com/2009/08/04/add-a-little-privacy-to-google-latitude/</link>
		<comments>http://feisley.com/2009/08/04/add-a-little-privacy-to-google-latitude/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 12:52:32 +0000</pubDate>
		<dc:creator>Jacob Feisley</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[LBS]]></category>
		<category><![CDATA[privacy]]></category>

		<guid isPermaLink="false">http://feisley.com/?p=3496</guid>
		<description><![CDATA[This title must sound very ironic given that the whole purpose of Google Latitude is to reduce privacy. I am not saying this is a bad thing, just that telling people where you are right now is less private than not telling them.
Recently, Google took the reduction of privacy a little further by allowing you [...]]]></description>
			<content:encoded><![CDATA[<p>This title must sound very ironic given that the whole purpose of Google Latitude is to reduce privacy. I am not saying this is a bad thing, just that telling people where you are right now is less private than not telling them.</p>
<p>Recently, Google took the reduction of privacy a little further by allowing you to setup a web site badge for Latitude. Up until this point, you could only share your location with select friends, however, now you can share it with the whole world via your website, blog, etc. I do use this, so you can spy on <a href="http://feisley.com/contact/location">my location</a> if you wish.</p>
<p><span id="more-3496"></span></p>
<p>But to the privacy elements shall we&#8230; When you generate a badge, Google gives you a snippet of HTML code that looks like this:</p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!-- Google Public Location Badge --&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;iframe</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;http://www.google.com/latitude/apps/badge/api?user=1234567890&amp;type=iframe&amp;maptype=roadmap&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;180&quot;</span> <span style="color: #000066;">frameborder</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;300&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/iframe<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #808080; font-style: italic;">&lt;!-- To disable location sharing, you *must* visit http://www.google.com/latitude/apps/badge and disable the Google Public Location badge. Removing this code snippet is not enough! --&gt;</span></pre></div></div>

<p>This works fine as is if you place it on your site, however, that number there (1234567890) is actually your API &#8220;username&#8221; and given inspecting this from your site, any user could simply place your position on their site or access the API by other programmatic methods. Notice Google&#8217;s warning that to disable it, you have to disable the badge globally via their site, but what if you just don&#8217;t want some people using your badge or plan to put it on a password protected area of your site&#8230; This is where a little privacy can help.</p>
<p>What I did for my site is use some PHP code to add a layer of abstraction to the Google Latitude API. It requests the content server side and displays it without ever revealing my Latitude user id. I then include my own PHP page within an iframe just as i would have the Google snippet and that&#8217;s it. Here is the simple PHP code to do this:</p>
<p><br class="spacer_" /></p>
<p><strong>location.php</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://www.google.com/latitude/apps/badge/api?user=1234567890&amp;type=iframe&amp;maptype=roadmap&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">print</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>The resulting PHP page will generate a map that fills the entire browser. Then simply add an iframe that references that PHP script and your desired width and height and boom, no one can inspect your user id and you have added a little privacy back to Google Latitude.</p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;iframe</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;location.php&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;650&quot;</span> <span style="color: #000066;">frameborder</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;480&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/iframe<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>P.S. For the advanced users out there you can also do some creative things with the &#8220;$content&#8221; object within PHP such as inject your own CSS or even remove elements of the badge that you don&#8217;t want on your site since Google gives very limited customization to this.</p>
]]></content:encoded>
			<wfw:commentRss>http://feisley.com/2009/08/04/add-a-little-privacy-to-google-latitude/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Site Updates (continued)</title>
		<link>http://feisley.com/2008/12/21/site-updates-continued/</link>
		<comments>http://feisley.com/2008/12/21/site-updates-continued/#comments</comments>
		<pubDate>Sun, 21 Dec 2008 07:24:45 +0000</pubDate>
		<dc:creator>Jacob Feisley</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://feisley.com/?p=2061</guid>
		<description><![CDATA[As I was in the coding mood from my changes last night to my website/blog, I took the next logical step and completely overhauled the entire theme. After heavily modifying a theme I think I have the general look I am wanting.
Some of the notable changes include:

Grouped categories into logical groups.
Better search with context provided [...]]]></description>
			<content:encoded><![CDATA[<p>As I was in the coding mood from my changes last night to my website/blog, I took the next logical step and completely overhauled the entire theme. After heavily modifying a theme I think I have the general look I am wanting.</p>
<p>Some of the notable changes include:</p>
<ul>
<li>Grouped categories into logical groups.</li>
<li>Better search with context provided along with titles.</li>
<li>New logo based on old site logo + favicon (with a touch of red)</li>
<li>A few other interesting features that I may take advantage of in the near future</li>
</ul>
<p>Everything should be in place, if anyone notices some stray PHP code or CSS trying to escape, please let me know so I can put it in its place.</p>
]]></content:encoded>
			<wfw:commentRss>http://feisley.com/2008/12/21/site-updates-continued/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web File Listings</title>
		<link>http://feisley.com/2008/03/28/web-file-listings/</link>
		<comments>http://feisley.com/2008/03/28/web-file-listings/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 01:22:37 +0000</pubDate>
		<dc:creator>Jacob Feisley</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://feisley.com/?p=17</guid>
		<description><![CDATA[I finally made my web file listings integrate with my web site theme. Normally web file directories look pretty very ugly and this certainly was an improvement. Apache has built-in support for header and footer files to be wrapped around the file listing. You can even wrap PHP or other scripting languages around it if [...]]]></description>
			<content:encoded><![CDATA[<p>I finally made my web file listings integrate with my web site theme. Normally web file directories look <span style="text-decoration: line-through;">pretty</span> very ugly and this certainly was an improvement. Apache has built-in support for header and footer files to be wrapped around the file listing. You can even wrap PHP or other scripting languages around it if you configure Apache properly. I chose to use PHP as it can easily pull in template changes from the main site.</p>
<p><span id="more-17"></span></p>
<p>The first step is to make a template directory under your site root for the template. Then add your PHP files to the directory and make the following .htaccess file:</p>
<p>source/theme/apache/.htaccess</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">AddType text/html .php
AddHandler application/x-httpd-php .php
Options -indexes</pre></td></tr></table></div>

<p><br class="spacer_" /></p>
<p>The AddHandler statement tells Apache to process the PHP files when used as a template.</p>
<p>Next I added the Directory Indexing statements to the main .htaccess file under the root of the site:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">Options +Indexes
IndexOptions +FancyIndexing +SuppressDescription +SuppressHTMLPreamble +XHTML
IndexOptions +FoldersFirst +IgnoreCase +NameWidth=*
HeaderName /source/theme/apache/header.php
ReadmeName /source/theme/apache/footer.php</pre></td></tr></table></div>

<p>And it works! You can see it in action at <a href="http://feisley.com/python/">http://feisley.com/python/</a></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://feisley.com/2008/03/28/web-file-listings/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wordpress 2.5</title>
		<link>http://feisley.com/2008/03/27/wordpress-25/</link>
		<comments>http://feisley.com/2008/03/27/wordpress-25/#comments</comments>
		<pubDate>Thu, 27 Mar 2008 07:30:47 +0000</pubDate>
		<dc:creator>Jacob Feisley</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Gallery]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[RC]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://feisley.com/?p=23</guid>
		<description><![CDATA[
Wordpress has been gearing up for their much anticipated 2.5 release. As such I though it only fitting that I upgrade to one of the latest test releases. I installed 2.5 RC 2 and have been nothing but impressed so far. The admin interface is the largest visual overhaul. It is much more streamlined and [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-thumbnail wp-image-22" title="Wordpress" src="http://feisley.com/wp-content/uploads/2008/03/wordpress-150x150.png" alt="Wordpress Logo" width="150" height="150" /></p>
<p>Wordpress has been gearing up for their much anticipated 2.5 release. As such I though it only fitting that I upgrade to one of the latest test releases. I installed 2.5 RC 2 and have been nothing but impressed so far. The admin interface is the largest visual overhaul. It is much more streamlined and now offers many new features.</p>
<p>My favorite new addition is the new media management interface. This makes it almost trivial to upload and manage images and other content. This will certainly be useful in the future. Another great aspect to the media manager is the gallery feature, which allows the rapid creation of photo galleries on a given article.</p>
<p>Looking foward to the final release, but at this point the RC 2 seems very stable.</p>
]]></content:encoded>
			<wfw:commentRss>http://feisley.com/2008/03/27/wordpress-25/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
