<?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>does not validate &#187; dane@doesnotvalidate.com</title>
	<atom:link href="http://doesnotvalidate.com/tag/danedoesnotvalidatecom/feed/" rel="self" type="application/rss+xml" />
	<link>http://doesnotvalidate.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 02 Jul 2010 06:31:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>TIMBERLINE LODGE WEBSITE</title>
		<link>http://doesnotvalidate.com/2009/timberline-lodge-website/</link>
		<comments>http://doesnotvalidate.com/2009/timberline-lodge-website/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 18:13:37 +0000</pubDate>
		<dc:creator>Dane</dc:creator>
				<category><![CDATA[left]]></category>
		<category><![CDATA[Dane Hesseldahl]]></category>
		<category><![CDATA[dane@doesnotvalidate.com]]></category>
		<category><![CDATA[Nemo]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[Timberline]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://doesnotvalidate.com/?p=790</guid>
		<description><![CDATA[

URL: http://www.timberlinelodge.com
Agency: Nemo
Role: Lead Developer
Technology: PHP / Wordpress
Featured in the Wordpress Showcase
]]></description>
			<content:encoded><![CDATA[<p><a href="http://doesnotvalidate.com/wp-content/uploads/tline_home2.jpg"><img src="http://doesnotvalidate.com/wp-content/uploads/tline_home2-460x504.jpg" alt="" title="tline_home2" width="460" height="504" class="alignnone size-medium wp-image-671" /></a></p>
<p><a href="http://doesnotvalidate.com/wp-content/uploads/tline_sub.jpg"><img src="http://doesnotvalidate.com/wp-content/uploads/tline_sub-367x600.jpg" alt="" title="tline_sub" width="367" height="600" class="alignnone size-medium wp-image-672" /></a></p>
<p><br/><strong>URL:</strong> <a href='http://www.timberlinelodge.com' target='_blank'>http://www.timberlinelodge.com</a><br />
<strong>Agency:</strong> <a href='http://www.nemohq.com' target='_blank'>Nemo</a><br />
<strong>Role:</strong> Lead Developer<br />
<strong>Technology:</strong> PHP / <a href='http://www.wordpress.org'>Wordpress</a></p>
<p><br/>Featured in the <a href='http://wordpress.org/showcase/timberline-lodge/' target='_blank'>Wordpress Showcase</a></p>
]]></content:encoded>
			<wfw:commentRss>http://doesnotvalidate.com/2009/timberline-lodge-website/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>STARS WARS, TOLD BY SOMEONE WHO HASN’T SEEN IT</title>
		<link>http://doesnotvalidate.com/2009/stars-wars-told-by-someone-who-hasn%e2%80%99t-seen-it/</link>
		<comments>http://doesnotvalidate.com/2009/stars-wars-told-by-someone-who-hasn%e2%80%99t-seen-it/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 00:18:20 +0000</pubDate>
		<dc:creator>Dane</dc:creator>
				<category><![CDATA[right]]></category>
		<category><![CDATA[dane@doesnotvalidate.com]]></category>
		<category><![CDATA[star wars]]></category>

		<guid isPermaLink="false">http://doesnotvalidate.com/?p=787</guid>
		<description><![CDATA[Star Wars: Retold (by someone who hasn&#8217;t seen it) from Joe Nicolosi on Vimeo.
]]></description>
			<content:encoded><![CDATA[<p><object width="460" height="259"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=2809991&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=2809991&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="460" height="259"></embed></object><br /><a href="http://vimeo.com/">Star Wars: Retold (by someone who hasn&#8217;t seen it)</a> from <a href="http://vimeo.com/user759504">Joe Nicolosi</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://doesnotvalidate.com/2009/stars-wars-told-by-someone-who-hasn%e2%80%99t-seen-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Struck SLC</title>
		<link>http://doesnotvalidate.com/2009/struck-slc/</link>
		<comments>http://doesnotvalidate.com/2009/struck-slc/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 13:51:34 +0000</pubDate>
		<dc:creator>Dane</dc:creator>
				<category><![CDATA[left]]></category>
		<category><![CDATA[dane@doesnotvalidate.com]]></category>

		<guid isPermaLink="false">http://doesnotvalidate.com/?p=782</guid>
		<description><![CDATA[Hallo, Dit is Struck from Jeramy Morrill on Vimeo.
This video makes me feel all warm and nostalgic on the inside, like a cup of hot cocoa.  Congrats to the team @ STRUCK! I miss you guys&#8230; especially GareBear!
]]></description>
			<content:encoded><![CDATA[<p><object width="460" height="259"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=2612541&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=2612541&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="460" height="259"></embed></object><br /><a href="http://vimeo.com/">Hallo, Dit is Struck</a> from <a href="http://vimeo.com/user480181">Jeramy Morrill</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p><br/>This video makes me feel all warm and nostalgic on the inside, like a cup of hot cocoa.  Congrats to the team @ <a href='http://www.struckcreative.com'>STRUCK</a>! I miss you guys&#8230; especially GareBear!</p>
]]></content:encoded>
			<wfw:commentRss>http://doesnotvalidate.com/2009/struck-slc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WORDPRESS &#8211; EASILY LOOP THROUGH PAGE CHILDREN</title>
		<link>http://doesnotvalidate.com/2009/wordpress-easily-loop-thru-page-children/</link>
		<comments>http://doesnotvalidate.com/2009/wordpress-easily-loop-thru-page-children/#comments</comments>
		<pubDate>Sun, 11 Jan 2009 22:20:12 +0000</pubDate>
		<dc:creator>Dane</dc:creator>
				<category><![CDATA[left]]></category>
		<category><![CDATA[Dane Hesseldahl]]></category>
		<category><![CDATA[dane@doesnotvalidate.com]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[Wordpress Code]]></category>
		<category><![CDATA[Wordpress Theming]]></category>

		<guid isPermaLink="false">http://doesnotvalidate.com/?p=773</guid>
		<description><![CDATA[The following code will let you create a custom &#8220;Wordpress Loop&#8221; that contains the post objects of the children of the current page.
Just drop this code in your theme file:


&#60;?php
    $project_list = get_posts&#40;'numberposts=5&#38;order=ASC&#38;orderby=menu_order&#38;post_type=page&#38;post_parent='.$post-&#62;ID&#41;;
&#160;
    foreach&#40;$project_list as $post&#41;:
    setup_postdata&#40;$post&#41;;
?&#62;
    &#60;div class=&#34;post&#34; id=&#34;post-&#60;?php the_ID&#40;&#41;; ?&#62;&#34;&#62;
  [...]]]></description>
			<content:encoded><![CDATA[<p>The following code will let you create a custom &#8220;Wordpress Loop&#8221; that contains the post objects of the children of the current page.</p>
<p><br/>Just drop this code in your theme file:</p>
<p><br/></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>
    <span style="color: #000088;">$project_list</span> <span style="color: #339933;">=</span> get_posts<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'numberposts=5&amp;order=ASC&amp;orderby=menu_order&amp;post_type=page&amp;post_parent='</span><span style="color: #339933;">.</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$project_list</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$post</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>
    setup_postdata<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;div class=&quot;post&quot; id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
    &lt;/div&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> 
    <span style="color: #b1b100;">endforeach</span><span style="color: #339933;">;</span> 
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://doesnotvalidate.com/2009/wordpress-easily-loop-thru-page-children/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>NemoHQ</title>
		<link>http://doesnotvalidate.com/2009/nemohq/</link>
		<comments>http://doesnotvalidate.com/2009/nemohq/#comments</comments>
		<pubDate>Sat, 10 Jan 2009 22:09:41 +0000</pubDate>
		<dc:creator>Dane</dc:creator>
				<category><![CDATA[left]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Dane Hesseldahl]]></category>
		<category><![CDATA[dane@doesnotvalidate.com]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[Nemo]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://doesnotvalidate.com/?p=235</guid>
		<description><![CDATA[
URL: http://www.nemohq.com
AGENCY: Nemo
ROLE: Technical Architect, Wordpress Integration
TECHNOLOGIES: Flash, Ruby on Rails
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.nemohq.com/" target="_blank"><img src="http://doesnotvalidate.com/wp-content/uploads/nemohq.jpg" alt="" title="nemohq" width="460" height="259" class="alignnone size-full wp-image-236" /></a></p>
<p><strong>URL:</strong> <a href='http://www.nemohq.com' target="_blank">http://www.nemohq.com</a><br />
<strong>AGENCY:</strong> Nemo<br />
<strong>ROLE:</strong> Technical Architect, Wordpress Integration<br />
<strong>TECHNOLOGIES:</strong> Flash, Ruby on Rails</p>
]]></content:encoded>
			<wfw:commentRss>http://doesnotvalidate.com/2009/nemohq/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using jQuery to Build a Better Flash Fly-Down Nav</title>
		<link>http://doesnotvalidate.com/2009/using-jquery-to-build-a-better-flash-fly-down-navigation/</link>
		<comments>http://doesnotvalidate.com/2009/using-jquery-to-build-a-better-flash-fly-down-navigation/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 18:10:57 +0000</pubDate>
		<dc:creator>Dane</dc:creator>
				<category><![CDATA[left]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Dane Hesseldahl]]></category>
		<category><![CDATA[dane@doesnotvalidate.com]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[odopod]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://doesnotvalidate.com/?p=766</guid>
		<description><![CDATA[It seems simple, but one of the most troublesome tasks is to get a Flash fly-down (or drop-down) menu to reliably collapse when it sits over non-Flash content.  Some browsers (IE) have trouble recognizing the  change of control from the Flash Player application instance to the browser.  For that reason Flash won&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>It seems simple, but one of the most troublesome tasks is to get a Flash fly-down (or drop-down) menu to reliably collapse when it sits over non-Flash content.  Some browsers (IE) have trouble recognizing the  change of control from the Flash Player application instance to the browser.  For that reason Flash won&#8217;t always read when the mouse has moved outside the bounds of the Flash Player&#8230; worse still &#8211; it just receives no notification at all, which means that if you&#8217;re relying on Flash to read when the mouse has moved outside the bounds of the navigation &#8211; you&#8217;re out of luck.  </p>
<p><br/>Over the years I&#8217;ve come up with many tricks to help deal with this &#8211; some more effective than others.  Today I found the best solution to date.  It&#8217;s not 100% effective, but it&#8217;s much better than any of the other options that I used.</p>
<p><br/>I decided to try using the <a href='http://www.jquery.com'>jQuery</a> <a href='http://docs.jquery.com/Events/hover#overout'>hover method</a> to detect when the mouse leaves the Flash&#8217;s containing DIV element in the DOM.</p>
<p><br/>The AJAX code looked something like this:</p>
<p><br/></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'document'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#flashNavReplace'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span>
        <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
	    <span style="color: #006600; font-style: italic;">//rollover functionality here</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            getFlashMovie<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;flashNavReplace&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">jsCloseNavigation</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> getFlashMovie<span style="color: #009900;">&#40;</span>movieName<span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> isIE <span style="color: #339933;">=</span> navigator.<span style="color: #660066;">appName</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Microsoft&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span>isIE<span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> window<span style="color: #009900;">&#91;</span>movieName<span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> document<span style="color: #009900;">&#91;</span>movieName<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>and then the Flash side uses some code like this:</p>
<p><br/></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">external</span>.<span style="color: #006600;">ExternalInterface</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">/**************************************************************************
* 
* CONSTRUCTOR
* 
**************************************************************************/</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> TopNavigation<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #808080; font-style: italic;">//setup the JS callback</span>
    ExternalInterface.<span style="color: #006600;">addCallback</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;jsCloseNavigation&quot;</span>, jsClose<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> jsClose<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
    Logger.<span style="color: #0066CC;">log</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;CALLED FROM JS&quot;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #808080; font-style: italic;">//close the nav</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p><br/>This works for me pretty much all of the time&#8230; I can break it if I really try, but it works great for normal usage.</p>
]]></content:encoded>
			<wfw:commentRss>http://doesnotvalidate.com/2009/using-jquery-to-build-a-better-flash-fly-down-navigation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SPEAK VISUAL IS GETTING A LOT OF ATTENTION</title>
		<link>http://doesnotvalidate.com/2009/speak-visual-is-getting-a-lot-of-attention/</link>
		<comments>http://doesnotvalidate.com/2009/speak-visual-is-getting-a-lot-of-attention/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 16:55:05 +0000</pubDate>
		<dc:creator>Dane</dc:creator>
				<category><![CDATA[left]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Dane Hesseldahl]]></category>
		<category><![CDATA[dane@doesnotvalidate.com]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[FWA]]></category>
		<category><![CDATA[odopod]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[san francisco]]></category>

		<guid isPermaLink="false">http://doesnotvalidate.com/?p=760</guid>
		<description><![CDATA[Congratulations to the entire NVIDIA team here @ odopod on the success of the Speak Visual site on being featured in F:E:D, StyleBoost, and being chosen as the FWA Site of the Day.



]]></description>
			<content:encoded><![CDATA[<p>Congratulations to the entire NVIDIA team here @ <a href='http://www.odopod.com' target="_blank">odopod</a> on the success of the <a href='http://www.speakvisual.com' target="_blank">Speak Visual</a> site on being featured in <a href='http://www.wdcf.com/FED/0066.html' target="_blank">F:E:D</a>, <a href='http://styleboost.com/links/1354/' target="_blank">StyleBoost</a>, and being chosen as the <a href='http://www.thefwa.com/?app=winners&#038;id=6861' target="_blank">FWA Site of the Day</a>.</p>
<p><br/><a href="http://www.speakvisual.com"><img src="http://doesnotvalidate.com/wp-content/uploads/nvidia_speakvisual_01.jpg" alt="" title="nvidia_speakvisual_01" width="425" height="285" class="alignnone size-full wp-image-761" /></a></p>
<p><br/><a href="http://www.speakvisual.com"><img src="http://doesnotvalidate.com/wp-content/uploads/nvidia_speakvisual_02.jpg" alt="" title="nvidia_speakvisual_02" width="425" height="285" class="alignnone size-full wp-image-762" /></a></p>
<p><br/><a href="http://www.speakvisual.com"><img src="http://doesnotvalidate.com/wp-content/uploads/nvidia_speakvisual_03.jpg" alt="" title="nvidia_speakvisual_03" width="425" height="285" class="alignnone size-full wp-image-763" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://doesnotvalidate.com/2009/speak-visual-is-getting-a-lot-of-attention/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Activate URLs and Twitter Profile Links with PHP</title>
		<link>http://doesnotvalidate.com/2009/activate-urls-and-twitter-profile-links-with-php/</link>
		<comments>http://doesnotvalidate.com/2009/activate-urls-and-twitter-profile-links-with-php/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 15:22:48 +0000</pubDate>
		<dc:creator>Dane</dc:creator>
				<category><![CDATA[left]]></category>
		<category><![CDATA[Dane Hesseldahl]]></category>
		<category><![CDATA[dane@doesnotvalidate.com]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Regular Expressions]]></category>
		<category><![CDATA[Social Networking]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://doesnotvalidate.com/?p=741</guid>
		<description><![CDATA[
In a current project I&#8217;m reading in a user&#8217;s Twitter feed and displaying it on the hompage of their Wordpress blog.  I know that there are a thousand plug-ins that exist to do this exact thing, but I wanted to write my own. 
Using the official Twitter API the contents of the individual were [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://doesnotvalidate.com/wp-content/uploads/twitter.jpg" alt="" title="Twitter" width="460" height="250" class="alignnone size-full wp-image-753" /></p>
<p><br/>In a current project I&#8217;m reading in a user&#8217;s Twitter feed and displaying it on the hompage of their Wordpress blog.  I know that there are a thousand plug-ins that exist to do this exact thing, but I wanted to write my own. </p>
<p><br/>Using the official Twitter API the contents of the individual were returned as plain text, meaning that all HTML links were totally dead. I wanted a way to automatically add the HTML to enable URL&#8217;s as well as twitter &#8220;@&#8221; profile links. I found some regular expressions and with some tweaking came up with these 2 functions.</p>
<p><br/>To activate the URLs in block of text pass it to the following function:<br />
<br/></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> activateURLS<span style="color: #009900;">&#40;</span><span style="color: #000088;">$tweet</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@&quot;</span><span style="color: #339933;">,</span> 
        <span style="color: #0000ff;">&quot;&lt;a href=&quot;</span>$<span style="color: #cc66cc;">1</span><span style="color: #0000ff;">&quot; target=&quot;</span>_blank<span style="color: #0000ff;">&quot;&gt;<span style="color: #006699; font-weight: bold;">$1</span>&lt;/a&gt;&quot;</span><span style="color: #339933;">,</span> 
        <span style="color: #000088;">$tweet</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><br/>To activate Twitter @ profile links using the following PHP block:<br />
<br/></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> activateTwitterProfiles<span style="color: #009900;">&#40;</span><span style="color: #000088;">$tweet</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/@([^ ,.!#$%^&amp;]+)/&quot;</span><span style="color: #339933;">,</span> 
        <span style="color: #0000ff;">&quot;&lt;a href=&quot;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//twitter.com/$1&quot; target=&quot;_blank&quot;&gt;@$1&lt;/a&gt;&quot;, </span>
        <span style="color: #000088;">$tweet</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><br/>They&#8217;re super easy to use, just call them like this:<br />
<br/></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">activateTwitterProfiles<span style="color: #009900;">&#40;</span>activateLinks<span style="color: #009900;">&#40;</span><span style="color: #000088;">$tweet</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">text</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://doesnotvalidate.com/2009/activate-urls-and-twitter-profile-links-with-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
