<?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>WWWhat in the World Wide Web &#187; code</title>
	<atom:link href="http://theworldwidewebdotcom.net/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://theworldwidewebdotcom.net</link>
	<description>Repeat to yourself “it’s just a blog, I should really just relax”</description>
	<lastBuildDate>Wed, 28 Jul 2010 06:34:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Geotagging, for real this time</title>
		<link>http://theworldwidewebdotcom.net/2010/01/23/geotagging-for-real-this-time/</link>
		<comments>http://theworldwidewebdotcom.net/2010/01/23/geotagging-for-real-this-time/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 03:19:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ongoing Concerns]]></category>
		<category><![CDATA[Words and Expressions]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[geotagging]]></category>

		<guid isPermaLink="false">http://theworldwidewebdotcom.net/?p=1839</guid>
		<description><![CDATA[(THIS USED TO BE A FEW DIFFERENT POSTS)
Since I couldn&#8217;t figure out a free/painless way to edit a million photos&#8217; EXIF data, I made a shortcode instead, and will just enter locations by hand in the post.

The basics
I put this in my theme&#8217;s functions.php file:
function geotag($atts) {
	extract(shortcode_atts(array(
		'n' =&#62; '41.000',   # default value if [...]]]></description>
			<content:encoded><![CDATA[<p><strong>(THIS USED TO BE A FEW DIFFERENT POSTS)</strong></p>
<p>Since I couldn&#8217;t figure out a free/painless way to edit a million photos&#8217; EXIF data, I made a <a href="http://www.wprecipes.com/how-to-save-time-by-using-wordpress-shortcodes">shortcode</a> instead, and will just enter locations by hand in the post.<br />
<span id="more-1839"></span></p>
<h3>The basics</h3>
<p>I put this in my theme&#8217;s <a href="http://codex.wordpress.org/Theme_Development#Theme_Template_Files"><code>functions.php</code></a> file:</p>
<pre>function geotag($atts) {
	extract(shortcode_atts(array(
		'n' =&gt; '41.000',   # default value if none entered in shortcode
		'w' =&gt; '-93.000',  # default value if none entered in shortcode
		't' =&gt; 'Earth',    # default value if none entered in shortcode
		'z' =&gt; '16',       # default value if none entered in shortcode
	), $atts));

	# do it
	return &quot;Location: {$n}&amp;deg; N, {$w}&amp;deg; E (&lt;a href=\&quot;http://maps.google.com/maps?q={$n}+{$w}&amp;#038;t=h&amp;#038;z={$z}<span class="opt">&amp;#038;output=embed</span>&quot;&gt;Gmap!&lt;/a&gt;)&quot;;
}
add_shortcode('geo', 'geotag');</pre>
<p>And the shortcode looks like this: </p>
<pre>&#91;geo t=&quot;The Space Needle&quot; n=&quot;47.620484&quot; w=&quot;-122.349544&quot; z=&quot;19&quot;&#93;</pre>
<p>A-and typing THAT into your post (or image caption) gives you THIS:</p>
</p>
				<p class="exif"><strong>Location:</strong> 47.620484&deg; N, -122.349544&deg; E (<a href="http://maps.google.com/maps?q=47.620484+-122.349544&#038;ll=47.620484,-122.349544&#038;t=h&#038;z=19&#038;output=embed" rel="shadowbox;width=800;height=600;" title="The Space Needle">Gmap!</a>)
<h4>NOTES:</h4>
<ol>
<li>The highlighted portion in the code snippet is for a no-whitespace, all map view of the Gmap (good for popups or iframes).</li>
<li><a href="http://mapki.com/wiki/Google_Map_Parameters">Go here</a> to learn all about the parameters for Google Maps URLs. That&#8217;s what I did.</li>
<li>This post probably won&#8217;t be much help if you know even less php than me. If you click all the links, it will explain the rest of it better than I can. (I am mostly writing all this down in case I suffer a blow to the head and suddenly forget everything.)</li>
<li>The default coordinates are a reference to the <a href="http://www.youtube.com/watch?v=XZ2RvSHK_B8">greatest song ever recorded</a>.</li>
<li>????</li>
<li>Profit!</li>
</ol>
<h3>Getting fancy</h3>
<p>There are a few different ways you can display the map info, all of which I&#8217;ve tried, and only one of which I liked. I&#8217;ll save that one for last.</p>
<h4>A regular old link</h4>
<p>Since I hate popups so much, and had a long stretch where I couldn&#8217;t get the thickbox/iframe method to work, I settled for this:</p>
<pre>return &quot;Location: {$n}&amp;deg; N, {$w}&amp;deg; E (&lt;a href=\&quot;http://maps.google.com/maps?q={$n}+{$w}&amp;#038;ll={$n},{$w}&amp;#038;t=h&amp;#038;z={$z}\&quot;
	<span class="opt">target=\&quot;_blank\&quot;</span> title=\&quot;{$t} <span class="opt">(opens in new window, sorry)</span>\&quot;&gt;Gmap!&lt;/a&gt;)&quot;;</pre>
<h4>A popup</h4>
<p>If you don&#8217;t hate popups, and don&#8217;t think any of your readers will mind, here you go (note the use of the optional bits from the original snippet):</p>
<pre>return &quot;Location: {$n}&amp;deg; N, {$w}&amp;deg; E (&lt;a href=\&quot;http://maps.google.com/maps?q={$n}+{$w}&amp;#038;ll={$n},{$w}&amp;#038;t=h&amp;#038;z={$z}&amp;#038;output=embed\&quot;
	onclick=\&quot;window.open('http://maps.google.com/maps?q={$n}+{$w}&amp;#038;ll={$n},{$w}&amp;#038;t=h&amp;#038;z={$z}&amp;#038;output=embed','popup','width=800,height=600,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=20,top=20'); return false\&quot;
	title=\&quot;{$t} <span class="opt">(popup, sorry)</span>\&quot;&gt;Gmap!&lt;/a&gt;)&quot;;</pre>
<h4>Getting really fancy (Updated July 2010)</h4>
<p>This is the one that gave me so much grief trying to figure out. It requires <a href="http://jquery.com/">jquery</a> and <a href="http://shadowbox-js.com/">shadowbox</a> to work, and displays the map in a purty iframe, with none of the problems <a href="http://jquery.com/demo/thickbox/">thickbox</a> had.</p>
<p>Edit the &#8220;do it&#8221; part:</p>
<pre>return &quot;Location: {$n}&amp;deg; N, {$w}&amp;deg; E (&lt;a href=\&quot;http://maps.google.com/maps?q={$n}+{$w}&amp;#038;ll={$n},{$w}&amp;#038;t=h&amp;#038;z={$z}&#038;output=embed\&quot; rel=\&quot;shadowbox;width=800;height=600;\&quot; title=\&quot;{$t}\&quot;&gt;Gmap!&lt;/a&gt;)&quot;;</pre>
<p>You can, of course, set the width and height to whatever you want, or accept the shadowbox defaults.</p>
<h4>Oh, just stop it (Updated July 2010)</h4>
<p>So, what if you want to make an inline link, like, with text?</p>
<pre>function igeotag($atts) {
	extract(shortcode_atts(array(
		'l' =&gt; 'linkytext',   # default value if none entered in shortcode
		'n' =&gt; '41.000',      # default value if none entered in shortcode
		'w' =&gt; '-93.000',     # default value if none entered in shortcode
		't' =&gt; 'Earth',       # default value if none entered in shortcode
		'z' =&gt; '16',          # default value if none entered in shortcode
	), $atts));

	# do it
	return &quot;&lt;a href=\&quot;http://maps.google.com/maps?q={$n}+{$w}&amp;#038;ll={$n},{$w}&amp;#038;t=h&amp;#038;z={$z}&#038;output=embed\&quot; rel=\&quot;shadowbox;width=800;height=600;\&quot; title=\&quot;{$t}\&quot;&gt;{$l}&lt;/a&gt;&quot;;
}
add_shortcode('igeo', 'igeotag');</pre>
<p>And the shortcode looks like this: </p>
<pre>&#91;igeo l=&quot;SWEET&quot; t=&quot;The Space Needle is hella sweet&quot; n=&quot;47.620484&quot; w=&quot;-122.349544&quot; z=&quot;19&quot;&#93;</pre>
<p>Which results in the word <a href="http://maps.google.com/maps?q=47.620484+-122.349544&#038;ll=47.620484,-122.349544&#038;t=h&#038;z=19&#038;output=embed" rel="shadowbox;width=800;height=600;" title="The Space Needle is hella sweet">SWEET</a> being a link!</p>
<h3>Disclaimer</h3>
<p>I suck at html, css, php, making any of the aforementioned valid, and the less mentioned about my documentation skills the better. So if anything blows up, it&#8217;s your problem (but I do reserve the right to laugh at you).</p>
<h3>PS</h3>
<p>On the <a href="/2010/01/23/geotagging-for-real-this-time/2/">next page</a> is some outdated info I didn&#8217;t want to just chuck.</p>
]]></content:encoded>
			<wfw:commentRss>http://theworldwidewebdotcom.net/2010/01/23/geotagging-for-real-this-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Still working on my dang ol&#8217; map</title>
		<link>http://theworldwidewebdotcom.net/2009/07/12/still-working-on-my-dang-ol-map/</link>
		<comments>http://theworldwidewebdotcom.net/2009/07/12/still-working-on-my-dang-ol-map/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 00:28:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Words and Expressions]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[notes from the future]]></category>

		<guid isPermaLink="false">http://theworldwidewebdotcom.net/?p=896</guid>
		<description><![CDATA[Remember how excited I was to add geotagging? Hella short-lived, yo!
[...]
&#160;
NOTE, FROM THE FUTURE: I completely rewrote this, to account for new developments in the realm of me-being-less-stupid. 
Go here for that stuff, now and forever: Geotagging, for real this time
]]></description>
			<content:encoded><![CDATA[<p>Remember <a href="http://theworldwidewebdotcom.net/2009/05/30/ragin-full-on/">how excited I was</a> to add geotagging? Hella short-lived, yo!</p>
<p>[...]</p>
<p>&nbsp;</p>
<p><strong>NOTE, FROM THE FUTURE:</strong> I completely rewrote this, to account for new developments in the realm of me-being-less-stupid. </p>
<p>Go here for that stuff, now and forever: <a href="/?p=1839">Geotagging, for real this time</a></p>
]]></content:encoded>
			<wfw:commentRss>http://theworldwidewebdotcom.net/2009/07/12/still-working-on-my-dang-ol-map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ragin&#8217; full on</title>
		<link>http://theworldwidewebdotcom.net/2009/05/30/ragin-full-on/</link>
		<comments>http://theworldwidewebdotcom.net/2009/05/30/ragin-full-on/#comments</comments>
		<pubDate>Sun, 31 May 2009 03:46:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Words and Expressions]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[notes from the future]]></category>

		<guid isPermaLink="false">http://theworldwidewebdotcom.net/?p=399</guid>
		<description><![CDATA[I just realized the pics I&#8217;m uploading are kind of huge in the file-size dept. I&#8217;ll try to keep the full-size ones under 200K. I am also constantly having problems with Wordpress&#8217;s flash uploader, all with the firefox crashing and the rage and such.

In good news, I can (sort of) geotag now. It only took [...]]]></description>
			<content:encoded><![CDATA[<p>I just realized the pics I&#8217;m uploading are kind of huge in the file-size dept. I&#8217;ll try to keep the full-size ones under 200K. I am also constantly having problems with Wordpress&#8217;s flash uploader, all with the firefox crashing and the rage and such.</p>
<p><img src="http://theworldwidewebdotcom.net/glob/wp-content/uploads/2009/05/fffuuu.gif" alt="pic related" title="pic related" width="125" height="94" class="alignnone size-full wp-image-403" /></p>
<p>In good news, I can (sort of) geotag now. It only took about six hours of bashing my head on the keyboard.</p>
<p>[...]</p>
<p>&nbsp;</p>
<p><strong>NOTE, FROM THE FUTURE:</strong> I completely rewrote the geotagging stuff, to account for new developments in the realm of me-being-less-stupid. </p>
<p>Go here for that stuff, now and forever: <a href="/?p=1839">Geotagging, for real this time</a></p>
]]></content:encoded>
			<wfw:commentRss>http://theworldwidewebdotcom.net/2009/05/30/ragin-full-on/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
