<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for PHP Starter</title>
	<atom:link href="http://phpstarter.net/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://phpstarter.net</link>
	<description>PHP Tips &#38; Tools From Starters to Experts</description>
	<lastBuildDate>Wed, 10 Mar 2010 19:11:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Parse Weather Forecast Data (from the NDFD) in PHP by Sean</title>
		<link>http://phpstarter.net/2009/02/parse-weather-forecast-data-from-the-ndfd-in-php/comment-page-1/#comment-408</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Wed, 10 Mar 2010 19:11:05 +0000</pubDate>
		<guid isPermaLink="false">http://phpstarter.net/?p=348#comment-408</guid>
		<description>Here&#039;s some of the code... there&#039;s a whole mess of it, and I dont&#039; want to clog your board with randomness, so I&#039;ve stripped out that which I think is relevant...
&#039; Find roots nodes for temperature and cloud data
Dim wtClouds As New WeatherTable()
wtClouds.nodeData = xmlDoc.SelectSingleNode(&quot;/dwml/data/parameters/conditions-icon&quot;)
&#039; Find out corresponding time layout table for each top data node
wtClouds.nodeTimeLayout = FindLayoutTable(xmlDoc, wtClouds.nodeData)
FillCloudData(wtClouds, arrDayWeatherData, arrNightWeather)
arrDayWeatherData = New DayWeatherData(cTimes - 1) {}
 arrNightWeather = New DayWeatherData(cTimes - 1) {}
Dim DR As DataRow
 For N As Integer = 0 To arrDayWeatherData.Length - 1
 DR = DT.NewRow
 DR.Item(&quot;WeatherDate&quot;) = arrDayWeatherData(N).DateTime
 DR.Item(&quot;DayIcon&quot;) = arrDayWeatherData(N).CloudIconURL
 DR.Item(&quot;DayHigh&quot;) = arrDayWeatherData(N).HighTempF
 If N &lt; arrDayWeatherData.Length - 1 Then
 DR.Item(&quot;NightIcon&quot;) = arrNightWeather(N).CloudIconURL
 DR.Item(&quot;NightLow&quot;) = arrDayWeatherData(N).LowTempF
 Else
 DR.Item(&quot;NightIcon&quot;) = Nothing
 DR.Item(&quot;NightLow&quot;) = Nothing
 End If
 DT.Rows.Add(DR)
 DR = Nothing
 Next
 
Private Shared Sub FillCloudData(ByVal wt As WeatherTable, ByRef arrDayWeatherData As DayWeatherData(), ByRef arrNightWeather As DayWeatherData())
 &#039; Cloud data is typically much longer than day high/low data
 &#039; We need to find times that match ones in high and low temp tables.
 Dim listTimes As XmlNodeList = wt.nodeTimeLayout.SelectNodes(&quot;start-valid-time&quot;)
 Dim listIcons As XmlNodeList = wt.nodeData.SelectNodes(&quot;icon-link&quot;)
 Dim cWeatherData As Integer = 0
 Dim cNodes As Integer = 0
 Dim hourDiff As Integer = Int32.MaxValue

 For Each node As XmlNode In listTimes
 cNodes += 1
 Dim dt As DateTime = ParseDateTime(node.InnerText)

 If dt.[Date] &gt; arrDayWeatherData(cWeatherData).DateTime.[Date] Then
 cWeatherData += 1
 If cWeatherData &gt;= arrDayWeatherData.Length Then
 Exit For
 End If

 hourDiff = Int32.MaxValue
 End If

 If dt.[Date] = arrDayWeatherData(cWeatherData).DateTime.[Date] Then
 Dim diff As Integer = Math.Abs(dt.Hour - arrDayWeatherData(cWeatherData).DateTime.Hour)

 If diff &lt; hourDiff Then
 hourDiff = diff
 If cWeatherData &lt; arrDayWeatherData.Length Then
 arrDayWeatherData(cWeatherData).CloudIconURL = listIcons(cNodes).InnerText
 End If

 End If
 End If


 Next

 cNodes = 0
 cWeatherData = 0

 For Each node As XmlNode In listTimes
 cNodes += 1
 Dim dt As DateTime = ParseDateTime(node.InnerText)

 If dt.[Date] &gt; arrNightWeather(cWeatherData).DateTime.[Date] Then
 cWeatherData += 1
 If cWeatherData &gt;= arrNightWeather.Length Then
 Exit For
 End If

 hourDiff = Int32.MaxValue
 End If

 If dt.[Date] = arrNightWeather(cWeatherData).DateTime.[Date] Then
 If dt.Hour = arrNightWeather(cWeatherData).DateTime.Hour Then


 Dim diff As Integer = Math.Abs(dt.Hour - arrNightWeather(cWeatherData).DateTime.Hour)

 If diff &lt; hourDiff Then
 hourDiff = diff
 If cWeatherData &lt; arrNightWeather.Length Then
 arrNightWeather(cWeatherData).CloudIconURL = listIcons(cNodes).InnerText
 End If

 End If
 End If

 End If


 Next

 End Sub
 
