<?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>kohactive &#187; Labs</title>
	<atom:link href="http://www.kohactive.com/html/category/labs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kohactive.com/html</link>
	<description>kohactive  interactive design and marketing</description>
	<lastBuildDate>Mon, 23 Aug 2010 21:26:29 +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>Watching Divx and Flash Video on IPAD</title>
		<link>http://www.kohactive.com/html/labs/watching-divx-and-flash-video-on-ipad/</link>
		<comments>http://www.kohactive.com/html/labs/watching-divx-and-flash-video-on-ipad/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 01:36:34 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[Labs]]></category>

		<guid isPermaLink="false">http://www.kohactive.com/html/?p=271</guid>
		<description><![CDATA[Both are now possible without jail breaking by purchasing yxplayer, I love it so far after i figured out how to work it.
Although a bit choppy at times atleast while streaming divx, not sure if its my connection or the codecs choking?
it seems to catch up eventually and defiantly a step in the right direction.
The [...]]]></description>
			<content:encoded><![CDATA[<p>Both are now possible without jail breaking by purchasing yxplayer, I love it so far after i figured out how to work it.</p>
<p>Although a bit choppy at times atleast while streaming divx, not sure if its my connection or the codecs choking?</p>
<p>it seems to catch up eventually and defiantly a step in the right direction.</p>
<p>The quick how to for streaming divx from the web is:</p>
<p>1) Find a Stage-Vu player (Could be any player but stage-vu definatly works)  &#8211; Safari (You can try the built in browser but it was giving me issues on the pages i was browsing)</p>
<p>2) Hold down the download button on player till menu pops up.</p>
<p>3) Copy URL</p>
<p>4) Close Safari</p>
<p>5) Open yxplayer</p>
<p>6) Select Streams from the lower menu</p>
<p>7) Add stream giving it a name and paste the url you copied from safari.</p>
<p> <img src='http://www.kohactive.com/html/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Enjoy</p>
<p>If you can find a FLV link i believe it will play also, but that could be difficult in the safari browser, Best bet is to download on a pc and upload to ipad storage and try to playback the FLV that way, i believe it is supported.</p>
<p>If you are jailbroken installing iMobileCinema seems to enable MegaVideo videos to be launched directly inside of safari and works in fullscreen very well, although you are limited to 74 minutes or whatever the time limit on megavideo is after which you will have to wait an hour to play another. iMobileCinema seems to support a handful of other video sites and you can embed tags to add support for iMobileCinema in your own videos with info from iMobileCinema.com</p>
<p>Hope that helps, i am enjoying some streaming video on my ipad finnally, and i hope you do the same.</p>
<p>&#8211;Justin</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kohactive.com/html/labs/watching-divx-and-flash-video-on-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Hacks: Using Post Excerpts as Meta Descriptions</title>
		<link>http://www.kohactive.com/html/labs/wordpress-hacks-using-post-excerpts-as-meta-descriptions/</link>
		<comments>http://www.kohactive.com/html/labs/wordpress-hacks-using-post-excerpts-as-meta-descriptions/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 03:36:53 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Hacks]]></category>

		<guid isPermaLink="false">http://www.kohactive.com/html/?p=147</guid>
		<description><![CDATA[Optimize your WordPress site by using relevant content in your meta descriptions. Using post excerpts, categories descriptions and standard meta information you can easily adjust the meat description of each page of your site.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.kohactive.com/html/wp-content/uploads/wp_meta.jpg"><img class="alignnone size-full wp-image-148" title="wp_meta" src="http://www.kohactive.com/html/wp-content/uploads/wp_meta.jpg" alt="WordPress Hacks: Using exceprts as meta descriptions" width="535" height="235" /></a></p>
<p>When you build a static website with a few separate HTML files you find it easy to optimize each page for search engines, load times and meta information. When using a template based application like WordPress, this kind of customization is a bit trickier. But with a few good hacks you&#8217;ll be able to easily optimize each page for your needs.</p>
<p>The Problem: WordPress uses the same meta data for each page. The solutions is simple, though:<br />
<pre name="code" class="php">&lt;?php
//if single post then add excerpt as meta description
if (is_single()) {
?&gt;
&lt;meta name="Description" content="&lt;?php echo strip_tags(get_the_excerpt($post-&gt;ID)); ?&gt;" /&gt;
&lt;?php
//if homepage use standard meta description
} else if(is_home() || is_page())  {
?&gt;
&lt;meta name="Description" content="whatever your blog/site is about goes here w00t!"&gt;
&lt;?php
//if category page, use category description as meta description
} else if(is_category()) {
?&gt;
&lt;meta name="Description" content="&lt;?php echo strip_tags(category_description(get_category_by_slug(strtolower(get_the_category()))-&gt;term_id)); ?&gt;" /&gt;
&lt;?php } ?&gt;</pre></p>
<p>Yup, that&#8217;s it! You can also do the same thing with tags. I&#8217;ll probably add an update or new post soon on how to use tags as meta keywords. If you come up with a solution let us know in the comments below!</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kohactive.com/html/labs/wordpress-hacks-using-post-excerpts-as-meta-descriptions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Hacks: Related Category Post in WordPress</title>
		<link>http://www.kohactive.com/html/labs/wordpress-hacks-related-category-post-in-wordpress/</link>
		<comments>http://www.kohactive.com/html/labs/wordpress-hacks-related-category-post-in-wordpress/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 17:16:53 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Hacks]]></category>

		<guid isPermaLink="false">http://www.kohactive.com/html/?p=135</guid>
		<description><![CDATA[A nice WordPress hack that allows you to add related posts from a similar category to the current post. You can also modify to add related tags.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.kohactive.com/html/wp-content/uploads/wp_post_hacks.jpg"><img class="size-full wp-image-136 alignnone" title="wordpress hacks, related posts" src="http://www.kohactive.com/html/wp-content/uploads/wp_post_hacks.jpg" alt="wordpress hacks, related posts" width="535" height="235" /></a></p>
<p>With a recent project, I wanted to display recent posts, of the same category, on the page. After trying a whole bunch of plugins and not being satisfied I did a little research and testing and made this up. It works pretty well for my needs, but as you&#8217;ll see, it is quite flexible, and can be utilized for not only categories, but tags also. Quick note, all this code goes <strong>inside the loop!</strong></p>
<p>First step was to get the current category, in my case, I wanted the parent category. I used the following to store the category in a variable:</p>
<pre lang="php">&lt;?php
 $category = get_the_category();
 $parent = get_cat_name($category[0]-&gt;category_parent);
 $parent = $category[0]-&gt;cat_name;
?&gt;</pre>
<p>You can echo that out to make sure it&#8217;s what you&#8217;re expecting. After that, we need to call a WP_Query to get the related posts. I used the following to get 3 posts of the same parent category to display:</p>
<pre lang="php  escaped=">&lt;?php
 $my_query = new WP_Query('showposts=3&amp;category='.$parent);

 if ($my_query-&gt;have_posts()) {
 while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post();
?&gt;
 &lt;div&gt;
 &lt;a href="&lt;?php the_permalink(); ?&gt;" title="&lt;?php the_title(); ?&gt;"&gt;&lt;img src="&lt;?php echo catch_that_image(); ?&gt;" width="165" /&gt;&lt;/a&gt;
 &lt;h4&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h4&gt;
 &lt;/div&gt;
&lt;?php
 endwhile;
}</pre>
<p>If you&#8217;re wondering what that &#8220;catch_that_image&#8221; code is, you can view the <a href="http://wordpress.org/support/topic/246893">WordPress support forum</a> or you can insert the following into your functions.php file:</p>
<pre lang="php">// Get URL of first image in a post
function catch_that_image() {
 global $post, $posts;
 $first_img = '';
 ob_start();
 ob_end_clean();
 $output = preg_match_all('/&lt;img.+src=[\'"]([^\'"]+)[\'"].*&gt;/i', $post-&gt;post_content, $matches);
 $first_img = $matches [1] [0];

 // no image found display default image instead
 if(empty($first_img)){
 $first_img = "/images/default.jpg";
 }

 return $first_img;
}</pre>
<p>Or you can just completely forget about it. That nice little functions allows you to grab the first image of a post and display in as you which. As for the related categories, here is the full code I used (inside the loop):</p>
<pre lang="php  escaped=">&lt;?php
 $category = get_the_category();
 $parent = get_cat_name($category[0]-&gt;category_parent);
 $parent = $category[0]-&gt;cat_name;

 $my_query = new WP_Query('showposts=3&amp;category='.$parent);

 if ($my_query-&gt;have_posts()) {
 while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post();
?&gt;

 &lt;div&gt;
 &lt;a href="&lt;?php the_permalink(); ?&gt;" title="&lt;?php the_title(); ?&gt;"&gt;&lt;img src="&lt;?php echo catch_that_image(); ?&gt;" width="165" /&gt;&lt;/a&gt;
 &lt;h4&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h4&gt;
 &lt;/div&gt;

&lt;?php
 endwhile;
}</pre>
<p>If you want to learn more about this hack and utilizing it with Tags then check out<a href="http://www.wprecipes.com/how-to-show-related-posts-without-a-plugin" target="_blank"> this post</a> from <a href="http://www.wprecipes.com/" target="_blank">WP Recipes</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kohactive.com/html/labs/wordpress-hacks-related-category-post-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AS3 MailChimp Library</title>
		<link>http://www.kohactive.com/html/labs/actionscript-3-0-and-mailchimps-api/</link>
		<comments>http://www.kohactive.com/html/labs/actionscript-3-0-and-mailchimps-api/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 14:32:23 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[MailChimp]]></category>

		<guid isPermaLink="false">http://www.kohactive.com/html/?p=123</guid>
		<description><![CDATA[One of our latest projects required MailChimp integration through Flash AS3, while we couldn't find anything that worked properly, we found a nice and easy way to build our own class.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.kohactive.com/html/wp-content/uploads/mailchimp.jpg"><img class="alignnone size-full wp-image-124" title="mailchimp" src="http://www.kohactive.com/html/wp-content/uploads/mailchimp.jpg" alt="" width="535" height="235" /></a></p>
<p>While building our awesome new website, we wanted to ensure that users could easily subscribe to our newsletter through the Flash version, without having to be redirected anywhere else. Convenience is king, and we wanted to deliver it!</p>
<p>We use <a href="http://www.mailchimp.com/">MailChimp</a>, the best email marketing platform available! And luckily, they have a great API to work with. Through Flash, we were able to add subscribers to our list and also return any results, i.e. error or success.</p>
<p>While searching Google I found an article by <a href="http://christiancox.com/?p=29">Christian Cox </a>on MailChimp’s API and AS2, but that wasn’t enough.  We needed a nice AS3 version of the code. So Justin and I put together this nice, simple code that should work for anyone. If I had more time I would definitely make a class.. Perhaps later this month.</p>
<pre><code lang="as3">
//api and list id keys
var _api:String = "MAIL_CHIMP_API_KEY_HERE";
var _listID:String = "LIST_ID_HERE";

//text box handler
emailAddress.text = "email address";
emailAddress.tabIndex = 1;
emailAddress.addEventListener(FocusEvent.FOCUS_IN, txtFocusIn);
emailAddress.addEventListener(FocusEvent.FOCUS_OUT, txtFocusOut);

function txtFocusIn(e:FocusEvent) {
        emailAddress.text = "";
}
function txtFocusOut(e:FocusEvent) {
        if (emailAddress.text == "") {
                emailAddress.text = "email address";
        }
}

//button setup
submitBtn.buttonMode = true;
submitBtn.addEventListener(MouseEvent.CLICK, submitForm);

function submitForm(e:Event) {

        var email:String = emailAddress.text;

        //check if valid
        if (isValidEmail(email)) {

                //set response text
                responseText.text = "sending...";

                //disable the submit button
                submitBtn.removeEventListener(MouseEvent.CLICK, submitForm);

                //setup POST
                var variables:URLVariables = new URLVariables("method=listSubscribe&amp;amp;output=xml&amp;amp;apikey=" + _api + "&amp;amp;id=" + _listID + "&amp;amp;email_address=" + email + "&amp;amp;merge_vars=");
                var request:URLRequest = new URLRequest();
                request.url = "http://api.mailchimp.com/1.2/?method=listSubscribe";
                request.method = URLRequestMethod.POST;
                request.data = variables;

                var loader:URLLoader = new URLLoader();
                loader.dataFormat = URLLoaderDataFormat.VARIABLES;
                loader.addEventListener(Event.COMPLETE, completeHandler);

                try {
                        trace("loading...");
                        responseText.text = "loading...";
                        loader.load(request);
                }
                catch(error:Error) {
                        trace("unable to load URL");
                        responseText.text = "Oh, that's embarassing. something went wrong, please try again. Thanks!";
                        trace(e.target.data);
                }
                function completeHandler(e:Event) {
                        var _t:String = unescape(e.target.data); //decode the uri

                        var _xml:XMLList = new XMLList(_t); //parse the xml
                        trace(_xml.@type);
                        if (_xml.@type == "array") { //check to see if there is an error
                                trace(_xml.error);
                                responseText.text = _xml.error;
                                resetForm();
                        } else if (_xml.@type == "boolean") { //check to see if successfully added
                                trace("successfully added to list");
                                responseText.text = "You have beeen successfully added to our list. Thank you!";
                                resetForm();
                        }
                }

        } else {
                trace ("email invalid");
        resetForm ();
                responseText.text = "invalid email!";
        }

}

//validate given email
function isValidEmail(_e:String):Boolean {
        var exp:RegExp = /^[a-z][\w.-]+@\w[\w.-]+\.[\w.-]*[a-z][a-z]$/i;
    return exp.test(_e);
}

//reset the form elements
function resetForm(){
        submitBtn.addEventListener(MouseEvent.CLICK, submitForm);
        emailAddress.text = "email address";

}
</code>
</pre>
<p>Done and done. Pretty easy, right? You can also download the <a href="http://www.kohactive.com/html/wp-content/uploads/mailchimp_api.zip">mailchimp_api</a>.</p>
<p><span class="post_update">UPDATE: A new version has been created that includes First and Last Name data collection [<a href="http://www.kohactive.com/html/wp-content/uploads/mailchimp_api_1.3.zip">mailchimp_api_1.3</a>].</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kohactive.com/html/labs/actionscript-3-0-and-mailchimps-api/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>WordPress: Displaying Categories Differently in The Loop</title>
		<link>http://www.kohactive.com/html/labs/wordpress-displaying-categories-differently-in-the-loop/</link>
		<comments>http://www.kohactive.com/html/labs/wordpress-displaying-categories-differently-in-the-loop/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 21:24:23 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[Front End Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.kohactive.com/html/?p=67</guid>
		<description><![CDATA[A short and simple 2 lines of code that will help you display categories differently in the WordPress Loop.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.kohactive.com/html/wp-content/uploads/wp_category_hacks.jpg"><img class="alignnone size-full wp-image-69" title="wp_category_hacks" src="http://www.kohactive.com/html/wp-content/uploads/wp_category_hacks.jpg" alt="" width="535" height="235" /></a></p>
<p>WordPress has become increasingly popular around the developers community as a great Content Management System. We&#8217;ve used WordPress for countless projects and every time we build with WP we learn some new tricks and tips.</p>
<p>Once of our most recent projects required categories to display different on the homepage. Essentially the client had 2 categories, &#8216;News&#8217; and &#8220;Blog Posts&#8221; and he wanted the news section to display in full&#8211;the entire post, without a link to the actual post. For the regular blog posts, he wanted the the title and excerpt and of course, a link to the full post.</p>
<p>The solution ended up being pretty easy.</p>
<pre><code>
$category = get_the_category();
$category = $category[0]->cat_name;
</code></pre>
<p>Using <code>get_the_category</code> allowed me to store the category in a variable without automatically echoing to the page. I then used the variable to define the markup needed for each category. My final code is as follows:</p>
<pre><code>
<?php
//check to see the category
$category = get_the_category();
$category = $category[0]->cat_name;

if ($category == "News") {
	//if news, display all content
	the_content();
} else {
       //if post, display excerpt
       the_excerpt();
}
?>
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kohactive.com/html/labs/wordpress-displaying-categories-differently-in-the-loop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone SSH over USB</title>
		<link>http://www.kohactive.com/html/labs/iphone-ssh-over-usb/</link>
		<comments>http://www.kohactive.com/html/labs/iphone-ssh-over-usb/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 21:53:10 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Tethering]]></category>

		<guid isPermaLink="false">http://www.kohactive.com/html/?p=4</guid>
		<description><![CDATA[iPhone tethering! A simple guide on how to setup internet tethering on your iPhone. Never be naked of the internet again.]]></description>
			<content:encoded><![CDATA[<p><!--wp_fromhtmlpreview_devfmt--></p>
<p><a href="http://www.kohactive.com/html/wp-content/uploads/tethering.jpg"><img class="alignnone size-full wp-image-47" title="tethering" src="http://www.kohactive.com/html/wp-content/uploads/tethering.jpg" alt="" width="535" height="235" /></a></p>
<p>Super easy,</p>
<ol>
<li>first install a .mobileconfig for your carrier to enable iPhone Tethering. on your iPhone goto <a href="http://help.benm.at/tethering.php">http://help.benm.at/tethering.php</a> and download a file appropriate for your carrier.</li>
<li>turn iPhone tethering on (Settings -&gt; Network -&gt; Internet Tethering)</li>
<li>Bonjour should now popup if your interface is enabled on your mac/pc with a name for your device, mine is Justins-Iphone.local (if bonjour does not pop up, give it a few seconds and open your network preferences, but sometimes it takes a couple of seconds to pick up on the connection)</li>
<li>SFTP to said location with your favorite SFTP browser WinSCP to said name for me its (Justins-Iphone.local).</li>
</ol>
<p>***Note this will only work on jailbroken iphones running OS 3.0 with SSH installed and running.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kohactive.com/html/labs/iphone-ssh-over-usb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
