<?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>Del Harvey - Developer</title>
	<atom:link href="http://lotsofcode.com/feed" rel="self" type="application/rss+xml" />
	<link>http://lotsofcode.com</link>
	<description>Lots of Code</description>
	<lastBuildDate>Thu, 27 Oct 2011 19:07:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>PHP Tag cloud</title>
		<link>http://lotsofcode.com/php/tag-cloud.htm</link>
		<comments>http://lotsofcode.com/php/tag-cloud.htm#comments</comments>
		<pubDate>Sun, 20 Feb 2011 18:46:08 +0000</pubDate>
		<dc:creator>lotsofcode</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[tags]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.lotsofcode.com/?p=142</guid>
		<description><![CDATA[Generate your own tag cloud with this easy to use PHP class. A tag cloud is typically used to describe the content of web sites. Many customisable features.]]></description>
			<content:encoded><![CDATA[<p>Generate your own tag cloud with this easy to use PHP class, simply include the class, instantiate a new object and then push your words into the cloud and voila, you have a tag cloud.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
require_once 'classes/wordcloud.class.php';
$cloud = new wordCloud();
$cloud-&gt;addWord('php'); // Basic Method of Adding Keyword
$cloud-&gt;addWord(array('word' =&gt; 'google', 'url' =&gt; 'http://www.google.com')); // Advanced user method
$cloud-&gt;addString('List of words i would like to include');
$cloud-&gt;addWords('hello','world','how','are','foo','bar');
echo $cloud-&gt;showCloud();
?&gt;
</pre>
<p>The clouds default ordering is by random, if you wanted to order the cloud by size or word from largest to smallest, this can be done as follows.</p>
<pre class="brush: php; title: ; notranslate">
$cloud-&gt;orderBy('size','desc');
</pre>
<p>As mentioned above, you can arbitrarily add custom tags to pass through the tag cloud generator for use later on in your code. If you wanted to colour code the tags based on word, you could do the following.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
$cloud = new wordCloud();
$cloud-&gt;addWord(array('word' =&gt; 'php', 'size' =&gt; 1, 'url' =&gt; 'http://www.php.net', 'colour' =&gt; '#FF0000'));
$cloud-&gt;addWord(array('word' =&gt; 'google', 'size' =&gt; 2, 'url' =&gt; 'http://www.google.com', 'colour' =&gt; '#00FF00'));
$cloud-&gt;addWord(array('word' =&gt; 'digg', 'size' =&gt; 3, 'url' =&gt; 'http://digg.com', 'colour' =&gt; '#0000FF'));
$cloud-&gt;addWord(array('word' =&gt; 'lotsofcode', 'size' =&gt; 4, 'url' =&gt; 'http://www.lotsofcode.com', 'colour' =&gt; '#FFFF00'));
$myCloud = $cloud-&gt;showCloud('array');
foreach ($myCloud as $cloudArray) {
  echo ' &amp;nbsp; &lt;a href=&quot;'.$cloudArray['url'].'&quot; style=&quot;color: '.$cloudArray['colour'].';&quot; class=&quot;word size'.$cloudArray['range'].'&quot;&gt;'.$cloudArray['word'].'&lt;/a&gt; &amp;nbsp;';
}
?&gt;
</pre>
<p>The above examples show the tag cloud wrapper is completly cusomisable and can be used in lots of different ways.</p>
<p>Not only can you generate a tag cloud, but you can customise the output if required to pass any information you like, such as href, link colours and more, check out the demo for more details on this.</p>
<p>Some of the features that are available are:<br />
    * Link and URL Assignment<br />
    * Additional attribute assignment e.g. title etc<br />
    * Add styles and colour options to each tag<br />
    * Set a limit to the amount of tags that are displayed<br />
    * String to cloud, parse a single string into a tag cloud instantly<br />
    * Ignore list, to remove particular words from the cloud. e.g. and, the, it, i<br />
    * Ordering by a selective field. e.g. word, size, colour<br />
    * Parse an argument seperated list of words<br />
    * add a string with a custom seperator<br />
    * format of word output. (Customise upper/lowercase words &amp; set trimming of words. Single word and multi-word customisation.)</p>
<p>Within the demo, i have provided:<br />
    * Examples of intergrating with a MySQL Database<br />
    * Examples of intergrating with a Flat Text File</p>
<p><strong>Tag cloud background info</strong></p>
<p>Originally i created a tag cloud script and wrote up a tutorial on how to create one yourself, this was quite well received and from there i developed a newer version of the code base with lots more features, because this wasn't very well publicised, the original page that sat here was visited on many occasions with the same questions being asked over again about bugs and features etc. So what i have done is divided the old pages into a seperate url so that they can all be referenced if needed but are all pointed to this article for the most up to date versions of the code.</p>
<p>You can view the original <a href="/php/tag-cloud-v1.htm" target="_blank">tag cloud tutorial here</a>.<br />
For legacy, here is the <a href="/php/tag-cloud-v2.htm" target="_blank">original v2 of the script here</a>.</p>
<p><strong>Bugs fixed</strong><br />
- setLimit didn't work. (20/02/11)<br />
- Removed words get removed if limit applied. (20/02/11)<br />
- Bracket conversion of percentage adjusted to show smaller sizes on less frequent words. (20/02/11)</p>
]]></content:encoded>
			<wfw:commentRss>http://lotsofcode.com/php/tag-cloud.htm/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MySQL derived temporary table &amp; sub query alias conditional</title>
		<link>http://lotsofcode.com/sql/derived-table-sub-query-alias-conditional.htm</link>
		<comments>http://lotsofcode.com/sql/derived-table-sub-query-alias-conditional.htm#comments</comments>
		<pubDate>Tue, 07 Sep 2010 05:37:33 +0000</pubDate>
		<dc:creator>lotsofcode</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.lotsofcode.com/?p=99</guid>
		<description><![CDATA[In SQL, you cannot use a column alias in the where clause that's been defined in the select clause, for example an alias created by a sub-select. Today i discovered a derived temporary table workaround, this creates a table with my select statement and this allows me to use the alias with a conditional statement. [...]]]></description>
			<content:encoded><![CDATA[<p>In SQL, you cannot use a column alias in the where clause that's been defined in the select clause, for example an alias created by a sub-select. </p>
<p>Today i discovered a derived temporary table workaround, this creates a table with my select statement and this allows me to use the alias with a conditional statement.</p>
<p>For example, i wanted to use the COUNT() aggregate function to return the amount of posts assigned to a blog.</p>
<p>So my query was something like ....</p>
<pre class="brush: sql; title: ; notranslate">SELECT b.*, (SELECT count(id) FROM posts p where b.id=p.blogId) as myCount FROM blogs b;</pre>
<p>This will return all the fields from the blogs table and a count of all the associated posts.</p>
<p>However, some of these categories may not have posts assigned to them and i can't use the alias in the conditional statement.</p>
<p>The workaround i found was to use the following, create a temporary table from the original result set so that you can use a conditional statement with the result fields returned. </p>
<pre class="brush: sql; title: ; notranslate">SELECT * FROM ([PASTE ORIGINAL QUERY HERE]) AS myDerivedTable WHERE myCount &gt; 0</pre>
<p>I have used "myDerivedTable" as my table name, but this can be any name you choose.</p>
<p>After adding my original query, this is how the full length query would look.</p>
<pre class="brush: sql; title: ; notranslate">SELECT * FROM (SELECT b.*, (SELECT count(id) FROM posts p where b.id=p.blogId) as myCount FROM blogs b) AS myDerivedTable WHERE myCount &gt; 0</pre>
<p>This will only return results that have the myCount alias > 0.</p>
<p>I haven't really looked into the negative impact in using this technique, but for the small scale website it has been used for it was an ideal solution. </p>
]]></content:encoded>
			<wfw:commentRss>http://lotsofcode.com/sql/derived-table-sub-query-alias-conditional.htm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Call of Duty Ratio Calculator</title>
		<link>http://lotsofcode.com/blog/callofduty-ratio-calculator.htm</link>
		<comments>http://lotsofcode.com/blog/callofduty-ratio-calculator.htm#comments</comments>
		<pubDate>Sun, 05 Sep 2010 12:42:39 +0000</pubDate>
		<dc:creator>lotsofcode</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.lotsofcode.com/?p=94</guid>
		<description><![CDATA[This is something i wrote a long time ago for a buddy of mine, he wanted a way to calculate the K/D ratio for the Call of Duty game. This was so he knew what he needed to reach a higher ratio. This is something he still finds useful so i wanted to share this [...]]]></description>
			<content:encoded><![CDATA[<p>This is something i wrote a long time ago for a buddy of mine, he wanted a way to calculate the K/D ratio for the Call of Duty game. This was so he knew what he needed to reach a higher ratio. This is something he still finds useful so i wanted to share this with everyone and make it a little more available to the Call of Duty community as this will still be useful when the new Black Ops game arrives.</p>
<p>I remember when i first wrote this, I suggested i could write a quick script to generate a list of results, so he could look ahead and undersand what he needed to gain a better ratio at Call of Duty.</p>
<p>If you find any bugs etc, please comment below and i'll take a look into them. It's not a perfect script, i know that much!</p>
]]></content:encoded>
			<wfw:commentRss>http://lotsofcode.com/blog/callofduty-ratio-calculator.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backing up a mysql table, using SQL.</title>
		<link>http://lotsofcode.com/sql/how-to-backup-a-mysql-table.htm</link>
		<comments>http://lotsofcode.com/sql/how-to-backup-a-mysql-table.htm#comments</comments>
		<pubDate>Thu, 25 Sep 2008 05:18:24 +0000</pubDate>
		<dc:creator>lotsofcode</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.lotsofcode.com/?p=67</guid>
		<description><![CDATA[Today i found a nice and simple way of backing up a mysql table without renaming / exporting. The technique i found creates a new table with the same structure and copy across the data for the current table, sounds simple and it is, take a look at the following. Simply replace the [NEW_TABLE] and [...]]]></description>
			<content:encoded><![CDATA[<p>Today i found a nice and simple way of backing up a mysql table without renaming / exporting. The technique i found creates a new table with the same structure and copy across the data for the current table, sounds simple and it is, take a look at the following. </p>
<pre class="brush: sql; title: ; notranslate">CREATE TABLE [NEW_TABLE] LIKE [OLD_TABLE];
INSERT INTO [NEW_TABLE] SELECT * FROM [OLD_TABLE];</pre>
<p>Simply replace the [NEW_TABLE] and [OLD_TABLE] placeholders with your new and current table names. For example:</p>
<pre class="brush: sql; title: ; notranslate">CREATE TABLE products_backup LIKE products;
INSERT INTO products_backup SELECT * FROM products;</pre>
<p>This will create the table and maintain any indexes / keys etc and it's by far the most efficient way I have found. </p>
<p>I hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://lotsofcode.com/sql/how-to-backup-a-mysql-table.htm/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Three Columns with Header, Menu and Footer</title>
		<link>http://lotsofcode.com/css/three-columns-with-header-menu-and-footer.htm</link>
		<comments>http://lotsofcode.com/css/three-columns-with-header-menu-and-footer.htm#comments</comments>
		<pubDate>Tue, 25 Mar 2008 20:41:37 +0000</pubDate>
		<dc:creator>lotsofcode</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Templates]]></category>

		<guid isPermaLink="false">http://www.lotsofcode.com/uncategorized/three-columns-with-header-menu-and-footer.htm</guid>
		<description><![CDATA[Simple template for inclusion into your website.]]></description>
			<content:encoded><![CDATA[<p>Simple template for inclusion into your website.</p>
<p><a href="http://www.lotsofcode.com/wp-content/uploads/2008/03/css-template1.jpg"><img class="alignnone size-medium wp-image-55" title="css-template1" src="http://www.lotsofcode.com/wp-content/uploads/2008/03/css-template1-300x133.jpg" alt="" width="300" height="133" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://lotsofcode.com/css/three-columns-with-header-menu-and-footer.htm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simple Smarty Pagination</title>
		<link>http://lotsofcode.com/php/smarty-pagination.htm</link>
		<comments>http://lotsofcode.com/php/smarty-pagination.htm#comments</comments>
		<pubDate>Mon, 24 Mar 2008 02:45:27 +0000</pubDate>
		<dc:creator>lotsofcode</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Smarty]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.lotsofcode.com/uncategorized/smarty-pagination.htm</guid>
		<description><![CDATA[With the combined effort of my PHP Array Pagination script and this tutorial you will be able to pagination results (database &#38; non database driven results) and intergrate it easily with the smarty template engine. So, to start download the PHP Pagination script and then put it into a directory within your smarty setup. During [...]]]></description>
			<content:encoded><![CDATA[<p> With the combined effort of my <a href="http://www.lotsofcode.com/php/php-array-pagination.htm">PHP Array Pagination</a> script and this tutorial you will be able to pagination results (database &amp; non database driven results) and intergrate it easily with the smarty template engine.</p>
<p>So, to start <a href="http://www.lotsofcode.com/download/php-array-pagination.zip">download the PHP Pagination</a> script and then put it into a directory within your smarty setup.</p>
<p>During this example i am going to be using some test data, a basic PHP array with 10 sub array's, like so:</p>
<blockquote><p>$myArray = array(<br />
array('id' = &gt; 1, 'title' =&gt; 'Test Item 1'),<br />
array('id' = &gt; 2, 'title' =&gt; 'Test Item 2'),<br />
array('id' = &gt; 3, 'title' =&gt; 'Test Item 3'),<br />
array('id' = &gt; 4, 'title' =&gt; 'Test Item 4'),<br />
array('id' = &gt; 5, 'title' =&gt; 'Test Item 5'),<br />
array('id' = &gt; 6, 'title' =&gt; 'Test Item 6'),<br />
array('id' = &gt; 7, 'title' =&gt; 'Test Item 7'),<br />
array('id' = &gt; 8, 'title' =&gt; 'Test Item 8'),<br />
array('id' = &gt; 9, 'title' =&gt; 'Test Item 9'),<br />
array('id' = &gt; 10, 'title' =&gt; 'Test Item 10'),<br />
);</p></blockquote>
<p>Then assign the pagination class to an object called pagination and assign the array and the amount of page numbers and assign this information into the smarty template vars, one for the listing of the items and another for the actual pagination.</p>
<blockquote><p>$pagination = new pagination();<br />
$myArray = $pagination-&gt;generate($myArray, 10);<br />
$smarty-&gt;assign('listing', $myArray);<br />
$smarty-&gt;assign('pagination', $pagination-&gt;links());</p></blockquote>
<p>Then go into the template side of your setup and add the following code</p>
<blockquote><p>{if !empty($listing)}<br />
{if !empty($pagination)}<br />
&lt;div class="pagination"&gt;{$pagination}&lt;/div&gt;<br />
{/if}<br />
{foreach item="item" from="$listing"}<br />
&lt;tr&gt;<br />
&lt;td&gt;{$item.id}&lt;/td&gt;<br />
&lt;td&gt;{$item.title}&lt;/td&gt;<br />
{/foreach}<br />
{/if}</p></blockquote>
<p>It's a pretty quick and simple solution to get you going as a beginner, good luck!</p>
<p>One of the main issues i found with using the smarty template engine is that there isn't enough documentation online!</p>
]]></content:encoded>
			<wfw:commentRss>http://lotsofcode.com/php/smarty-pagination.htm/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Simple Modular Arithmetic with Smarty Template Engine</title>
		<link>http://lotsofcode.com/php/simple-modular-arithmetic-with-smarty-template-engine.htm</link>
		<comments>http://lotsofcode.com/php/simple-modular-arithmetic-with-smarty-template-engine.htm#comments</comments>
		<pubDate>Mon, 24 Mar 2008 02:37:12 +0000</pubDate>
		<dc:creator>lotsofcode</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Smarty]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.lotsofcode.com/uncategorized/simple-modular-arithmetic-with-smarty-template-engine.htm</guid>
		<description><![CDATA[Something i take for granted in PHP is the use of Modular Arithmetic when display results in a grid like format. Usually in php, i would do something like this to display three items per row if ($count % 3 == 0) { // Add Break / Clear here } So i assumed something like [...]]]></description>
			<content:encoded><![CDATA[<p>Something i take for granted in PHP is the use of Modular Arithmetic when display results in a grid like format.</p>
<p>Usually in php, i would do something like this to display three items per row</p>
<blockquote><p>if ($count % 3 == 0) {</p>
<p>// Add Break / Clear here</p>
<p>}</p></blockquote>
<p>So i assumed something like this would be available in smarty. After googling for a while i found a couple of solutions to this, however none of them were as simple as the PHP code above, so by playing about with the Smarty Template Engine, i managed to figure out a nice simple way, and here it is.</p>
<blockquote><p>{assign var="mycount" value="1"}  {*Initiate the mycount variable*}<br />
{if $mycount++ % 3 == 0}  {*Simular syntax to the above*}<br />
// Add Break / Clear here<br />
{/if}</p></blockquote>
<p>So, as i found this so useful for displaying products on a current project, i thought it would be something other would really like to know about.</p>
]]></content:encoded>
			<wfw:commentRss>http://lotsofcode.com/php/simple-modular-arithmetic-with-smarty-template-engine.htm/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery &#8211; Skinning HTML Select Boxes</title>
		<link>http://lotsofcode.com/javascript-and-ajax/jquery-select-box-skin.htm</link>
		<comments>http://lotsofcode.com/javascript-and-ajax/jquery-select-box-skin.htm#comments</comments>
		<pubDate>Thu, 20 Mar 2008 00:51:27 +0000</pubDate>
		<dc:creator>lotsofcode</dc:creator>
				<category><![CDATA[Javascript & AJAX]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.lotsofcode.com/javascript-and-ajax/jquery-select-box-skin.htm</guid>
		<description><![CDATA[Had enough of the same old operating system based select field style? Why not skin it up, this script allows you to apply a skin to a select box. This tutorial is based on the original code i wrote, however this version is less buggier and has support for non JS enabled browsers! Nice and [...]]]></description>
			<content:encoded><![CDATA[<p>Had enough of the same old operating system based select field style? Why not skin it up, this script allows you to apply a skin to a select box.</p>
<p>This tutorial is based on the <a href="http://www.lotsofcode.com/css/adding-a-skin-to-html-select-boxes.htm">original code</a> i wrote, however this version is less buggier and has support for non JS enabled browsers!</p>
<p>Nice and simple to install, include the jQuery library and the select skin JS file and the CSS file like so.</p>
<blockquote><p>&lt;style&gt;<br />
&lt;!--<br />
@import url('./css/skinned-select.css');<br />
//--&gt;<br />
&lt;/style&gt;<br />
&lt;script src="./js/jquery.js" type="text/javascript"&gt;&lt;/script&gt;<br />
&lt;script src="./js/jquery.skinned-select.js" type="text/javascript"&gt;&lt;/script&gt;</p></blockquote>
<p>Then just wrap a div with the class name of 'my-skinnable-select' around the select box, like so.</p>
<blockquote><p> &lt;div class="my-skinnable-select"&gt;<br />
&lt;select name="name"&gt;<br />
&lt;option value="1"&gt;One&lt;/option&gt;<br />
&lt;option value="2"&gt;Two&lt;/option&gt;<br />
&lt;option value="3"&gt;Three&lt;/option&gt;<br />
&lt;option value="4"&gt;Four&lt;/option&gt;<br />
&lt;option value="5"&gt;Five&lt;/option&gt;<br />
&lt;/select&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>The form variables can be posted as usual, it's as easy as that, enjoy!</p>
<p>Please take a look at the demo or download the code and let me know what you think by using the contact form below.</p>
<p><strong>Please note: </strong> I wrote this over 2 years ago, a french dude re-wrote this as a <a href="http://www.verot.net/jquery_select_skin.htm">jQuery plugin</a>. It's a pretty awesome implementation, go check it out!</p>
]]></content:encoded>
			<wfw:commentRss>http://lotsofcode.com/javascript-and-ajax/jquery-select-box-skin.htm/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>jQuery for beginners</title>
		<link>http://lotsofcode.com/javascript-and-ajax/jquery-for-beginners.htm</link>
		<comments>http://lotsofcode.com/javascript-and-ajax/jquery-for-beginners.htm#comments</comments>
		<pubDate>Sun, 16 Mar 2008 22:21:07 +0000</pubDate>
		<dc:creator>lotsofcode</dc:creator>
				<category><![CDATA[Javascript & AJAX]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[xHTML]]></category>

		<guid isPermaLink="false">http://www.lotsofcode.com/javascript-and-ajax/jquery-for-beginners.htm</guid>
		<description><![CDATA[This is a little tutorial i put together to help people starting out with jQuery to learn the basics. So, first things first. Pop over to http://docs.jquery.com/Downloading_jQuery and download the latest version in whatever form you prefer, Minified, Packed or Uncompressed. If you are not fussed then i would suggest the packed version. No, the [...]]]></description>
			<content:encoded><![CDATA[<p>This is a little tutorial i put together to help people starting out with jQuery to learn the basics.</p>
<p>So, first things first. Pop over to <a href="http://docs.jquery.com/Downloading_jQuery">http://docs.jquery.com/Downloading_jQuery</a> and download the latest version in whatever form you prefer, Minified, Packed or Uncompressed. If you are not fussed then i would suggest the packed version.</p>
<p>No, the first thing you should do is create a specific testing area, for example c:jquery. Then in that folder extract the jquery file into it, if the name of the js file isn't jquery then i would suggest you rename it to jquery.js to make the name of the file nice and easy to remember.</p>
<p>Now, on to the html.</p>
<p>Create a file, with whatever name you prefer, i will call mine 'myfirstjquery.htm' in that file i have created basic html as follows, i have also included</p>
<p>the jquery js file.</p>
<blockquote><p>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;My First jQuery Script with lotsofcode.com&lt;/title&gt;<br />
&lt;script src="jquery.js"&gt;&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>Now that we have the basic html we can start adding some Javascript.</p>
<p>Next, create a new div and assign an id to the div like so.</p>
<blockquote><p>&lt;div id="hello-lotsofcode"&gt;Hello LotsofCode&lt;/div&gt;</p></blockquote>
<p>Now, save the file, open it with a web browser and you should have a basic html page with the text 'hello Go back to your text editor and add the following</p>
<p>code to inbetween the opening and closing head tags.</p>
<blockquote><p>&lt;script&gt;<br />
$(document).ready(<br />
function() {<br />
// Code to be executed goes here ...<br />
}<br />
);<br />
&lt;/script&gt;</p></blockquote>
<p>Everything that is called by jQuery needs to be wrapped in this loader above.</p>
<p>Now, to call the element we just created we simply use a CSS style declaration to call the element like so.</p>
<blockquote><p>&lt;script&gt;<br />
$(document).ready(<br />
function() {<br />
alert( $('#hello-lotsofcode').text() );<br />
}<br />
);<br />
&lt;/script&gt;</p></blockquote>
<p>This should present you with an alert box with the words 'hello LotsofCode', now, we can change the text value by using a simular method like so</p>
<blockquote><p>&lt;script&gt;<br />
$(document).ready(<br />
function() {<br />
$('#hello-lotsofcode').text('Hello from the visitor');<br />
}<br />
);<br />
&lt;/script&gt;</p></blockquote>
<p>Now, when you execute this code, you should see that your div has the content of hello from the visitor, this is because we used the method text with a value and assigned it to the id hello-lotsofcode element, it's pretty simple isn't it!</p>
<p>Now, to hide and display elements:</p>
<blockquote><p>&lt;script&gt;<br />
$(document).ready(<br />
function() {<br />
$('#hello-lotsofcode').text('Hello from the visitor').hide();<br />
}<br />
);<br />
&lt;/script&gt;</p></blockquote>
<p>And to show ...</p>
<blockquote><p>&lt;script&gt;<br />
$(document).ready(<br />
function() {<br />
$('#hello-lotsofcode').text('Hello from the visitor').show();<br />
}<br />
);<br />
&lt;/script&gt;</p></blockquote>
<p>The two above methods don't mean much on there own, but with an event handler we can have some fun.</p>
<p>So at the top of the page add two anchor links.</p>
<blockquote><p>&lt;a href="#" class="hide-text"&gt;Hide Text&lt;/a&gt;<br />
&lt;a href="#" class="show-text"&gt;Show Text&lt;/a&gt;</p></blockquote>
<p>Then the jQuery code for this is as follows:</p>
<blockquote><p>&lt;script&gt;<br />
$(document).ready(<br />
function() {<br />
$('.hide-text').click(<br />
function() {<br />
$('#hello-lotsofcode').text('Hello from the visitor').hide();<br />
}<br />
);<br />
$('.show-text').click(<br />
function() {<br />
$('#hello-lotsofcode').text('Hello from the visitor').show();<br />
}<br />
);<br />
}<br />
);<br />
&lt;/script&gt;</p></blockquote>
<p>Nice results eh ... ? You can easily hide anddisplay elements on the page.</p>
<p>I did say this tutorial was for beginners and it is,  i have emphasized on this because now i am going to show you some basic effects and i don't want you to assume they are going to be really complicated.</p>
<p>So, while working with the same file, we can add a nice fading effect to go along with our new text, like so:</p>
<blockquote><p>&lt;script&gt;<br />
$(document).ready(<br />
function() {<br />
$('#hello-lotsofcode').text('Hello from the visitor').hide().fadeIn('slow');<br />
}<br />
);<br />
&lt;/script&gt;</p></blockquote>
<p>Note the chainability, all i have added is '.hide().fadeIn('slow')' to the end of the string so we hide the element and then immediately after we fade it in, take a look at the results.</p>
]]></content:encoded>
			<wfw:commentRss>http://lotsofcode.com/javascript-and-ajax/jquery-for-beginners.htm/feed</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>WordPress TinyMCE Image Upload Plugin</title>
		<link>http://lotsofcode.com/javascript-and-ajax/wordpress-tinymce-image-upload-plugin.htm</link>
		<comments>http://lotsofcode.com/javascript-and-ajax/wordpress-tinymce-image-upload-plugin.htm#comments</comments>
		<pubDate>Wed, 12 Mar 2008 22:01:39 +0000</pubDate>
		<dc:creator>lotsofcode</dc:creator>
				<category><![CDATA[Javascript & AJAX]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.lotsofcode.com/javascript-and-ajax/wordpress-tinymce-image-upload-plugin.htm</guid>
		<description><![CDATA[After many hours looking and looking for a plugin for TinyMCE i finally found one that actually worked quite well and was what it said it is .. An actual image upload plugin for WordPress's TinyMCE ... ! Take a look here: http://www.soderlind.no/archives/2006/01/03/imagemanager-20/ Download here: http://www.soderlind.no/download/ImageManager2.41.zip I know someone will really appreciate this post as [...]]]></description>
			<content:encoded><![CDATA[<p>After many hours looking and looking for a plugin for TinyMCE i finally found one that actually worked quite well and was what it said it is ..  An actual image upload plugin for WordPress's TinyMCE ... !</p>
<p>Take a look here: <a href="http://www.soderlind.no/archives/2006/01/03/imagemanager-20/">http://www.soderlind.no/archives/2006/01/03/imagemanager-20/</a></p>
<p><a href="http://www.lotsofcode.com/wp-content/uploads/Untitled_1.gif" onclick="ps_imagemanager_popup(this.href,'Untitled_1.gif','1006','582');return false" onfocus="this.blur()"><img src="http://www.lotsofcode.com/wp-content/uploads/.thumbs/tmb_Untitled_1.gif" alt="Untitled_1.gif" title="Untitled_1.gif" border="0" height="96" width="166" /></a></p>
<p>Download here: <a href="http://www.soderlind.no/download/ImageManager2.41.zip">http://www.soderlind.no/download/ImageManager2.41.zip</a></p>
<p>I know someone will really appreciate this post as i would appreciate someone else posting a link to such a great resourse, if anyone knows of any other open source / free plugins for TinyMCE please post here.</p>
<p>If PHP safe_mode is enabled on server you may find problems with thumbnails ...</p>
]]></content:encoded>
			<wfw:commentRss>http://lotsofcode.com/javascript-and-ajax/wordpress-tinymce-image-upload-plugin.htm/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

