<?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>Firstbyte Websites &#187; Code</title>
	<atom:link href="http://www.firstbyte.co.nz/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.firstbyte.co.nz</link>
	<description>For Website Design in Tauranga, Choose Firstbyte Websites</description>
	<lastBuildDate>Sun, 22 Jan 2012 07:37:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How To Reverse The Order Of An Ordered List</title>
		<link>http://www.firstbyte.co.nz/2010/04/how-to-reverse-the-order-of-an-ordered-list/</link>
		<comments>http://www.firstbyte.co.nz/2010/04/how-to-reverse-the-order-of-an-ordered-list/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 21:44:37 +0000</pubDate>
		<dc:creator>Sheldon Nesdale</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[li]]></category>
		<category><![CDATA[ol]]></category>
		<category><![CDATA[ordered list]]></category>
		<category><![CDATA[reverse order]]></category>
		<category><![CDATA[ul]]></category>

		<guid isPermaLink="false">http://www.firstbyte.co.nz/?p=148</guid>
		<description><![CDATA[A client of mine has a huge list of testimonials (more than 50), and rather than counting down the list, it was appropriate to number them backwards so the latest testimonial (in this case, #51) is at the top of the list and numbered #51 rather than #1 (which wouldn&#8217;t make much sense). The End [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p></p><p>A client of mine has a huge list of testimonials (more than 50), and rather than counting down the list, it was appropriate to number them backwards so the latest testimonial (in this case, #51) is at the top of the list and numbered #51 rather than #1 (which wouldn&#8217;t make much sense).</p>
<a name="The+End+Result%3A+Reversed+Order+for+the+Ordered+List"></a><h3>The End Result: Reversed Order for the Ordered List</h3>
<div id="attachment_149" class="wp-caption alignnone" style="width: 424px">
	<img class="size-full wp-image-149" title="reverse-order-of-ordered-list" src="http://www.firstbyte.co.nz/wp-content/uploads/2010/04/reverse-order-of-ordered-list.png" alt="End result: Reversed Order for the Ordered List" width="424" height="340" />
	<p class="wp-caption-text">End Result: Reversed Order for the Ordered List</p>
</div>
<p>Here&#8217;s what the html code looks like:</p>
<blockquote>
<pre>&lt;li value="51"&gt;Andrew Martin&lt;/li&gt;
&lt;li value="50"&gt;Carlene Sykes&lt;/li&gt;
&lt;li value="49"&gt;Lee Clifford&lt;/li&gt;
&lt;li value="48"&gt;Debrah Breedt&lt;/li&gt;
&lt;li value="47"&gt;Gina Sterling&lt;/li&gt;
</pre>
</blockquote>
<p>Because this testimonial page uses PHP I was able to do this dynamically in the code in 3 steps:</p>
<p>1. Set the start value by counting the total number of testimonials:</p>
<blockquote>
<pre>$result = mysql_query("SELECT * FROM testimonials");
$testimonial_number = mysql_num_rows($result);
</pre>
</blockquote>
<p>2. Then set the li value with this variable</p>
<blockquote>
<pre>&lt;li value="$testimonial_number"&gt;$student_name&lt;/li&gt;</pre>
</blockquote>
<p>3. Finally, subtract 1 from the counter</p>
<blockquote>
<pre>$testimonial_number--;</pre>
</blockquote>
<p>Clever huh?</p>
<p>I made this change because it makes the website just a little bit easier to use and a little more intuitive, and because I care.</p>
<p>Do you want a website developer who cares just as much as you do about your business?</p>
<p>You&#8217;ve found him.</p>
<p>Hire me.</p>
<p>Call (07) 575 8799 or <a href="/contact-us/">email me</a>.</p>
<p>Cheers,</p>
<p>Sheldon.</p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.firstbyte.co.nz/2010/04/how-to-reverse-the-order-of-an-ordered-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

