<?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"
	>

<channel>
	<title>dawnerd</title>
	<atom:link href="http://dawnerd.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dawnerd.com</link>
	<description>CSS / PHP / XHTML</description>
	<pubDate>Wed, 10 Sep 2008 23:30:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>Quickly Creating Javascript Tooltips</title>
		<link>http://dawnerd.com/css/2008/08/24/quickly-creating-javascript-tooltips/</link>
		<comments>http://dawnerd.com/css/2008/08/24/quickly-creating-javascript-tooltips/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 11:05:11 +0000</pubDate>
		<dc:creator>dawnerd</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[HTML]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[interface design]]></category>

		<category><![CDATA[javascript html css tooltip]]></category>

		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://dawnerd.com/?p=53</guid>
		<description><![CDATA[I&#8217;ve noticed that a lot of sites do not use tooltips as much as they should. There are many places on a site where tooltips would really be nice. One example of using them correctly is TheSixtyOne. They use a nice tooltip when you are about to bump a song up. It quickly lets you [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve noticed that a lot of sites do not use tooltips as much as they should. There are many places on a site where tooltips would really be nice. One example of using them correctly is <a href="http://thesixtyone.com">TheSixtyOne</a>. They use a nice tooltip when you are about to bump a song up. It quickly lets you know how many points it will cost and how many times you have bumped it. This post will hopefully inspire at least one of you to use tooltips more often.</p>
<p>The solution I have decided to use is <a href="http://unitinteractive.com/labs/unitip.php">UniTip</a> from <a href="http://unitinteractive.com/">Unit Interactive</a>. I believe they have the best solution to quickly setting up tooltips. Download the zip they provide and we should be ready to go.<br />
<span id="more-53"></span><br />
First, the base html:</p>
<pre>
<code>&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Example tooltip&lt;/title&gt;
    &lt;script type="text/javascript" src="js/unitip.js"&gt;&lt;/script&gt;
    &lt;link href="css/unitip.css" rel="stylesheet" type="text/css"/&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;img src="awesomepic.jpg" alt="awesome" title="This pic is awesome" class="tooltip"/&gt;
  &lt;/body&gt;
&lt;/html&gt;</code>
</pre>
<p>Open up unitip.js and find the lines containing:</p>
<pre>
<code>var uniTipTag = "a,img";
var uniTipClass = "TipEx";</code>
</pre>
<p>Change this to:</p>
<pre>
<code>var uniTipTag = "img";
var uniTipClass = "tooltip";</code>
</pre>
<p>Now just run the html file and you should instantly have tooltips. If something doesn&#8217;t work, make sure your path to the css file and images are correct. In addition, it is suggested to use a PNG fix file for IE6. I recommend <a href="http://unitinteractive.com/labs/unitpngfix.php">Unit PNG Fix</a>. It&#8217;s super easy to use and works like a charm.</p>
<p>Please keep in mind that tooltips are really designed for items that really need them, extensive use is annoying. A common use is creating help tips for users completing a complex form. If there is some form of information a user could not understand, it is advisable to use a tooltip on the input box or the label.</p>
]]></content:encoded>
			<wfw:commentRss>http://dawnerd.com/css/2008/08/24/quickly-creating-javascript-tooltips/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New Look, Same Greatness</title>
		<link>http://dawnerd.com/css/2008/08/24/new-look-same-greatness/</link>
		<comments>http://dawnerd.com/css/2008/08/24/new-look-same-greatness/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 07:34:30 +0000</pubDate>
		<dc:creator>dawnerd</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[HTML]]></category>

		<category><![CDATA[wordpress layout blog design]]></category>

		<guid isPermaLink="false">http://dawnerd.com/?p=51</guid>
		<description><![CDATA[I decided that the old theme was too dark after getting a few messages about it. Hopefully this one will suit everyone. As you can tell, it is very simplistic. If you have any comments about this one, let me know right away. Oh and this was created completely by me, no pre-made themes this [...]]]></description>
			<content:encoded><![CDATA[<p>I decided that the old theme was too dark after getting a few messages about it. Hopefully this one will suit everyone. As you can tell, it is very simplistic. If you have any comments about this one, let me know right away. Oh and this was created completely by me, no pre-made themes this time.</p>
]]></content:encoded>
			<wfw:commentRss>http://dawnerd.com/css/2008/08/24/new-look-same-greatness/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Starting PHP: Looping Basics</title>
		<link>http://dawnerd.com/php/2008/08/14/starting-php-looping-basics/</link>
		<comments>http://dawnerd.com/php/2008/08/14/starting-php-looping-basics/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 03:06:41 +0000</pubDate>
		<dc:creator>dawnerd</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[basics]]></category>

		<category><![CDATA[loops]]></category>

		<guid isPermaLink="false">http://dawnerd.com/?p=33</guid>
		<description><![CDATA[I was searching the internet for PHP tutorials and quickly found out that the majority of are badly written, have errors in the example code, contain security holes, or are just outright outdated. This makes learning PHP hard for someone just starting out. The question I get a lot is about looping through arrays. 
The [...]]]></description>
			<content:encoded><![CDATA[<p>I was searching the internet for PHP tutorials and quickly found out that the majority of are badly written, have errors in the example code, contain security holes, or are just outright outdated. This makes learning PHP hard for someone just starting out. The question I get a lot is about looping through arrays. <span id="more-33"></span></p>
<p>The following are the three possible ways to loop through data, with an example showing how I use them.</p>
<p><strong>The While Loop</strong><br />
The while loop is useful when running loop on data with an unknown size; a database result for example. here&#8217;s an example:</p>
<pre>
<code>&lt;?php
$sql = "SELECT `userid` FROM `users`";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query))
{
     echo $row['userid'].'&lt;br/&gt;';
}
?&gt;</code>
</pre>
<p>The above example will continue to check $row to see if it returns false. Each call to <code>mysql_fetch_array()</code> will increment the key. If you ran <code>mysql_fetch_array()</code> outside of the loop, you would get a full array of all the results at once. For example:</p>
<pre>
<code>Array(
     0 =&gt; Array( 'userid' =&gt; 1),
     1 =&gt; Array( 'userid' =&gt; 2)
)</code>
</pre>
<p>In this case, you could simply call <code>$row[0]['userid']</code>. But again you don&#8217;t know how many results there are so hand coding all the different keys would be just silly.</p>
<p><strong>The For Loop</strong><br />
Just like a while loop, a for loop runs until the expression returns false. Example:</p>
<pre>
<code>&lt;?php
$array = array('copper','gold','silver');
for($i=0;$i&lt;count($array);$i++)
{
     echo $array[$i].'&lt;br/&gt;';
}
?&gt;</code>
</pre>
<p>For loops are probably the hardest types of loops for php beginners to grasp. The reason behind that is because of the expression used to keep the loop running. So what does <code>$i=0;$i&lt;count($array);$i++</code> mean? When the loop is first started, the variable <code>$i</code> is set to 0, which happens to be the first key in the <code>$array</code> variable. Next, it checks if the <code>$i</code> variable is less than the total number of items in the array. If the count is greater than <code>$i</code>, the loop continues. Lastly, <code>$i</code> is incremented after one each loop. So after the first run, <code>$i</code> becomes 1, rather than 0.</p>
<p>We have 3 items in the array, so in english, that loop would look like:</p>
<pre>
<code>i is zero.
if i less than three continue, otherwise break the loop.
add one to i.</code>
</pre>
<p>The <code>$i</code> variable is accessible anywhere in the loop. It may seem that <code>$i</code> is incremented before any code in the loop is processed, but in reality, it is incremented after the code has been executed.</p>
<p>For loops are also extremely fast for small sets of data. Just keep that in mind if all you have to do are small loops and getting the length of an array or number is no issue.</p>
<p><strong>The Foreach Loop</strong><br />
This last method of looping is my favorite; mostly because it&#8217;s easy to follow. Take for example:</p>
<pre>
<code>&lt;?php
$array = array('bob','joe','billy','rob');
foreach($array as $key =&gt; $value)
{
     echo $key.': '.$value.'&lt;br/&gt;';
}
?&gt;</code>
</pre>
<p>This will output:</p>
<pre>
<code>0: bob
1: joe
2: billy
3: rob</code>
</pre>
<p>The foreach loop takes each item in the array starting from the left and assigns it a key, or unique number; starting from 0. This is always the case. However, you can choose not to get the key of the current array item by not using the $key part of the foreach loop. Instead, the loop would look like:</p>
<pre>
<code>$array = array('bob','joe','billy','rob');
foreach($array as $value)
{
     echo $value.'&lt;br/&gt;';
}</code>
</pre>
<p>Now that you read this, the only way to make it stick is to put it to practice. If you need help trying to make something, here&#8217;s a script you should try to make on your own:</p>
<pre>
<code>Make an array of your favorite movies.
Each movie should contain the top 5 or more actors.
Make the script loop through and output each movie and the first three
actors, omitting any others.</code>
</pre>
<p>If you need a little kickstart here you go:</p>
<pre>
<code>&lt;?php
$movies = array(
                    array('The Matrix',
                         array('Keanu Reeves',
                              'Laurence Fishburne',
                              'Carrie-Anne Moss',
                              'Hugo Weaving
                          )
                     )
);</code>
</pre>
<p>Yes, you will need to nest the loops. I&#8217;m sure you can figure it out. Once you get this, I have a good feeling everything else will be a breeze.</p>
]]></content:encoded>
			<wfw:commentRss>http://dawnerd.com/php/2008/08/14/starting-php-looping-basics/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Open Source PHP Data Validation Class</title>
		<link>http://dawnerd.com/php/2008/08/07/open-source-php-data-validation-class/</link>
		<comments>http://dawnerd.com/php/2008/08/07/open-source-php-data-validation-class/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 01:32:55 +0000</pubDate>
		<dc:creator>dawnerd</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://dawnerd.com/?p=26</guid>
		<description><![CDATA[I have created a PHP5 class that handles all POST and GET variables. It performs almost all of the validations functions you could need. In addition, it makes accessing the variables very convenient.

Download here. Version 1.0
How To use:
First, include the class and initiate it:

&#60;?php
include("validation.class.php");
$validation = new Validation;
?&#62;

Optionally, you can use new Validation(false) to not parse [...]]]></description>
			<content:encoded><![CDATA[<p>I have created a PHP5 class that handles all POST and GET variables. It performs almost all of the validations functions you could need. In addition, it makes accessing the variables very convenient.<span id="more-26"></span><br />
<a href="http://labs.dawnerd.com/validation/validation-class.zip"><br />
Download here.</a> Version 1.0</p>
<p><strong>How To use:</strong><br />
First, include the class and initiate it:</p>
<pre>
<code>&lt;?php
include("validation.class.php");
$validation = new Validation;
?&gt;</code>
</pre>
<p><em>Optionally, you can use new Validation(false) to not parse all input data through the xss filter. This is not recommended.</em></p>
<p>Available functions are:</p>
<ul>
<li><code>xss($string)</code></li>
<li><code>email($string)</code></li>
<li><code>phone($string)</code></li>
<li><code>url($string)</code></li>
<li><code>db_prep($string)</code></li>
</ul>
<p>All of the above functions return a boolean value with the exception of <code>xss()</code> and <code>db_prep()</code>. Those two return a modified version of <code>$string</code>.</p>
<p>Here is an example of form validation:</p>
<pre>
<code>&lt;?php
$db_user = "";
$db_pass = "";
$db_serv = "";
$db_name = "";
include("../database/database.class.php");
$db = new Database($db_user,$db_pass,$db_serv,true);
if(!$db){die($db-&gt;getErrorMessage());}

include("validation.class.php");
$validation = new Validation;

echo "SELECT * FROM users WHERE user='".$validation-&gt;db_prep($validation-&gt;database_input)."'";
echo "&lt;br&gt;";

if($validation-&gt;email($validation-&gt;email)) echo "valid email";
else echo "not valid email";
echo "&lt;br&gt;";

if($validation-&gt;phone($validation-&gt;phone)) echo "valid phone";
else echo "not valid phone";
echo "&lt;br&gt;";

if($validation-&gt;url($validation-&gt;url)) echo "valid url";
else echo "not valid url";
echo "&lt;br&gt;";
?&gt;
&lt;form action="test.php" method="post"&gt;
	&lt;p&gt;database input: &lt;input type="text" name="database_input" id="database_input" value="&lt;?=$validation-&gt;database_input;?&gt;" /&gt;&lt;/p&gt;
    &lt;p&gt;email: &lt;input type="text" name="email" id="email" value="&lt;?=$validation-&gt;email;?&gt;" /&gt;&lt;/p&gt;
    &lt;p&gt;phone: &lt;input type="text" name="phone" id="phone" value="&lt;?=$validation-&gt;phone;?&gt;" /&gt;&lt;/p&gt;
    &lt;p&gt;url: &lt;input type="text" name="url" id="url" value="&lt;?=$validation-&gt;url;?&gt;" /&gt;&lt;/p&gt;
    &lt;p&gt;&lt;input type="submit" name="test" id="dtest" value="Test" /&gt;&lt;/p&gt;
&lt;/form&gt;</code>
</pre>
<p>A demo of the above test can be <a href="http://labs.dawnerd.com/validation/test.php">found here</a>.</p>
<p>As you can see from the example above, instead of calling <code>$_GET['username']</code>, you can now call <code>$validation-&gt;username</code> without worrying about the data being &#8216;dirty&#8217;.</p>
<p>If you need help using this class, post a comment and I will gladly help you out. Also remember that this class is licensed under the <a href="http://dawnerd.com/license/">Buy Me Dew License</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dawnerd.com/php/2008/08/07/open-source-php-data-validation-class/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Must see site: Rithum</title>
		<link>http://dawnerd.com/featured-sites/2008/07/12/must-see-site-rithum/</link>
		<comments>http://dawnerd.com/featured-sites/2008/07/12/must-see-site-rithum/#comments</comments>
		<pubDate>Sun, 13 Jul 2008 02:45:09 +0000</pubDate>
		<dc:creator>dawnerd</dc:creator>
		
		<category><![CDATA[Featured Sites]]></category>

		<category><![CDATA[rithum]]></category>

		<guid isPermaLink="false">http://dawnerd.com/?p=19</guid>
		<description><![CDATA[If you are a music fanatic, then you will be pleased to learn that the masterminds behind FlashFlashRevolution have launched another site called Rithum. Rithum is a music site built for musicians, featuring a custom built music player that bands can use as a replacement for the current myspace player. The music player itself is [...]]]></description>
			<content:encoded><![CDATA[<p>If you are a music fanatic, then you will be pleased to learn that the masterminds behind <a href="http://www.flashflashrevolution.com">FlashFlashRevolution</a> have launched another site called <a href="http://www.rithum.com">Rithum</a>. Rithum is a music site built for musicians, featuring a custom built music player that bands can use as a replacement for the current myspace player. The music player itself is remarkable as it support high quality audio and streaming video all in the same package.</p>
<p>That alone is not what makes Rithum amazing. The community is very open and welcome to newcomers. There are already a few big name bands on Rithum, such as: <a href="http://www.rithum.com/dashboardconfessional">Dashboard Confessional</a>, <a href="http://www.rithum.com/thrice">Thrice</a>, <a href="http://www.rithum.com/jakobdylan">Jakob Dylan</a>, <a href="http://www.rithum.com/acursivememory">and</a> <a href="http://www.rithum.com/thrivingivory">many</a> <a href="http://www.rithum.com/reggieandthefulleffect">many</a> <a href="http://www.rithum.com/PeopleinPlanes">more</a>. Rithum looks very promising, so it&#8217;s one you will want to keep an eye on. I know I will be.</p>
<p>Side note: I am still working on the next tutorial. It will be worth the wait.</p>
]]></content:encoded>
			<wfw:commentRss>http://dawnerd.com/featured-sites/2008/07/12/must-see-site-rithum/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