Private Shared Function FindLayoutTable(ByVal xmlDoc As XmlDocument, ByVal topDataNode As XmlNode) As XmlNode
 Dim nlTimeLayouts As XmlNodeList = xmlDoc.SelectNodes(&quot;/dwml/data/time-layout&quot;)
 Dim timeLayout As String = topDataNode.Attributes(&quot;time-layout&quot;).Value

 For Each node As XmlNode In nlTimeLayouts
 If timeLayout = node.SelectSingleNode(&quot;layout-key&quot;).InnerText Then
 Return node
 End If
 Next

 Return Nothing
 End Function</description>
		<content:encoded><![CDATA[<p>Here&#8217;s some of the code&#8230; there&#8217;s a whole mess of it, and I dont&#8217; want to clog your board with randomness, so I&#8217;ve stripped out that which I think is relevant&#8230;<br />
&#8216; Find roots nodes for temperature and cloud data<br />
Dim wtClouds As New WeatherTable()<br />
wtClouds.nodeData = xmlDoc.SelectSingleNode(&#8220;/dwml/data/parameters/conditions-icon&#8221;)<br />
&#8216; Find out corresponding time layout table for each top data node<br />
wtClouds.nodeTimeLayout = FindLayoutTable(xmlDoc, wtClouds.nodeData)<br />
FillCloudData(wtClouds, arrDayWeatherData, arrNightWeather)<br />
arrDayWeatherData = New DayWeatherData(cTimes &#8211; 1) {}<br />
 arrNightWeather = New DayWeatherData(cTimes &#8211; 1) {}<br />
Dim DR As DataRow<br />
 For N As Integer = 0 To arrDayWeatherData.Length &#8211; 1<br />
 DR = DT.NewRow<br />
 DR.Item(&#8220;WeatherDate&#8221;) = arrDayWeatherData(N).DateTime<br />
 DR.Item(&#8220;DayIcon&#8221;) = arrDayWeatherData(N).CloudIconURL<br />
 DR.Item(&#8220;DayHigh&#8221;) = arrDayWeatherData(N).HighTempF<br />
 If N &lt; arrDayWeatherData.Length &#8211; 1 Then<br />
 DR.Item(&#8220;NightIcon&#8221;) = arrNightWeather(N).CloudIconURL<br />
 DR.Item(&#8220;NightLow&#8221;) = arrDayWeatherData(N).LowTempF<br />
 Else<br />
 DR.Item(&#8220;NightIcon&#8221;) = Nothing<br />
 DR.Item(&#8220;NightLow&#8221;) = Nothing<br />
 End If<br />
 DT.Rows.Add(DR)<br />
 DR = Nothing<br />
 Next<br />
 <br />
Private Shared Sub FillCloudData(ByVal wt As WeatherTable, ByRef arrDayWeatherData As DayWeatherData(), ByRef arrNightWeather As DayWeatherData())<br />
 &#8216; Cloud data is typically much longer than day high/low data<br />
 &#8216; We need to find times that match ones in high and low temp tables.<br />
 Dim listTimes As XmlNodeList = wt.nodeTimeLayout.SelectNodes(&#8220;start-valid-time&#8221;)<br />
 Dim listIcons As XmlNodeList = wt.nodeData.SelectNodes(&#8220;icon-link&#8221;)<br />
 Dim cWeatherData As Integer = 0<br />
 Dim cNodes As Integer = 0<br />
 Dim hourDiff As Integer = Int32.MaxValue</p>
<p> For Each node As XmlNode In listTimes<br />
 cNodes += 1<br />
 Dim dt As DateTime = ParseDateTime(node.InnerText)</p>
<p> If dt.[Date] &gt; arrDayWeatherData(cWeatherData).DateTime.[Date] Then<br />
 cWeatherData += 1<br />
 If cWeatherData &gt;= arrDayWeatherData.Length Then<br />
 Exit For<br />
 End If</p>
<p> hourDiff = Int32.MaxValue<br />
 End If</p>
<p> If dt.[Date] = arrDayWeatherData(cWeatherData).DateTime.[Date] Then<br />
 Dim diff As Integer = Math.Abs(dt.Hour &#8211; arrDayWeatherData(cWeatherData).DateTime.Hour)</p>
<p> If diff &lt; hourDiff Then<br />
 hourDiff = diff<br />
 If cWeatherData &lt; arrDayWeatherData.Length Then<br />
 arrDayWeatherData(cWeatherData).CloudIconURL = listIcons(cNodes).InnerText<br />
 End If</p>
<p> End If<br />
 End If</p>
<p> Next</p>
<p> cNodes = 0<br />
 cWeatherData = 0</p>
<p> For Each node As XmlNode In listTimes<br />
 cNodes += 1<br />
 Dim dt As DateTime = ParseDateTime(node.InnerText)</p>
<p> If dt.[Date] &gt; arrNightWeather(cWeatherData).DateTime.[Date] Then<br />
 cWeatherData += 1<br />
 If cWeatherData &gt;= arrNightWeather.Length Then<br />
 Exit For<br />
 End If</p>
<p> hourDiff = Int32.MaxValue<br />
 End If</p>
<p> If dt.[Date] = arrNightWeather(cWeatherData).DateTime.[Date] Then<br />
 If dt.Hour = arrNightWeather(cWeatherData).DateTime.Hour Then</p>
<p> Dim diff As Integer = Math.Abs(dt.Hour &#8211; arrNightWeather(cWeatherData).DateTime.Hour)</p>
<p> If diff &lt; hourDiff Then<br />
 hourDiff = diff<br />
 If cWeatherData &lt; arrNightWeather.Length Then<br />
 arrNightWeather(cWeatherData).CloudIconURL = listIcons(cNodes).InnerText<br />
 End If</p>
<p> End If<br />
 End If</p>
<p> End If</p>
<p> Next</p>
<p> End Sub<br />
 <br />
Private Shared Function FindLayoutTable(ByVal xmlDoc As XmlDocument, ByVal topDataNode As XmlNode) As XmlNode<br />
 Dim nlTimeLayouts As XmlNodeList = xmlDoc.SelectNodes(&#8220;/dwml/data/time-layout&#8221;)<br />
 Dim timeLayout As String = topDataNode.Attributes(&#8220;time-layout&#8221;).Value</p>
<p> For Each node As XmlNode In nlTimeLayouts<br />
 If timeLayout = node.SelectSingleNode(&#8220;layout-key&#8221;).InnerText Then<br />
 Return node<br />
 End If<br />
 Next</p>
<p> Return Nothing<br />
 End Function</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Parse Weather Forecast Data (from the NDFD) in PHP by Andrew</title>
		<link>http://phpstarter.net/2009/02/parse-weather-forecast-data-from-the-ndfd-in-php/comment-page-1/#comment-406</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Sun, 07 Mar 2010 17:45:44 +0000</pubDate>
		<guid isPermaLink="false">http://phpstarter.net/?p=348#comment-406</guid>
		<description>&lt;p&gt;Sean-&lt;/p&gt;
&lt;p&gt;That&#039;s interesting.  I had a similar issue because the arrays weren&#039;t aligning properly, causing the days to be off, and the forecasts were flipped - showing day for night and night for day.  It&#039;s hard to say why you are seeing night for both.  How are you processing the XML?  I assume you are doing it in ASP.NET, but can you post how you are getting the data from the XML to an object to use?&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Sean-</p>
<p>That&#8217;s interesting.  I had a similar issue because the arrays weren&#8217;t aligning properly, causing the days to be off, and the forecasts were flipped &#8211; showing day for night and night for day.  It&#8217;s hard to say why you are seeing night for both.  How are you processing the XML?  I assume you are doing it in ASP.NET, but can you post how you are getting the data from the XML to an object to use?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Parse Weather Forecast Data (from the NDFD) in PHP by Sean</title>
		<link>http://phpstarter.net/2009/02/parse-weather-forecast-data-from-the-ndfd-in-php/comment-page-1/#comment-404</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Fri, 05 Mar 2010 15:57:26 +0000</pubDate>
		<guid isPermaLink="false">http://phpstarter.net/?p=348#comment-404</guid>
		<description>I have this working in ASP.net, but I feel like the icons must be wrong because it sometimes shows nighttime icons for the day highs....  Am I somehow not matching these up right?
Here&#039;s the page I&#039;m referring to:  http://www.boatpittsburgh.com
You can use the down arrow to expand the weather for the whole week... apparently on Monday and Tuesday it&#039;s forecast to be a solar eclipse all day long... O.o</description>
		<content:encoded><![CDATA[<p>I have this working in ASP.net, but I feel like the icons must be wrong because it sometimes shows nighttime icons for the day highs&#8230;.  Am I somehow not matching these up right?<br />
Here&#8217;s the page I&#8217;m referring to:  <a href="http://www.boatpittsburgh.com" rel="nofollow">http://www.boatpittsburgh.com</a><br />
You can use the down arrow to expand the weather for the whole week&#8230; apparently on Monday and Tuesday it&#8217;s forecast to be a solar eclipse all day long&#8230; O.o</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Merge Image Layers in PHP by Andrew</title>
		<link>http://phpstarter.net/2009/07/merge-image-layers-in-php/comment-page-1/#comment-403</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Wed, 03 Mar 2010 19:07:53 +0000</pubDate>
		<guid isPermaLink="false">http://phpstarter.net/?p=455#comment-403</guid>
		<description>&lt;p&gt;The file_get_contents() function does not work in all environments - only the ones that have &lt;span class=&quot;term&quot;&gt; &lt;em&gt;&lt;tt class=&quot;parameter&quot;&gt;allow_url_fopen&lt;/tt&gt;&lt;/em&gt;&lt;/span&gt; set to true in the PHP configuration.  I have had more luck across hosting environments that way.&lt;/p&gt;
&lt;p&gt;If you are sure that allow_url_fopen will be enabled where you are using this, then ya, it would probably be easier than including the Snoopy class.&lt;/p&gt;
&lt;p&gt;Glad you find the articles useful! :)&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>The file_get_contents() function does not work in all environments &#8211; only the ones that have <span class="term"> <em><tt class="parameter">allow_url_fopen</tt></em></span> set to true in the PHP configuration.  I have had more luck across hosting environments that way.</p>
<p>If you are sure that allow_url_fopen will be enabled where you are using this, then ya, it would probably be easier than including the Snoopy class.</p>
<p>Glad you find the articles useful! <img src='http://phpstarter.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Merge Image Layers in PHP by Tim Barmann</title>
		<link>http://phpstarter.net/2009/07/merge-image-layers-in-php/comment-page-1/#comment-402</link>
		<dc:creator>Tim Barmann</dc:creator>
		<pubDate>Wed, 03 Mar 2010 18:51:53 +0000</pubDate>
		<guid isPermaLink="false">http://phpstarter.net/?p=455#comment-402</guid>
		<description>Hi Andrew,
I very much appreciate your great work and your willingness to share it.  Question - why do you use the Snoopy class instead of something like PHP&#039;s file_get_contents() ?
Thanks again,
Tim</description>
		<content:encoded><![CDATA[<p>Hi Andrew,<br />
I very much appreciate your great work and your willingness to share it.  Question &#8211; why do you use the Snoopy class instead of something like PHP&#8217;s file_get_contents() ?<br />
Thanks again,<br />
Tim</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Dynamically Converting Text to an Image by Andrew</title>
		<link>http://phpstarter.net/2009/02/dynamically-converting-text-to-an-image/comment-page-1/#comment-401</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Tue, 02 Mar 2010 23:52:07 +0000</pubDate>
		<guid isPermaLink="false">http://phpstarter.net/?p=337#comment-401</guid>
		<description>&lt;p&gt;Alex -&lt;/p&gt;
&lt;p&gt;I was able to get the example &lt;a href=&quot;../../../samples/337/test.php&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;working&lt;/a&gt;.  Make sure you have the path to the font current.  When I had it set to the wrong path, PHP throws a warning and then uses the default font.  If you have warnings disabled, you may not notice that.  Run &lt;code&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;error_reporting&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;E_ALL&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt; before any other code to make sure you aren&#039;t hiding any warnings that are getting thrown.&lt;/p&gt;
&lt;p&gt;Hope this helps!&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Alex -</p>
<p>I was able to get the example <a href="../../../samples/337/test.php" target="_blank" rel="nofollow">working</a>.  Make sure you have the path to the font current.  When I had it set to the wrong path, PHP throws a warning and then uses the default font.  If you have warnings disabled, you may not notice that.  Run <code><span style="color: #000000;"><span style="color: #0000bb;">error_reporting</span><span style="color: #007700;">(</span><span style="color: #0000bb;">E_ALL</span><span style="color: #007700;">);</span></span></code> before any other code to make sure you aren&#8217;t hiding any warnings that are getting thrown.</p>
<p>Hope this helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Dynamically Converting Text to an Image by alex turner</title>
		<link>http://phpstarter.net/2009/02/dynamically-converting-text-to-an-image/comment-page-1/#comment-400</link>
		<dc:creator>alex turner</dc:creator>
		<pubDate>Thu, 25 Feb 2010 00:08:35 +0000</pubDate>
		<guid isPermaLink="false">http://phpstarter.net/?p=337#comment-400</guid>
		<description>this doesnt seem to be working for me - ive inputted the code in a php and created a test html file. Ive also selected the font by downloading the program and converting it to .gdf, but it still displays all text normally...</description>
		<content:encoded><![CDATA[<p>this doesnt seem to be working for me &#8211; ive inputted the code in a php and created a test html file. Ive also selected the font by downloading the program and converting it to .gdf, but it still displays all text normally&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Akismet Class/Library for Codeigniter by CodeIgniter Tutorials to Help You Get Started &#124; KomunitasWeb</title>
		<link>http://phpstarter.net/2009/02/akismet-classlibrary-for-codeigniter/comment-page-1/#comment-398</link>
		<dc:creator>CodeIgniter Tutorials to Help You Get Started &#124; KomunitasWeb</dc:creator>
		<pubDate>Tue, 09 Feb 2010 20:12:09 +0000</pubDate>
		<guid isPermaLink="false">http://phpstarter.net/?p=301#comment-398</guid>
		<description>[...] Akismet Class/Library for Codeigniter &#8211; Don&#8217;t like spam? Of course. So get akismet rid your spam. [...]</description>
		<content:encoded><![CDATA[<p>[...] Akismet Class/Library for Codeigniter &#8211; Don&#8217;t like spam? Of course. So get akismet rid your spam. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Parse Current Weather Conditions Data from the NWS in PHP by Andrew</title>
		<link>http://phpstarter.net/2009/02/parse-current-weather-conditions-data-from-the-nws-in-php/comment-page-1/#comment-394</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Fri, 15 Jan 2010 22:40:55 +0000</pubDate>
		<guid isPermaLink="false">http://phpstarter.net/?p=386#comment-394</guid>
		<description>Hey Tim,

I figured that this way, I would only have to parse the XML once on the data load rather than every time someone loads a page.  Would this make a huge difference in the page load time? Probably not.  Also, if the NWS made changes to their file structure, you would have to rewrite some PHP code anyway, so I figured it wouldn&#039;t be too much of a big deal to change some MySQL data fields while you are at it.

Your method would probably work just as well - it&#039;s a matter of personal preference on what you would rather maintain.</description>
		<content:encoded><![CDATA[<p>Hey Tim,</p>
<p>I figured that this way, I would only have to parse the XML once on the data load rather than every time someone loads a page.  Would this make a huge difference in the page load time? Probably not.  Also, if the NWS made changes to their file structure, you would have to rewrite some PHP code anyway, so I figured it wouldn&#8217;t be too much of a big deal to change some MySQL data fields while you are at it.</p>
<p>Your method would probably work just as well &#8211; it&#8217;s a matter of personal preference on what you would rather maintain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Parse Current Weather Conditions Data from the NWS in PHP by Tim Barmann</title>
		<link>http://phpstarter.net/2009/02/parse-current-weather-conditions-data-from-the-nws-in-php/comment-page-1/#comment-393</link>
		<dc:creator>Tim Barmann</dc:creator>
		<pubDate>Fri, 15 Jan 2010 21:30:29 +0000</pubDate>
		<guid isPermaLink="false">http://phpstarter.net/?p=386#comment-393</guid>
		<description>Sorry about using the wrong name, Andrew!</description>
		<content:encoded><![CDATA[<p>Sorry about using the wrong name, Andrew!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
