<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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" version="2.0">

<channel>
	<title>XCODETUTS</title>
	
	<link>http://xcodetuts.com</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Thu, 09 Oct 2008 18:15:14 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/xcodetuts" type="application/rss+xml" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">2370960</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://www.feedburner.com</feedburner:feedburnerHostname><item>
		<title>Getting started with FeedBurner</title>
		<link>http://xcodetuts.com/web-applications/getting-started-with-feedburner/</link>
		<comments>http://xcodetuts.com/web-applications/getting-started-with-feedburner/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 18:14:26 +0000</pubDate>
		<dc:creator>Headshot</dc:creator>
		
		<category><![CDATA[Web Applications]]></category>

		<category><![CDATA[Working with CMS's]]></category>

		<category><![CDATA[CMS]]></category>

		<category><![CDATA[Feed]]></category>

		<category><![CDATA[FeedBurner]]></category>

		<category><![CDATA[Plugin]]></category>

		<category><![CDATA[RSS]]></category>

		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://xcodetuts.com/?p=225</guid>
		<description><![CDATA[Step 1 - Finding your RSS Feed
Now before you can use FeedBurner you need a RSS feed, or else you are wasting your time at feedburner.com unless you are there to advertise  
No depending on the CMS you use or you have build your custom one, we need a RSS url.
In this case i&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<h2>Step 1 - Finding your RSS Feed</h2>
<p>Now before you can use FeedBurner you need a RSS feed, or else you are wasting your time at feedburner.com unless you are there to advertise <img src='http://xcodetuts.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>No depending on the CMS you use or you have build your custom one, we need a RSS url.<br />
In this case i&#8217;m using Wordpress so the feed URL can be found at domain.com/feed for example http://xcodetuts.com/feed. You can use any RSS feed, just to make that clear!</p>
<p>Ok, got your RSS feed URL? Great! Let&#8217;s go to <a href="http://www.feedburner.com">feedburner.com</a> and get started!<br />
Copy and paste the RSS feed URL into the long input field, you can&#8217;t miss it <img src='http://xcodetuts.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> <br />
Now depending on if you are a pod caster check the checkbox if not, just leave it unchecked.</p>
<div class="tut_img">
<a href="http://xcodetuts.com/wp-content/uploads/2008/09/enter-feed-url.png"><img src="http://xcodetuts.com/wp-content/uploads/2008/09/enter-feed-url-300x50.png" alt="" title="enter-feed-url" width="300" height="50" class="alignnone size-medium wp-image-227" /></a>
</div>
<h2>Step 2 - Basic Setup</h2>
<p>So before FeedBurner can start tracking your RSS Feed, you have to make sure that the RSS link on your website is going to link to the feed address but we will take about that later on. First give your feed a title and make sure that all details are correct. Now you can either create a new account or sign in if you already have one. Done? Hit Activate Feed!</p>
<div class="tut_img">
<a href="http://xcodetuts.com/wp-content/uploads/2008/09/basic-setup.png"><img src="http://xcodetuts.com/wp-content/uploads/2008/09/basic-setup-202x300.png" alt="" title="basic-setup" width="202" height="300" class="alignnone size-medium wp-image-228" /></a></div>
<p>Congrats! Your FeedBurner feed is now live!<br />
Now that you have that done you can set some more additional free FeedBurner Stats by pressing Next</p>
<div class="tut_img">
<a href="http://xcodetuts.com/wp-content/uploads/2008/09/congrats.png"><img src="http://xcodetuts.com/wp-content/uploads/2008/09/congrats-257x300.png" alt="" title="congrats" width="257" height="300" class="alignnone size-medium wp-image-229" /></a></div>
<p>At the Enhance Your Stats page you can activate some additional features FeedBurner offers.<br />
Not happy with the free features? Well in that case you have to become a PRO member.</p>
<p>As free users you can add 2 additional features, which i think are not really important.<br />
Clickthroughs changes all links in the feed so they can track clicks, i think that this does and can effect you traffic in a negative way. Item enclosure downloads can be checked for users who want to track there podcast downloads.</p>
<div class="tut_img">
<a href="http://xcodetuts.com/wp-content/uploads/2008/09/more-features.png"><img src="http://xcodetuts.com/wp-content/uploads/2008/09/more-features-227x300.png" alt="" title="more-features" width="227" height="300" class="alignnone size-medium wp-image-230" /></a></div>
<p>After you click Next you will see that you Traffic is now being monitored by FeedBurner.<br />
Please note, that it can take a few hours before traffic details will be displayed.</p>
<h2>Step 3 - Linking to FeedBurner</h2>
<p>Now while we wait for FeedBurner to become active, we can work on our website and make sure that all RSS links are redirected to FeedBurner.<br />
When you got your own custom coded website, you just have to change the URL to make it work, but what about Wordpress, because Wordpress dynamicly creates RSS links for each post.<br />
We are lucky because &quot;FeedBurner FeedSmith&quot; a plugin originally authored by Steve Smith does everything for us, because this plugin detects all ways to access your original Wordpress feeds and redirects them to your FeedBurner feed so you can track every possible subscriber. So <a href="http://www.feedburner.com/fb/products/feedburner_feedsmith_plugin_2.3.zip">click</a> here to download the plugin.</p>
<div class="tut_img">
<a href="http://xcodetuts.com/wp-content/uploads/2008/10/download.png"><img class="alignnone size-full wp-image-231" title="download" src="http://xcodetuts.com/wp-content/uploads/2008/10/download.png" alt="" width="500" height="398" /></a>
</div>
<p>When the file has been downloaded, unzip it and upload <strong>FeedBurner_FeedSmith_Plugin.php </strong>into your plugin directory which can be found in wp-content/plugins/.</p>
<div class="tut_img">
<a href="http://xcodetuts.com/wp-content/uploads/2008/10/structure.png"><img src="http://xcodetuts.com/wp-content/uploads/2008/10/structure.png" alt="" title="structure" width="240" height="73" class="alignnone size-full wp-image-232" /></a>
</div>
<p>And that&#8217;s the only file you have to upload, now simply close your FTP program and login at your Wordpress Administration Area.<br />
When logged in, click the plugins tab on the right side of the control panel.</p>
<div class="tut_img">
<a href="http://xcodetuts.com/wp-content/uploads/2008/10/activate-plugin.png"><img src="http://xcodetuts.com/wp-content/uploads/2008/10/activate-plugin-300x156.png" alt="" title="activate-plugin" width="300" height="156" class="alignnone size-medium wp-image-233" /></a>
</div>
<p>As you can see Wordpress recognizes the plugin we uploaded, but it&#8217;s not working yet because we have to activate it.<br />
Just click <strong>Activate</strong> on the right side of the plugin, and the plugin will be activated and start running right away.</p>
<p>One more thing is left to do before it will work, we need to tell the plugin whats the url to the FeedBurner Feed, so open your settings Tab and click FeedBurner.</p>
<div class="tut_img">
<a href="http://xcodetuts.com/wp-content/uploads/2008/10/feedburner-settings.png"><img src="http://xcodetuts.com/wp-content/uploads/2008/10/feedburner-settings-300x149.png" alt="" title="feedburner-settings" width="300" height="149" class="alignnone size-medium wp-image-235" /></a>
</div>
<p>Now a simple method to check if its working, open your web browser and enter the URL of your website + /rss, now you should be redirected to FeedBurner.</p>
<div class="tut_img">
<a href="http://xcodetuts.com/wp-content/uploads/2008/10/url_change.png"><img src="http://xcodetuts.com/wp-content/uploads/2008/10/url_change.png" alt="" title="url_change" width="337" height="64" class="alignnone size-full wp-image-234" /></a>
</div>
<h2>Feed Stats</h2>
<p>After a few hours you can take a look at your first feed stats.<br />
Just play around with all options that FeedBurner offers!<br />
So this is the end of this tutorial! If you enjoyed it, please use one of the promotion links below or leave a comment.</p>
<div class="tut_img">
<a href="http://xcodetuts.com/wp-content/uploads/2008/10/feed-stats.png"><img src="http://xcodetuts.com/wp-content/uploads/2008/10/feed-stats-300x212.png" alt="" title="feed-stats" width="300" height="212" class="alignnone size-medium wp-image-236" /></a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://xcodetuts.com/web-applications/getting-started-with-feedburner/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Building a Wordpress / website live Ajax search using jQuery</title>
		<link>http://xcodetuts.com/javascript-ajax/building-a-wordpress-website-live-ajax-search-using-jquery/</link>
		<comments>http://xcodetuts.com/javascript-ajax/building-a-wordpress-website-live-ajax-search-using-jquery/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 16:23:54 +0000</pubDate>
		<dc:creator>Headshot</dc:creator>
		
		<category><![CDATA[JavaScript / AJAX]]></category>

		<category><![CDATA[Working with CMS's]]></category>

		<category><![CDATA[jQuery]]></category>

		<category><![CDATA[Live Search]]></category>

		<category><![CDATA[Plugin]]></category>

		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://xcodetuts.com/?p=212</guid>
		<description><![CDATA[
	


Step 1 - Download jQuery and the required plugin
Before we can start editing our Wordpress theme, we have to download the required JavaScript files. For this tutorial we will use the jQuery JavaScript framework and a plugin called &#8220;jQuery Live Ajax Search&#8221; which is made by Andreas Lagerkvist.

Just download the Production version because we are [...]]]></description>
			<content:encoded><![CDATA[<div class="source_img">
	<a href="http://xcodetuts.com/wp-content/uploads/2008/09/wordpress-live-search.zip" target="_blank"><img src="http://xcodetuts.com/images/download.gif" alt="" /></a><a href="http://demo.xcodetuts.com/building-a-wordpress-website-live-ajax-search-using-jquery/" target="_blank"><img src="http://xcodetuts.com/images/demo.gif" alt="" /></a></p>
<div class="clear"></div>
</div>
<h2>Step 1 - Download jQuery and the required plugin</h2>
<p>Before we can start editing our Wordpress theme, we have to download the required JavaScript files. For this tutorial we will use the jQuery JavaScript framework and a plugin called &#8220;jQuery Live Ajax Search&#8221; which is made by Andreas Lagerkvist.</p>
<div class="tut_img"><img src="http://xcodetuts.com/wp-content/uploads/2008/09/download-jquery.png" alt="download-jquery.png" border="0" width="287" height="207" /></div>
<p>Just download the <strong>Production</strong> version because we are not going to edit the jQuery Framework.</p>
<p>The plugin files can be found here: <a href="http://xcodetuts.com/wp-content/uploads/2008/09/plugin.zip" title="plugin.zip">plugin.zip</a> |<br />
<em>Visit plugin <a href="http://exscale.se/">author</a> website</em></p>
<h2>Step 2 - Uploading the required files</h2>
<p>Now you can use this method for any websites, but in this case we will apply it to a Wordpress theme.</p>
<p>So lets upload the files to our theme directory, in this tutorial, i will use the default Wordpress theme.</p>
<p><strong>Theme Directory:</strong> wp-content/themes/default/</p>
<p>Now this is how you need to structure your files to keep it nice and clean:</p>
<div class="tut_img"><img src="http://xcodetuts.com/wp-content/uploads/2008/09/structure.png" alt="structure.png" border="0" width="165" height="133" /></div>
<p>Make sure you use the same structure for your files.<br />
Which means:</p>
<ul>
<li>wp-content/themes/default/css/live-search.css</li>
<li>wp-content/themes/default/js/jquery-1.2.6.min.js</li>
<li>wp-content/themes/default/js/jquery.liveSearch.js</li>
</ul>
<h2>Step 3 - Include the files</h2>
<p>To include the JavaScript and the CSS we have to edit the header of the template, which is <strong>header.php</strong>. Here we can find the &lt;head&gt; tags, where the JavaScript and CSS should be loaded.</p>
<pre name="code" class="html">
&lt;link rel=stylesheet type=&quot;text/css&quot; href=&quot;&lt;?php bloginfo('template_directory'); ?&gt;/css/live-search.css&quot;&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php bloginfo('template_directory'); ?&gt;/js/jquery-1.2.6.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php bloginfo('template_directory'); ?&gt;/js/jquery.liveSearch.js&quot;&gt;&lt;/script&gt;
&lt;?php wp_head(); ?&gt;</pre>
<p>This will load the required files, now what means the following:</p>
<pre name="code" class="php">&lt;?php bloginfo('template_directory'); ?&gt;</pre>
<p>This is a Wordpress code that will return the URL to the directory of the theme. Which will return the following:</p>
<pre name="code" class="html">
&lt;link rel=stylesheet type=&quot;text/css&quot; href=&quot;http://xcodetuts.com/wp-content/themes/default/css/live-search.css&quot;&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://xcodetuts.com/wp-content/themes/default/js/jquery-1.2.6.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://xcodetuts.com/wp-content/themes/default/js/jquery.liveSearch.js&quot;&gt;&lt;/script&gt;</pre>
<h2>Step 4 - Taking a look at Wordpress search</h2>
<p>Before we can start, lets take a look at the search form.</p>
<pre name="code" class="html">
&lt;form method=&quot;get&quot; id=&quot;searchform&quot; action=&quot;http://xcodetuts.com/&quot;&gt;
&lt;label class=&quot;hidden&quot; for=&quot;s&quot;&gt;Search for:&lt;/label&gt;
&lt;div&gt;&lt;input type=&quot;text&quot; value=&quot;&quot; name=&quot;s&quot; id=&quot;s&quot; /&gt;
&lt;input type=&quot;submit&quot; id=&quot;searchsubmit&quot; value=&quot;Search&quot; /&gt;
&lt;/div&gt;
&lt;/form&gt;</pre>
<p>Now when you enter a search keyword and hit Search, you will see that the url changes in your browser address bar:</p>
<div class="tut_img"><img src="http://xcodetuts.com/wp-content/uploads/2008/09/address.png" alt="address.png" border="0" width="272" height="37" /></div>
<p>As you can see your search term will display after the s=, if you would change this you will see that it will look for the term you have changed it to. So this is how it works, i needed to make this clear because it will help you understand the next step.</p>
<h2>Step 5 - Configuring jQuery live ajax search</h2>
<p>Now its very easy to activate the live search, just open <strong>footer.php</strong> and add the following before &lt;/body&gt;</p>
<pre name="code" class="js">
&lt;script type=&quot;text/javascript&quot;&gt;
     $('#s').liveSearch({ajaxURL: 'index.php?s='});
&lt;/script&gt;
</pre>
<p>Ok great, but what did we just do?<br />
We told the plugin where to grab the search term and where to find the search file.</p>
<p>So it will look for a input field where the id=&#8221;s&#8221; in this case our search input field. I also showed you the way how Wordpress searches, as you can see i told the live search plugin that index.php?s= is how to search and this means that the plugin will add the search terms after the s=!</p>
<p>So let&#8217;s try it out:</p>
<div class="tut_img"><img src="http://xcodetuts.com/wp-content/uploads/2008/09/search-test.png" alt="search-test.png" border="0" width="212" height="464" /></div>
<p>Now that&#8217;s not really what we want right, because we get the search results back including the whole template. So we need to apply a little hack to make this work. First let&#8217;s change the JavaScript to:</p>
<pre name="code" class="js">
&lt;script type=&quot;text/javascript&quot;&gt;
     $('#s').liveSearch({ajaxURL: 'index.php?ajax=1&#038;s='});
&lt;/script&gt;
</pre>
<p>I added a short string which allows us to check if somebody using the normal search, or the ajax live search instead. So now that&#8217;s done, open <strong>search.php</strong>.</p>
<p>Now you see a whole bunch of code, let&#8217;s start simple so add the following before &lt;?php get_header(); ?&gt;.</p>
<pre name="code" class="php">
&lt;?php if($_GET['ajax'] == '1'){ ?&gt;
	//Our code for live search
&lt;?php }else{ ?&gt;
	// Here is the code that's allready in that file
&lt;?php } ?&gt;
</pre>
<p>So now when you would enter some text:</p>
<pre name="code" class="php">
&lt;?php if($_GET['ajax'] == '1'){ ?&gt;
	Hi there! This is going to be our live search!
&lt;?php }else{ ?&gt;
	// Here is the code that's allready in that file
&lt;?php } ?&gt;
</pre>
<div class="tut_img"><img src="http://xcodetuts.com/wp-content/uploads/2008/09/live-search-inactive.png" alt="live-search-inactive.png" border="0" width="162" height="242" /></div>
<p>So that works perfect! And if you would hit the search button you will see that the normal search also works fine! <img src='http://xcodetuts.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>But now we have to make it so that it shows us the real search results.<br />
So what i did is copy the code from the original search and changed a few things:</p>
<pre name="code" class="php">
&lt;?php if($_GET['ajax'] == '1'){ ?&gt;

	&lt;?php if (have_posts()) : ?&gt;

		&lt;h2&gt;Search Results for &quot;&lt;?php the_search_query(); ?&gt;&quot;&lt;/h2&gt;

		&lt;?php while (have_posts()) : the_post(); ?&gt;

			&lt;div class=&quot;search-result&quot;&gt;
				&lt;h3 id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;
			&lt;/div&gt;

		&lt;?php endwhile; ?&gt;

	&lt;?php else : ?&gt;

		&lt;h2&gt;No posts found. Try a different search?&lt;/h2&gt;

	&lt;?php endif; ?&gt;

&lt;?php }else{ ?&gt;
</pre>
<p>As you can see i removed parts like &lt;?php get_header(); ?&gt;, &lt;?php get_sidebar(); ?&gt; and &lt;?php get_footer(); ?&gt; because these tags include template files. And we don&#8217;t want that! So this is how it would look:</p>
<div class="tut_img"><img src="http://xcodetuts.com/wp-content/uploads/2008/09/search-result.png" alt="search-result.png" border="0" width="175" height="165" /></div>
<p><strong>Final: Search.php</strong></p>
<pre name="code" class="php">
&lt;?php if($_GET['ajax'] == '1'){ ?&gt;

	&lt;?php if (have_posts()) : ?&gt;

		&lt;h2&gt;Search Results for &quot;&lt;?php the_search_query(); ?&gt;&quot;&lt;/h2&gt;

		&lt;?php while (have_posts()) : the_post(); ?&gt;

			&lt;div class=&quot;search-result&quot;&gt;
				&lt;h3 id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;
			&lt;/div&gt;

		&lt;?php endwhile; ?&gt;

	&lt;?php else : ?&gt;

		&lt;h2&gt;No posts found. Try a different search?&lt;/h2&gt;

	&lt;?php endif; ?&gt;

&lt;?php }else{ ?&gt;

&lt;?php get_header(); ?&gt;

	&lt;div id=&quot;content&quot; class=&quot;narrowcolumn&quot;&gt;

	&lt;?php if (have_posts()) : ?&gt;

		&lt;h2 class=&quot;pagetitle&quot;&gt;Search Results&lt;/h2&gt;

		&lt;div class=&quot;navigation&quot;&gt;
			&lt;div class=&quot;alignleft&quot;&gt;&lt;?php next_posts_link('&amp;laquo; Older Entries') ?&gt;&lt;/div&gt;
			&lt;div class=&quot;alignright&quot;&gt;&lt;?php previous_posts_link('Newer Entries &amp;raquo;') ?&gt;&lt;/div&gt;
		&lt;/div&gt;

		&lt;?php while (have_posts()) : the_post(); ?&gt;

			&lt;div class=&quot;post&quot;&gt;
				&lt;h3 id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;
				&lt;small&gt;&lt;?php the_time('l, F jS, Y') ?&gt;&lt;/small&gt;

				&lt;p class=&quot;postmetadata&quot;&gt;&lt;?php the_tags('Tags: ', ', ', '&lt;br /&gt;'); ?&gt; Posted in &lt;?php the_category(', ') ?&gt; | &lt;?php edit_post_link('Edit', '', ' | '); ?&gt;  &lt;?php comments_popup_link('No Comments &amp;#187;', '1 Comment &amp;#187;', '% Comments &amp;#187;'); ?&gt;&lt;/p&gt;
			&lt;/div&gt;

		&lt;?php endwhile; ?&gt;

		&lt;div class=&quot;navigation&quot;&gt;
			&lt;div class=&quot;alignleft&quot;&gt;&lt;?php next_posts_link('&amp;laquo; Older Entries') ?&gt;&lt;/div&gt;
			&lt;div class=&quot;alignright&quot;&gt;&lt;?php previous_posts_link('Newer Entries &amp;raquo;') ?&gt;&lt;/div&gt;
		&lt;/div&gt;

	&lt;?php else : ?&gt;

		&lt;h2 class=&quot;center&quot;&gt;No posts found. Try a different search?&lt;/h2&gt;
		&lt;?php include (TEMPLATEPATH . '/searchform.php'); ?&gt;

	&lt;?php endif; ?&gt;

	&lt;/div&gt;

&lt;?php get_sidebar(); ?&gt;

&lt;?php get_footer(); ?&gt;

&lt;?php } ?&gt;
</pre>
<p>As you can see it returns the post &#8220;Hello world!&#8221;, so it works great!</p>
<h2>Step 6 - Styling search results</h2>
<p>We are almost done! We only need to style our results, which we can do in <strong>live-search.css</strong>. In this CSS file you can change all kind of things for the live search like the width of the results, fonts, colors etc.</p>
<p>First let&#8217;s change the margin and padding of h2 and h3 because its way to much:</p>
<pre name="code" class="css">
	div.live-search-results h2 {
		font: 14px/1.2 Trebuchet MS, sans-serif;
		padding: 0;
		margin: 0;
	}

     div.live-search-results h3 {
		font: 12px/1.2 Trebuchet MS, sans-serif;
		padding: 0;
		margin: 5px;
	}
</pre>
<p>So that will look like: </p>
<div class="tut_img"><img src="http://xcodetuts.com/wp-content/uploads/2008/09/result.png" alt="result.png" border="0" width="198" height="234" /></div>
<p>So that&#8217;s the end of this tutorial, ofcourse you can style it much nice and give it some nice effects! So if you enjoyed it, please leave a comment and show me what you have made!</p>
<div class="source_img">
	<a href="http://xcodetuts.com/wp-content/uploads/2008/09/wordpress-live-search.zip" target="_blank"><img src="http://xcodetuts.com/images/download.gif" alt="" /></a><a href="http://demo.xcodetuts.com/building-a-wordpress-website-live-ajax-search-using-jquery/" target="_blank"><img src="http://xcodetuts.com/images/demo.gif" alt="" /></a></p>
<div class="clear"></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://xcodetuts.com/javascript-ajax/building-a-wordpress-website-live-ajax-search-using-jquery/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Displaying Flickr group images in your Wordpress sidebar</title>
		<link>http://xcodetuts.com/misc/displaying-flickr-group-images-in-your-wordpress-sidebar/</link>
		<comments>http://xcodetuts.com/misc/displaying-flickr-group-images-in-your-wordpress-sidebar/#comments</comments>
		<pubDate>Sat, 30 Aug 2008 12:50:21 +0000</pubDate>
		<dc:creator>Headshot</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<category><![CDATA[Working with CMS's]]></category>

		<category><![CDATA[Flickr]]></category>

		<category><![CDATA[Plugin]]></category>

		<category><![CDATA[Sidebar]]></category>

		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://xcodetuts.com/?p=151</guid>
		<description><![CDATA[Hi there and welcome to another exciting tutorial at XCODETUTS!
Well lets start of, first of all Flickr is part of Yahoo, so you will need a Yahoo account in order to setup your own Flickr group. If you don&#8217;t want to show of your own Flickr group but of somebody else? Well in that case [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there and welcome to another exciting tutorial at XCODETUTS!<br />
Well lets start of, first of all Flickr is part of Yahoo, so you will need a Yahoo account in order to setup your own Flickr group. If you don&#8217;t want to show of your own Flickr group but of somebody else? Well in that case you don&#8217;t need a Yahoo account.</p>
<h2>Step 1 - Creating a Flickr group</h2>
<p>Get your ass over to <a href="http://www.flickr.com/" target="_blank">Flickr</a> and login <img src='http://xcodetuts.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div class="tut_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/login-complete.gif"><img class="alignnone size-full wp-image-157" title="login-complete" src="http://xcodetuts.com/wp-content/uploads/2008/08/login-complete.gif" alt="" width="500" height="184" /></a></div>
<p>Now in order to create a new group, you have to click the arrow on the right side of the <strong>Groups </strong>link.<br />
A menu will then show with a few new links, now press <strong>Create a New Group</strong>.</p>
<div class="tut_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/group_sort.gif"><img class="alignnone size-full wp-image-159" title="group_sort" src="http://xcodetuts.com/wp-content/uploads/2008/08/group_sort.gif" alt="" width="499" height="91" /></a></div>
<p>If you want to create a new group you have to choose a group sort.<br />
Either Public (anyone can join), Public(invitation only) or Private.</p>
<p>Now, i want to use it for my website, and i think anyone should be allowed to join the group.<br />
But that&#8217;s all up to you to decide.</p>
<div class="tut_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/create_public_group.gif"><img class="alignnone size-full wp-image-162" title="create_public_group" src="http://xcodetuts.com/wp-content/uploads/2008/08/create_public_group.gif" alt="" width="500" height="517" /></a></div>
<p>First of al, you need to give it a name, for example the name of your website, so ill try XCODETUTS.<br />
Next, what is the group about, well it&#8217;s about web development en design tutorials so lets enter that.<br />
Now your group safety, most of the time you will use the selected option, but if you are showing images for 18+ please select the second option. When you have everything filled in click the <strong>Next</strong> button.</p>
<div class="tut_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/non-members.gif"><img class="alignnone size-full wp-image-164" title="non-members" src="http://xcodetuts.com/wp-content/uploads/2008/08/non-members.gif" alt="" width="500" height="152" /></a></div>
<p>Next up is what would you like to display when non Flickr members visit your group page.<br />
First option will display recent discussions that your group has started, they can see this and click it to view each topic.</p>
<p>Second up is the group photo pool, this will display photo&#8217;s that have been added not so long ago.<br />
But they wont see all the photo&#8217;s in order to that they need to click the link that allows them to see all the content in a group pool.</p>
<p>Just hit <strong>Next</strong> when you are done, in my case i leave them both checked.</p>
<div class="tut_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/group-member-name.gif"><img class="alignnone size-full wp-image-166" title="group-member-name" src="http://xcodetuts.com/wp-content/uploads/2008/08/group-member-name.gif" alt="" width="259" height="230" /></a></div>
<p>And the next step is giving the group Administrators, Moderators and Members a name, you can think of anything, call them names that fit the group, or just something funny its all up to you. When your done thinking of cool names, just hit <strong>ALL DONE</strong>!</p>
<p>After that, your Flickr group has been made! And people can now join your Flickr group and upload new images. Now i will upload some images to my group, or else we will have a empty example <img src='http://xcodetuts.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<h2>Step 2 - Downloading Wordpress Flickr plugin</h2>
<p>In order to display images from your Flickr group we will need a WordPress plugin, this plugin will make it much easier to manage it. The plugin is called flickrRSS, so <a href="http://eightface.com/wordpress/flickrrss/" target="_blank">click here</a> and download it!</p>
<p>In case you are wondering, I&#8217;m using the latest version of <a href="http://wordpress.org/" target="_blank">Wordpress</a>, so in my case i will download the plugin for 2.5 which also works with 2.6.x</p>
<p>The flickrRSS zip contains the following files:</p>
<ul>
<li>flickrrss.php</li>
<li>README.html</li>
</ul>
<h2>Step 3 - Installing flickrRSS</h2>
<p>Now, you will have to upload <strong>flickrrss.php</strong> to <strong>/wp-content/plugins/</strong> this is the directory where all plugins should be placed. Now login to your Wordpress administration panel, and click the <strong>plugins</strong> tab.</p>
<div class="tut_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/plugin_management.jpg"><img class="alignnone size-full wp-image-168" title="plugin_management" src="http://xcodetuts.com/wp-content/uploads/2008/08/plugin_management.jpg" alt="" width="500" height="174" /></a></div>
<p>Now in the plugin management area, click the checkbox on the left of the flickrRSS plugin name, and click activate. This will set that specific plugin active and working.</p>
<div class="tut_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/click_flickrrss.gif"><img class="alignnone size-full wp-image-170" title="click_flickrrss" src="http://xcodetuts.com/wp-content/uploads/2008/08/click_flickrrss.gif" alt="" width="368" height="29" /></a></div>
<p>Although the plugin is active, it will not yet work because we haven&#8217;t configured it yet.<br />
So click the <strong>settings</strong> tab on the right and click the <strong>flickrRSS</strong> link.</p>
<h2>Step 4 - Configuring flickrRSS</h2>
<p>When you reached the flickrRSS settings you will have to fill in the following information.</p>
<div class="tut_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/flickrss_settings.gif"><img class="alignnone size-full wp-image-171" title="flickrss_settings" src="http://xcodetuts.com/wp-content/uploads/2008/08/flickrss_settings.gif" alt="" width="500" height="233" /></a></div>
<p>First up, you group ID number, this is a unique number that points to your group.<br />
So lets get that by going <a href="http://idgettr.com/" target="_blank">idGettr</a>, now in the &#8220;Photostream Address&#8221; input field, enter the url to your group.</p>
<div class="tut_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/idgettr.gif"><img class="alignnone size-full wp-image-172" title="idgettr" src="http://xcodetuts.com/wp-content/uploads/2008/08/idgettr.gif" alt="" width="500" height="264" /></a></div>
<p>Just enter the ID you get returned into the ID number field at the flickrRSS settings.<br />
Next, the display options, well we are showing images from a group, so select the group option so it will show items from the previous entered group id. You can also set how much images you want it to display, i think 6 square images would look nice, but its all up to you to decide.</p>
<p>The Set and Tags fields are not really required but you can fill them in if you want.</p>
<p>Next up is the <strong>HTML Wrapper</strong> !important!, the code you enter will display before and after each image.<br />
This allows you to add a nice class and style the images later on. So i added the following in the fields:</p>
<pre name="code" class="html">Before Image: &lt;div class="flickr_img"&gt;
After Image : &lt;/div&gt;</pre>
<p>Below the main settings you also have the Cache Settings, i dont think that&#8217;s needed for this tutorial but feel free to try it out. Don&#8217;t forget to press <strong>Save Settings</strong> when you are done!</p>
<h2>Step 5 - Installing flickrRSS into your Wordpress theme</h2>
<p>In this tutorial we will add the flickRSS to the sidebar, but you can use the following code for any other part of the Wordpress theme template files. I will be using the default Wordpress theme, that comes with every Wordpress installation.</p>
<p>So let&#8217;s open the sidebar template file, this file can be found it the following directory <strong>/wp-content/themes/default/sidebar.php</strong></p>
<div class="tut_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/default_theme_sidebar.gif"><img class="alignnone size-full wp-image-176" title="default_theme_sidebar" src="http://xcodetuts.com/wp-content/uploads/2008/08/default_theme_sidebar.gif" alt="" width="237" height="299" /></a></div>
<p>Now i think it would look nice, if the flickr images would show between the Categories and the Blogroll, so let&#8217;s go into our sidebar.php file. So search for the following line:</p>
<pre name="code" class="php">&lt;?php wp_list_categories('show_count=1&amp;title_li=&lt;h2&gt;Categories&lt;/h2&gt;'); ?&gt;</pre>
<p>Now we are going to display the flickrRSS below this line, because the line above displays the Categories, in order to display the flickrRSS we can call the flickrRSS function like this: &lt;?php get_flickrRSS(); ?&gt;<br />
So this would look like:</p>
<pre name="code" class="php">&lt;?php wp_list_categories('show_count=1&amp;title_li=&lt;h2&gt;Categories&lt;/h2&gt;'); ?&gt;

 &lt;?php get_flickrRSS(); ?&gt;</pre>
<p>Now 2 things might happen, <strong>1</strong> Your flickr group images will show, <strong>2</strong> It will show nothing.</p>
<ol>
<li>Goooood! Glad its working</li>
<li>If your Flickr group is new it could take a few hours before it kicks in, so please be patient.</li>
</ol>
<p>If you still want to continue just grab a group ID of a flickr group that has been online for quite some time.<br />
For example let&#8217;s grab the ID of <a href="http://www.flickr.com/groups/000000/" target="_blank">0000</a>(group name ;)) just use idGettr to get the id. (54808554@N00).</p>
<div class="tut_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/flickr_long_list.gif"><img class="alignnone size-full wp-image-179" title="flickr_long_list" src="http://xcodetuts.com/wp-content/uploads/2008/08/flickr_long_list.gif" alt="" width="133" height="636" /></a></div>
<p>Now as you can see, this doesn&#8217;t look very good does it.<br />
So that&#8217;s why we we added the HTML Wrapper before and after the image.</p>
<h2>Step 6 - Styling flickrRSS</h2>
<p>Now our final step is styling the images of course, because it doesn&#8217;t look very nice if it&#8217;s displayed in one long list. So let&#8217;s start styling, every Wordpress theme has a stylesheet, which always hast the same name, called style.css, so let&#8217;s open it and start writing css. (wp-content/themes/default/style.css).</p>
<p>Now as you might remember, we have added a HTML wrapper around the image in the flickrRSS settings, using a div with the class flickr_img, which we can now style. This is how a image is displayed ( i removed the url&#8217;s):</p>
<pre name="code" class="html">
<div class="flickr_img"><a href="#link-to-image-on-website" title="XCODETUTS"><img src="#link-to-image" alt="XCODETUTS" /></a></div>
</pre>
<p>So let&#8217;s add the following to our stylesheet:</p>
<pre name="code" class="css">.flickr_img a{
    float:left;
}</pre>
<p>We are telling that all links and what they contain, in this case a image should float left.<br />
Now if would take a look, you will see that the images are moved next to each other which is good.</p>
<div class="tut_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/images_show_nostyle.gif"><img class="alignnone size-full wp-image-181" title="images_show_nostyle" src="http://xcodetuts.com/wp-content/uploads/2008/08/images_show_nostyle.gif" alt="" width="173" height="253" /></a></div>
<p>Well that looks ok, but not good enough, it could use some more styling such as some margin, padding and maybe a nice border. So first let&#8217;s add some margin:</p>
<pre name="code" class="css">.flickr_img a{
    float:left;
    margin: 2px;
}</pre>
<p>Now this will push everything that&#8217;s outside the image 2px away on all directions, up, down, left and right.</p>
<div class="tut_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/margin-added.gif"><img class="alignnone size-full wp-image-182" title="margin-added" src="http://xcodetuts.com/wp-content/uploads/2008/08/margin-added.gif" alt="" width="165" height="246" /></a></div>
<p>So that&#8217;s looking good, but what about a nice border and some padding:</p>
<pre name="code" class="css">.flickr_img a{
    float:left;
    margin: 2px;
    border: 1px solid #000;
    padding: 1px;
}</pre>
<p>What this does is, creating a black border around the image, but because of the padding, the border will be pushed 1 px of the image, which creates a nice effect!</p>
<div class="tut_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/complete.gif"><img class="alignnone size-full wp-image-183" title="complete" src="http://xcodetuts.com/wp-content/uploads/2008/08/complete.gif" alt="" width="177" height="260" /></a></div>
<div class="source_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/flickrrss-sidebar.zip" target="_blank"><img src="http://xcodetuts.com/images/download.gif" alt="" /></a></div>
<p>And that&#8217;s the end of this tutorial! Sorry only source files for this tutorial!<br />
If you liked it please leave a comment and click one of the promote links below! <img src='http://xcodetuts.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> I would appreciate it!</p>
]]></content:encoded>
			<wfw:commentRss>http://xcodetuts.com/misc/displaying-flickr-group-images-in-your-wordpress-sidebar/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Integrating Google Maps into Fancybox</title>
		<link>http://xcodetuts.com/javascript-ajax/integrating-google-maps-into-fancybox/</link>
		<comments>http://xcodetuts.com/javascript-ajax/integrating-google-maps-into-fancybox/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 17:08:42 +0000</pubDate>
		<dc:creator>Headshot</dc:creator>
		
		<category><![CDATA[JavaScript / AJAX]]></category>

		<category><![CDATA[FancyBox]]></category>

		<category><![CDATA[Google]]></category>

		<category><![CDATA[jQuery]]></category>

		<category><![CDATA[Maps]]></category>

		<guid isPermaLink="false">http://xcodetuts.com/?p=100</guid>
		<description><![CDATA[What are we going to do?
Well today we will integrate Google Maps into our FancyBox.
Demo&#8217;s tell more then words, so just take a look at the demo  

Step 1 - Downloading FancyBox
FancyBox can be downloaded from ancy.klade.lv, while you are at there website, take a look at the great examples, these show you what [...]]]></description>
			<content:encoded><![CDATA[<h2>What are we going to do?</h2>
<p>Well today we will integrate Google Maps into our FancyBox.<br />
Demo&#8217;s tell more then words, so just take a look at the demo <img src='http://xcodetuts.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div class="source_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/googlemapsfancybox_source_files.zip" target="_blank"><img src="http://xcodetuts.com/images/download.gif" alt="" /></a><a href="http://demo.xcodetuts.com/integrating-google-maps-into-fancybox/" target="_blank"><img src="http://xcodetuts.com/images/demo.gif" alt="" /></a></div>
<h2>Step 1 - Downloading FancyBox</h2>
<p>FancyBox can be downloaded from <a href="http://fancy.klade.lv/">ancy.klade.lv</a>, while you are at there website, take a look at the great examples, these show you what you else you can do with FancyBox besides what we are going to do!<br />
When you are done watching those examples <img src='http://xcodetuts.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> click the ZIP icon in the header of the website to download it.</p>
<div class="tut_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/step-1.gif"><img class="alignnone size-full wp-image-106" title="step-1" src="http://xcodetuts.com/wp-content/uploads/2008/08/step-1.gif" alt="" width="406" height="199" /></a></div>
<p>When you downloaded the FancyBox zip file, unzip it, you will see that all files are in the same directory.<br />
I don&#8217;t really like this, because its not structured, and makes everything messy.</p>
<p>So lets rearrange that by moving all images into a new folder called <strong>img</strong>/, the same for all the JavaScript files but these should go in a folder called <strong>js/</strong>, and last move the CSS file into a new directory called <strong>css/</strong></p>
<div class="tut_img"><img src="http://xcodetuts.com/wp-content/uploads/2008/08/before_after_structure.jpg" alt="" /></div>
<p>So that looks much better, BUT we still have to make a few edits i the <strong>css/fancy.css </strong>and change the path&#8217;s of all images, because we moved them into a new directory.</p>
<p>If you open fancy.css you will notice some backgrounds have images like:</p>
<pre>background: transparent url(fancy_progress.png) no-repeat;</pre>
<p>Now you have to replace all image url with new ones, you can simply do a find &amp; replace with your text editor. <strong>Find:</strong> url( <strong>Replace:</strong> url(../img/ , this will change all background url&#8217;s to:</p>
<pre name="code" class="css">background: transparent url(../img/fancy_progress.png) no-repeat;</pre>
<h2>Step 2 - Your contact page</h2>
<p>We are going to create a simple HTML contact page, this is where the FancyBox + Google Maps will be shown. In this tutorial you will need some basic HTML &amp; CSS knowledge!</p>
<pre name="code" class="html">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
	&lt;head&gt;
		&lt;title&gt;Contact Me&lt;/title&gt; //Website Title
		&lt;style&gt; //Start inline styling
			body{ //Style body background and global font type
				background:#323232;
				font: 11px verdana;
			}

			#wrap{ //Style the content wrap
				background: #FFF; // White background
				width: 500px; // 500px in width
				margin: 0 auto; // Center the wrap
				padding: 10px; // Add some nice space between text and wrap background
				text-align:center; // Center the text and images
			}

		&lt;/style&gt;
	&lt;/head&gt;
	&lt;body&gt;

		&lt;div id="wrap"&gt;
			&lt;h2&gt;Contact Me&lt;/h2&gt;
			&lt;p&gt;Hi there! There is only one way to contact me, and that is by coming to my house!
			Just click the globe below and you will see where i live!&lt;/p&gt;

			&lt;img src="img/globe.jpg" alt="" /&gt;

			&lt;p&gt;&lt;/p&gt;&lt;small&gt;Psst! Click the globe!&lt;/small&gt;&lt;/p&gt;
		&lt;/div&gt;

	&lt;/body&gt;
&lt;/html&gt;</pre>
<p>So the idea is when somebody click&#8217;s the globe image, a FancyBox window will open with the correct Google Map location. This is just a simple page, but you can apply this in any of your websites, cms systems or blogs.<br />
This is how the page would look like - <a href="http://demo.xcodetuts.com/integrating-google-maps-into-fancybox/contact.html" target="_blank">Contact page demo</a></p>
<h2>Step 3 - Installing JavaScript &amp; CSS files</h2>
<p>Now in order to use FancyBox, we need to load the JavaScript files.<br />
Currently we have these files which came with the FancyBox zip:</p>
<ol>
<li><strong>jquery-1.2.3.pack.js</strong></li>
<li><strong>jquery.fancybox-1.0.0.js</strong></li>
<li><strong>jquery.pngFix.pack.js</strong></li>
</ol>
<p><strong>1.</strong> This file contains the jQuery framework, you need this because FancyBox is based on this framework and it will and cannot work without it!</p>
<p><strong>2.</strong> This is the FancyBox &#8220;plugin&#8221; written using the jQuery framework, this is the file that allows us to create these great effects.</p>
<p><strong>3.</strong> FancyBox uses .PNG images wich have shadows in them, IE6 and lower do not support .PNG transparency, so this file is optional, but i advice you use it!</p>
<p>Ok, so now its time to load the JavaScript into our contact page, we are going to load these files between the &lt;head&gt;&lt;/head&gt; tags. Almost forgot <img src='http://xcodetuts.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> we also have to load the the FancyBox CSS file!</p>
<pre name="code" class="html">&lt;head&gt;
  &lt;title&gt;FancyBox + Google Maps | XCODETUTS&lt;/title&gt;
  &lt;script type="text/javascript" src="js/jquery-1.2.3.pack.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="js/jquery.fancybox-1.0.0.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="js/jquery.pngFix.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="js/xcodetuts.js"&gt;&lt;/script&gt;

  &lt;link rel="stylesheet" href="css/fancy.css" type="text/css" media="screen"&gt;
&lt;/head&gt;</pre>
<p>As you can see i also loaded <strong>js/xcodetuts.js</strong>, this is the file where we are going to write some jQuery to active the FancyBox, so just add that link and we will start working on it in the next step.</p>
<p>So what we did is, loading all required JavaScript and the FancyBox stylesheet.<br />
For anyone who does not know what the fancy.css file does, it takes care of all images included in FancyBox, like the shadows and of course the close button.</p>
<h2>Step 4 - Configuring FancyBox</h2>
<p>So what we need to do know is create <strong>js/xcodetuts.js </strong>in the previous step we added the link so it will be loaded, but we still need to create it. Now we are going to start of with the following code:</p>
<pre name="code" class="js">$(document).ready(function() {
   //Our code will come here
}</pre>
<p>The code above means, when everything loaded, run the code between the 2 brackets.</p>
<pre name="code" class="js">$(document).ready(function() {
   $("a#maps").fancybox(); //Activated FancyBox when #maps has been clicked
}</pre>
<p>So lets go back to our contact page, and add the following link around the globe image:</p>
<pre>&lt;a id="maps" href="#googleMaps"&gt;&lt;img src="img/globe.jpg" border="0" alt="" /&gt;&lt;/a&gt;</pre>
<p>So, we gave the link a #maps ID, wich will active the FancyBox.<br />
Ok, so now it&#8217;s time to grab the Google Maps iFrame block, so go to <a href="http://www.maps.google.com" target="_blank">maps.google.com</a>, and enter your home or any other address. When your address is loaded, click the Link button on the top right corner and copy the iFrame code.</p>
<div class="tut_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/google-iframe.png"><img class="alignnone size-medium wp-image-140" title="google-iframe" src="http://xcodetuts.com/wp-content/uploads/2008/08/google-iframe-300x100.png" alt="" width="300" height="100" /></a></div>
<p>Now paste the code at any place of your contact page, but add the following div around it:</p>
<pre name="code" class="html">&lt;div style="display:none" id="googleMaps"&gt;
&lt;iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;amp;hl=en&amp;amp;geocode=&amp;amp;q=1600%2BPennsylvania%2BAve%2BNW%2BWashington,%2BDC%2B20500,%2BUnited%2BStates&amp;amp;sll=37.0625,-95.677068&amp;amp;sspn=30.171443,67.675781&amp;amp;ie=UTF8&amp;amp;t=h&amp;amp;z=14&amp;amp;iwloc=addr&amp;amp;ll=38.908601,-77.032356&amp;amp;output=embed&amp;amp;s=AARTsJqckjdDad6tPeDRH4s3w57t5bbS6A"&gt;&lt;/iframe&gt;
&lt;br /&gt;&lt;small&gt;&lt;a href="http://maps.google.com/maps?f=q&amp;amp;hl=en&amp;amp;geocode=&amp;amp;q=1600%2BPennsylvania%2BAve%2BNW%2BWashington,%2BDC%2B20500,%2BUnited%2BStates&amp;amp;sll=37.0625,-95.677068&amp;amp;sspn=30.171443,67.675781&amp;amp;ie=UTF8&amp;amp;t=h&amp;amp;z=14&amp;amp;iwloc=addr&amp;amp;ll=38.908601,-77.032356&amp;amp;source=embed" style="color:#0000FF;text-align:left"&gt;View Larger Map&lt;/a&gt;&lt;/small&gt;
&lt;/div&gt;</pre>
<p>What this div does, is hiding the code by default, and if you take a look at the id af that div &#8220;googleMaps&#8221; you can see that the href in the url points to that div &#8220;#googleMaps&#8221;, this means these are connected using FancyBox.</p>
<p>Now when you click the image, you will see that FancyBox is working, live example of step 4 can be found <a href="http://demo.xcodetuts.com/integrating-google-maps-into-fancybox/step-4.html" target="_blank">here</a></p>
<div class="tut_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/white_space.jpg"><img class="alignnone size-full wp-image-145" title="white_space" src="http://xcodetuts.com/wp-content/uploads/2008/08/white_space.jpg" alt="" width="275" height="348" /></a></div>
<p>Now as you can see, its not working properly, the FancyBox is way to big which creates white space between the map and the FancyBox border. So we need to adjust the FancyBox frame width and height.</p>
<p>So let&#8217;s get our <strong>xcodetuts.js</strong> file and edit that.</p>
<pre name="code" class="js">$(document).ready(function() { 

    $("a#maps").fancybox({
                'frameWidth': 425, //frameWidth = Default width for iframed and inline content
                'frameHeight': 350 //frameHeight = Default height for iframed and inline content
    });

});</pre>
<p>As you can see, we have set the FancyBox width and height using the FancyBox settings.<br />
Now if you are wondering how i know the excact size of the Google Maps iFrame, well the start of the iFrame code says it:</p>
<pre name="code" class="html">&lt;iframe width="425" height="350"</pre>
<p>You can adjust the size of the Google Maps iFrame and the FancyBox to make it larger.<br />
And that&#8217;s the end of this tutorial! I hope you liked it, and if so please use any of the promote links below.</p>
<div class="source_img"><a href="http://xcodetuts.com/wp-content/uploads/2008/08/googlemapsfancybox_source_files.zip" target="_blank"><img src="http://xcodetuts.com/images/download.gif" alt="" /></a><a href="http://demo.xcodetuts.com/integrating-google-maps-into-fancybox/" target="_blank"><img src="http://xcodetuts.com/images/demo.gif" alt="" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://xcodetuts.com/javascript-ajax/integrating-google-maps-into-fancybox/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Making Wordpress comments collapsible using jQuery</title>
		<link>http://xcodetuts.com/javascript-ajax/making-wordpress-comments-collapsable-using-jquery/</link>
		<comments>http://xcodetuts.com/javascript-ajax/making-wordpress-comments-collapsable-using-jquery/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 23:07:59 +0000</pubDate>
		<dc:creator>Headshot</dc:creator>
		
		<category><![CDATA[JavaScript / AJAX]]></category>

		<category><![CDATA[Collapsale]]></category>

		<category><![CDATA[Comments]]></category>

		<category><![CDATA[jQuery]]></category>

		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://xcodetuts.com/?p=59</guid>
		<description><![CDATA[
	


Step 1 - Downloading jQuery
What is jQuery?
jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages.
For this tutorial you will need jQuery, wich can be downloaded here at jQuery.com. You can download the minified version, because we are not [...]]]></description>
			<content:encoded><![CDATA[<div class="source_img">
	<a href="http://xcodetuts.com/wp-content/uploads/2008/08/source-files.zip" target="_blank"><img src="http://xcodetuts.com/images/download.gif" alt="" /></a><a href="http://demo.xcodetuts.com/making-wordpress-comments-collapsable-using-jquery" target="_blank"><img src="http://xcodetuts.com/images/demo.gif" alt="" /></a></p>
<div class="clear"></div>
</div>
<h2>Step 1 - Downloading jQuery</h2>
<p><b>What is jQuery?</b></p>
<p>jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages.</p>
<p>For this tutorial you will need jQuery, wich can be downloaded here at <a href="http://jquery.com/">jQuery.com</a>. You can download the minified version, because we are not going to edit the jQuery framework itself.</p>
<div class="tut_img">
	<img src="http://xcodetuts.com/wp-content/uploads/2008/08/download_jquery.png" alt="" />
</div>
<h2>Step 2 - Uploading jQuery</h2>
<p>In order to upload jQuery to your website, you need a FTP client, you can get many for free so just use your best friend: <a href="http://www.google.com/search?q=FTP+Client">Google.com</a><br />
Now in this tutorial i&#8217;m going to use the default Wordpress theme (Default) wich can be found in <b>wp-content/themes/default</b>.<br />
We want our files organized so we are going to create a dir for all the JavaScript, in this case <b>wp-content/themes/default/js</b>.<br />
Now simply drag and drop the jQuery file onto that folder in your FTP client, and  you will see that the file is being uploaded.</p>
<h2>Step 3 - Creating a JavaScript code file</h2>
<p>We cant write code into the jQuery framework file, because that&#8217;s not the way to do it and it wont work.<br />
So we have to create another file that contains our JavaScript code, so lets create a new file in our <b>wp-content/themes/default/js</b> directory called <b>collapse.js</b></p>
<div class="tut_img">
	<img src="http://xcodetuts.com/wp-content/uploads/2008/08/directory-list.png" alt="" />
</div>
<h2>Step 4 - Loading the Javascript</h2>
<p>Javascript has to be loaded between the &lt;head&gt;&lt;/head&gt; tags.<br />
The Wordpress template system has 3 main files, <b>header.php, index.php and footer.php</b>, in this case we have to open and edit header.php.<br />
Now we have to add the javascript before these 2 lines:</p>
<pre name="code" class="php">
&lt;?php wp_head(); ?&gt;
&lt;/head&gt;
</pre>
<p>So we need at the following code before those lines</p>
<pre name="code" class="php">
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php bloginfo('stylesheet_directory'); ?&gt;/js/jquery-1.2.6.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php bloginfo('stylesheet_directory'); ?&gt;/js/collapse.js&quot;&gt;&lt;/script&gt;

&lt;?php wp_head(); ?&gt;
&lt;/head&gt;
</pre>
<p>Before saving and closing this file, ill explain you what the wordpress tag ( &lt;?php bloginfo(&#8217;stylesheet_directory&#8217;); ?&gt; ) does.<br />
In this case the tags returns the path to the stylesheet directory or also known as the theme directory(wp-content/themes/default), so when you look at the page its source code it will look like this.</p>
<pre name="code" class="html">
&lt;script type=&quot;text/javascript&quot; src=&quot;http://xcodetuts.com/wp-content/themes/default/js/jquery-1.2.6.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://xcodetuts.com/wp-content/themes/default/js/collapse.js&quot;&gt;&lt;/script&gt;
</pre>
<p>These 2 JavaScript files will be loaded on every page, this is because of the header.php, this file is included on every page.</p>
<h2>Step 5 - Editing comments.php</h2>
<p>In the <b>comments.php</b> file, you can change the way how comments display. We want to make a few edits so we can get the proper effect with jQuery.<br />
We need to focus on the following code in comments.php</p>
<pre name="code" class="php">
&lt;li &lt;?php echo $oddcomment; ?&gt;id=&quot;comment-&lt;?php comment_ID() ?&gt;&quot;&gt;
	&lt;?php echo get_avatar( $comment, 32 ); ?&gt;
	&lt;cite&gt;&lt;?php comment_author_link() ?&gt;&lt;/cite&gt; Says:
	&lt;?php if ($comment-&gt;comment_approved == '0') : ?&gt;
	&lt;em&gt;Your comment is awaiting moderation.&lt;/em&gt;
	&lt;?php endif; ?&gt;
	&lt;br /&gt;

	&lt;small class=&quot;commentmetadata&quot;&gt;&lt;a href=&quot;#comment-&lt;?php comment_ID() ?&gt;&quot; title=&quot;&quot;&gt;&lt;?php comment_date('F jS, Y') ?&gt; at &lt;?php comment_time() ?&gt;&lt;/a&gt; &lt;?php edit_comment_link('edit','&amp;nbsp;&amp;nbsp;',''); ?&gt;&lt;/small&gt;

	&lt;?php comment_text() ?&gt;
&lt;/li&gt;
</pre>
<p>The code above displays the comments, now we need to make a few edits to make it collapsible.<br />
First we need something to click on, so that the comments collaps.</p>
<pre name="code" class="php">
	&lt;span class=&quot;collapse_me&quot;&gt;&lt;/span&gt;
	&lt;cite&gt;&lt;?php comment_author_link() ?&gt;&lt;/cite&gt; Says:
</pre>
<p>Now as you can see, i have added a span and a class, but no text in it, that&#8217;s because it would be nice to display an image instead of text.<br />
And i&#8217;m talking about the <a href="http://famfamfam.com/">famfamfam</a> icons of course. Let&#8217;s try <b>tab_go.png</b>.</p>
<p>So lets open up our stylesheet, which can be found in the theme directory <b>wp-content/themes/default/style.css</b> and add some code to display these images.</p>
<pre name="code" class="css">
span.collapse_me{
	background: url('images/tab_go.png') no-repeat; /* Display the tab_go.png image */
	width: 16px; /* Make sure that its 16px in height */
	height: 16px; /* And 16px in width */
	display: block; /* Make sure it displays as a block */
	float:left; /* Make it float left of the author name */
	margin-right: 5px; /* And create a bit of space between the image and the author name */
}
</pre>
<div class="tut_img">
	<img src="http://xcodetuts.com/wp-content/uploads/2008/08/comment_remove.png" alt="" />
</div>
<p>Now when somebody clicks the button we want the comment text to collapse, so we have to make a div around that with the class <b>comment_tex</b>  so we can hide it with jQuery.</p>
<pre name="code" class="php">
&lt;div class=&quot;comment_text&quot;&gt;
	&lt;?php comment_text() ?&gt;
&lt;/div&gt;
</pre>
<p>You might now understand why this is but you will find out in a bit.<br />
Now we need to make a paragraph around the complete comment including the author and post details, so lets do that and call the class <b>comment_info</b>.</p>
<pre name="code" class="php">
&lt;li &lt;?php echo $oddcomment; ?&gt;id=&quot;comment-&lt;?php comment_ID() ?&gt;&quot;&gt;
	&lt;p class=&quot;comment_info&quot;&gt;
		&lt;?php echo get_avatar( $comment, 32 ); ?&gt;
		&lt;span class=&quot;collapse_me&quot;&gt;&lt;/span&gt;
		&lt;cite&gt;&lt;?php comment_author_link() ?&gt;&lt;/cite&gt; Says:
		&lt;?php if ($comment-&gt;comment_approved == '0') : ?&gt;
		&lt;em&gt;Your comment is awaiting moderation.&lt;/em&gt;
		&lt;?php endif; ?&gt;
		&lt;br /&gt;

		&lt;small class=&quot;commentmetadata&quot;&gt;&lt;a href=&quot;#comment-&lt;?php comment_ID() ?&gt;&quot; title=&quot;&quot;&gt;&lt;?php comment_date('F jS, Y') ?&gt; at &lt;?php comment_time() ?&gt;&lt;/a&gt; &lt;?php edit_comment_link('edit','&amp;nbsp;&amp;nbsp;',''); ?&gt;&lt;/small&gt;

		&lt;div class=&quot;comment_text&quot;&gt;
			&lt;?php comment_text() ?&gt;
		&lt;/div&gt;
	&lt;/p&gt;
&lt;/li&gt;
</pre>
<p>Ok, the editing is done! What we did so far is add a image to collapse the comment and added a div around the comment text so we can hide that.<br />
And another div around the complete comment so we can call to that using jQuery.</p>
<h2>Step 6 - Editing collapse.js</h2>
<p>Ok now its time to edit the collapse.js which is empty at this moment. First we have to add the document ready tags, what this does is waiting for the page to load and then execute the javascript code.</p>
<pre name="code" class="js">
$(document).ready(function(){
	// Your code here
}
</pre>
<p>When the page is loaded, the script between the brackets will be executed.<br />
Now we need to write a code that executes when the image with the class collapse_me is clicked.<br />
jQuery has some easy commands for that, in this case the click function which runs the code when something is clicked.<br />
As you can see below, it actually says, when something with the .collapse class is clicked run this code.</p>
<pre name="code" class="js">
$(".collapse_me").click(function(){
	// Your code here
});
</pre>
<p>What we can do is just make the text dissapear, but that&#8217;s now really nice looking so we are going to animate it using jQuery:</p>
<pre name="code" class="js">
$(".collapse_me").click(function(){
	$(this).parents(".comment_info").next(".comment_text").slideToggle(700);
});
</pre>
<p>Ok so what happends there? We tell jQuery to slide the text up or down depeding on its current state.<br />
We dont want all the comments to slide up so that&#8217;s why we first lookup the <a href="http://docs.jquery.com/Traversing/parents">parents</a>, in this case comment_info.<br />
The 700 between the ( ) means the speed, you can adjust this to whatever you like.<br />
If you now go to your website, you will see that your comments will collapse.</p>
<div class="tut_img">
	<img src="http://xcodetuts.com/wp-content/uploads/2008/08/collapse.png" alt="" />
</div>
<p>Now we have one extra for this tutorial and that is a button that collapses all comments at once, so let&#8217;s add a new line above all comments in the <b>comments.php</b> file.</p>
<pre name="code" class="php">
	&lt;h3 id=&quot;comments&quot;&gt;&lt;?php comments_number('No Responses', 'One Response', '% Responses' );?&gt; to &amp;#8220;&lt;?php the_title(); ?&gt;&amp;#8221;&lt;/h3&gt;
	&lt;span class=&quot;collapse_all&quot;&gt;Collapse / Expand all&lt;/span&gt;
</pre>
<div class="tut_img">
	<img src="http://xcodetuts.com/wp-content/uploads/2008/08/expand_collapse_all.png" alt="" />
</div>
<p>We have added the span and the class around the text so we can call it again using jQuery.</p>
<pre name="code" class="js">
$(document).ready(function(){

	$(".collapse_me").click(function(){
		$(this).parents(".comment_info").next(".comment_text").slideToggle(700);
	});

	$(".collapse_all").click(function(){
		$(".comment_text").slideToggle(700);
	});

});
</pre>
<div class="tut_img">
	<img src="http://xcodetuts.com/wp-content/uploads/2008/08/collapse_all.png" alt="" />
</div>
<p>So what we did is make the collapse_all class clickable, and made a comment_text classes to slide up.<br />
As you can see we do not use the parents class, that&#8217;s why they all slide up.</p>
<p>And that&#8217;s it! You got collapsing comments! Enjoy!</p>
<div class="source_img">
	<a href="http://xcodetuts.com/wp-content/uploads/2008/08/source-files.zip" target="_blank"><img src="http://xcodetuts.com/images/download.gif" alt="" /></a><a href="http://demo.xcodetuts.com/making-wordpress-comments-collapsable-using-jquery" target="_blank"><img src="http://xcodetuts.com/images/demo.gif" alt="" /></a></p>
<div class="clear"></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://xcodetuts.com/javascript-ajax/making-wordpress-comments-collapsable-using-jquery/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Best of the Web - August</title>
		<link>http://xcodetuts.com/web-roundups/best-of-the-web-august/</link>
		<comments>http://xcodetuts.com/web-roundups/best-of-the-web-august/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 14:26:02 +0000</pubDate>
		<dc:creator>Headshot</dc:creator>
		
		<category><![CDATA[Web Roundups]]></category>

		<category><![CDATA[Form Styling]]></category>

		<category><![CDATA[Frameworks]]></category>

		<category><![CDATA[Inspiration]]></category>

		<guid isPermaLink="false">http://xcodetuts.com/?p=8</guid>
		<description><![CDATA[Inspiration
There are a lot of places where you can find inspiration for a website design.
Ill like to show you some of my favorites!



Best Web Gallery
Best Web Gallery is one of most popular CSS Website galleries, they have unique content and a huge list of awesome looking websites! Its absolutely worth looking.
Visit Best Web Gallery


Faveup
If you [...]]]></description>
			<content:encoded><![CDATA[<h2>Inspiration</h2>
<p>There are a lot of places where you can find inspiration for a website design.<br />
Ill like to show you some of my favorites!</p>
<ul class="webroundup">
<li>
<div><img src="http://xcodetuts.com/wp-content/uploads/2008/08/bestwebgallery.gif" alt="" /></div>
<h3>Best Web Gallery</h3>
<p>Best Web Gallery is one of most popular CSS Website galleries, they have unique content and a huge list of awesome looking websites! Its absolutely worth looking.</p>
<p><a href="http://bestwebgallery.com/">Visit Best Web Gallery</a></li>
<li>
<div><img src="http://xcodetuts.com/wp-content/uploads/2008/08/favup.gif" alt="" /></div>
<h3>Faveup</h3>
<p>If you would like to see some more aweasome work, but not only websites this is the place to be. Faveup shows you Logo&#8217;s, Business Cards, Flash Websites and CSS Websites! Which you can give your personal rating!</p>
<p><a href="http://faveup.com/">Visit Faveup</a></li>
<li>
<div><img src="http://xcodetuts.com/wp-content/uploads/2008/08/inspirationking.gif" alt="" /></div>
<h3>InspirationKing</h3>
<p>Although this is another Web Site Gallery like Best Web Gallery, you will find allot of inspiring work that you wouldn&#8217;t find on other gallery&#8217;s! So don&#8217;t forget to visit them both!</p>
<p><a href="http://www.inspirationking.com/">Visit Inspiration King</a></li>
</ul>
<h2>Frameworks</h2>
<p>Of course you can code all your websites and apps line for line, but there are frameworks that could help you with that, and it would take you less time! I&#8217;m talking about frameworks, see some of the well known below.</p>
<ul class="webroundup">
<li>
<div><img src="http://xcodetuts.com/wp-content/uploads/2008/08/yaml.gif" alt="" /></div>
<h3>YAML</h3>
<p>YAML wich means &#8220;Yet Another Multicolumn Layout&#8221; an (X)HTML/CSS framework for creating modern and flexible floated layouts. The structure is extremely versatile in its programming and absolutely accessible for end users.</p>
<p><a href="http://www.yaml.de/en/">Visit YAML</a></li>
<li>
<div><img src="http://xcodetuts.com/wp-content/uploads/2008/08/jquery.gif" alt="" /></div>
<h3>jQuery</h3>
<p>jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. We will show you some great jQuery tutorials soon!</p>
<p><a href="http://jquery.com/">Visit jQuery</a></li>
<li>
<div><img src="http://xcodetuts.com/wp-content/uploads/2008/08/zend.gif" alt="" /></div>
<h3>Zend</h3>
<p>Extending the art &amp; spirit of PHP, Zend Framework is based on simplicity, object-oriented best practices, corporate friendly licensing, and a rigorously tested agile codebase. Zend Framework is focused on building more secure, reliable, and modern Web 2.0 applications &amp; web services.</p>
<p><a href="http://framework.zend.com/">Visit Zend</a></li>
<li>
<div><img src="http://xcodetuts.com/wp-content/uploads/2008/08/mootools.gif" alt="" /></div>
<h3>MooTools</h3>
<p>MooTools is a compact, modular, Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write powerful, flexible, and cross-browser code with its elegant, well documented, and coherent API.</p>
<p><a href="http://mootools.net/">Visit MooTools</a></li>
</ul>
<h2>Form Styling</h2>
<p>Form styling isn&#8217;t always easy, your form will look different in every browser and some nice JavaScript effects will work in the latest browsers but not in the old ones. Tables are common used for for styling, although this method works OK, styling your forms using CSS only will give you much nicer results!</p>
<ul class="webroundup">
<li>
<div><img src="http://xcodetuts.com/wp-content/uploads/2008/08/form1.gif" alt="" /></div>
<h3>40+ CSS/JS Styling and Functionality Techniques</h3>
<p>This is a great article about different form styling techniques, using the latest JavaScript Frameworks and some great CSS techniques. So check it out and will learn something about effective web forms for sure!</p>
<p><a href="http://www.noupe.com/css/form-elements-40-cssjs-styling-and-functionality-techniques.html">Visit Article</a></li>
<li>
<div><img src="http://xcodetuts.com/wp-content/uploads/2008/08/sitepoint.gif" alt="" /></div>
<h3>Fancy Form Design Using CSS</h3>
<p>SitePoint is known for its good books, but also for there articles, in this amazing 7 page long tutorial, Cameron Adams will explain you how to build great looking forms using CSS and no tables! This will increase you form styling knowledge dramatically!</p>
<p><a href="http://www.sitepoint.com/article/fancy-form-design-css">Visit Article</a></li>
<li>
<div><img src="http://xcodetuts.com/wp-content/uploads/2008/08/smashing.gif" alt="" /></div>
<h3>Web Form Design - Sign up Forms</h3>
<p>If you have been wondering how a sign up form should look like and how not. This article will give you the answer for that, because the users voted on what they think is necessary in a sign up form.<br />
So it will show you allot of statistics and examples of websites.</p>
<p><a href="http://www.smashingmagazine.com/2008/07/04/web-form-design-patterns-sign-up-forms/">Visit Article</a></li>
</ul>
<h3>The End!</h3>
<p>And that&#8217;s the Best of the Web for this month!<br />
I hope you enjoyed this article, and if you did please promote it by pressing the promote links below!<br />
See you next time at xcodetuts.com</p>
]]></content:encoded>
			<wfw:commentRss>http://xcodetuts.com/web-roundups/best-of-the-web-august/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
