<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Building Web 2.0 Tag Clouds in PHP</title>
	<atom:link href="http://www.developertutorials.com/blog/php/building-web-2-0-tag-clouds-in-php-165/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.developertutorials.com/blog/php/building-web-2-0-tag-clouds-in-php-165/</link>
	<description>Keeping webmasters up-to-date on technology.</description>
	<pubDate>Sun, 06 Jul 2008 10:55:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Jesse Mullan</title>
		<link>http://www.developertutorials.com/blog/php/building-web-2-0-tag-clouds-in-php-165/#comment-684</link>
		<dc:creator>Jesse Mullan</dc:creator>
		<pubDate>Mon, 05 May 2008 12:36:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.developertutorials.com/blog/php/building-web-2-0-tag-clouds-in-php-165/#comment-684</guid>
		<description>I knew the answer already -- I was wondering if you had considered the edge cases.</description>
		<content:encoded><![CDATA[<p>I knew the answer already &#8212; I was wondering if you had considered the edge cases.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Akash Mehta</title>
		<link>http://www.developertutorials.com/blog/php/building-web-2-0-tag-clouds-in-php-165/#comment-682</link>
		<dc:creator>Akash Mehta</dc:creator>
		<pubDate>Mon, 05 May 2008 11:51:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.developertutorials.com/blog/php/building-web-2-0-tag-clouds-in-php-165/#comment-682</guid>
		<description>@Jesse: that's an interesting point; when $maxval == $minval, we'd have a division by zero when calculating $spread.

However, the only time this could happen is a) when you only have one tag; and b) when all your tags have equal values.

For the first scenario, I leave the validation to the developer as you would probably want to do something when you have only one tag (e.g. list items within the tag).

For the second scenario, either your site is new, you have hit quite a coincidence or you don't need a tag cloud in the first place (because all your "tags" have equal values). Once again, I leave this up to the developer to handle outside of the function, as the function's sole purpose is to generate a tag cloud, and I don't wish to complicate it by adding error handling (or worse still, making it do nothing - blank outputs are the hardest to debug).

Of course, if this is an issue and you choose to handle it within the function, all it takes is an if($spread == 0) $spread = 1;.</description>
		<content:encoded><![CDATA[<p>@Jesse: that&#8217;s an interesting point; when $maxval == $minval, we&#8217;d have a division by zero when calculating $spread.</p>
<p>However, the only time this could happen is a) when you only have one tag; and b) when all your tags have equal values.</p>
<p>For the first scenario, I leave the validation to the developer as you would probably want to do something when you have only one tag (e.g. list items within the tag).</p>
<p>For the second scenario, either your site is new, you have hit quite a coincidence or you don&#8217;t need a tag cloud in the first place (because all your &#8220;tags&#8221; have equal values). Once again, I leave this up to the developer to handle outside of the function, as the function&#8217;s sole purpose is to generate a tag cloud, and I don&#8217;t wish to complicate it by adding error handling (or worse still, making it do nothing - blank outputs are the hardest to debug).</p>
<p>Of course, if this is an issue and you choose to handle it within the function, all it takes is an if($spread == 0) $spread = 1;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse Mullan</title>
		<link>http://www.developertutorials.com/blog/php/building-web-2-0-tag-clouds-in-php-165/#comment-644</link>
		<dc:creator>Jesse Mullan</dc:creator>
		<pubDate>Fri, 02 May 2008 19:19:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.developertutorials.com/blog/php/building-web-2-0-tag-clouds-in-php-165/#comment-644</guid>
		<description>What happens when $maxval == $minval ?</description>
		<content:encoded><![CDATA[<p>What happens when $maxval == $minval ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
