<?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>Jeff Malterre &#187; tweetsuite</title>
	<atom:link href="http://www.jeffmalterre.com/tag/tweetsuite/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jeffmalterre.com</link>
	<description>accessible web programmer, SEO specialist, e-commerce professional</description>
	<lastBuildDate>Tue, 05 Oct 2010 18:23:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>TweetSuite for WordPress Plugin &#8211; W3C Validation Error: Fixed</title>
		<link>http://www.jeffmalterre.com/2009/08/05/tweetsuite-for-wordpress-plugin-w3c-validation-error-fixed/</link>
		<comments>http://www.jeffmalterre.com/2009/08/05/tweetsuite-for-wordpress-plugin-w3c-validation-error-fixed/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 19:53:23 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Snippet]]></category>
		<category><![CDATA[invalid markup]]></category>
		<category><![CDATA[tweetsuite]]></category>
		<category><![CDATA[wordpress plugin]]></category>

		<guid isPermaLink="false">http://www.sibble.com/?p=947</guid>
		<description><![CDATA[TweetSuite is a great plugin, it has a widget for displaying your latest tweets, displays tweetbacks, and lets you add in links to tweet or re-tweet a post on your blog. There&#8217;s more then a few things that need to be fixed with this plugin (ref: TweetSuite Errors and Troubleshooting), right now I&#8217;m just going [...]]]></description>
			<content:encoded><![CDATA[<p>TweetSuite is a great plugin, it has a widget for displaying your latest tweets, displays tweetbacks, and lets you add in links to tweet or re-tweet a post on your blog.  There&#8217;s more then a few things that need to be fixed with this plugin (ref: <a href="http://www.geoffmanning.com/twitter/tweetsuite-errors-and-troubleshooting/">TweetSuite Errors and Troubleshooting</a>), right now I&#8217;m just going to focus on some markup validation errors I came across.</p>
<p>The widget for displaying your latest tweets lists each tweet enclosed with li (listed item) tags.  Unfortunately, these listed items have no unordered or ordered list parent tag.  This causes a the markup to be invalid.  To fix this is quite easy&#8230;</p>
<p><span id="more-947"></span></p>
<p>Open <strong>TweetSuite.php</strong> and goto <strong>line 907</strong>:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>907
908
909
910
911
912
913
914
915
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$buff</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_results</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM <span style="color: #006699; font-weight: bold;">$table_name</span> order by datetime desc limit <span style="color: #006699; font-weight: bold;">$max</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$buff</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$line</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$tweet</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$line</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">tweet</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$line</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$dt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'m/d/y h:ia'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$line</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">datetime</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;li class=<span style="color: #000099; font-weight: bold;">\&quot;</span>tweet<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #006699; font-weight: bold;">$tweet</span> &lt;a href='<span style="color: #006699; font-weight: bold;">$link</span>'?phpMyAdmin=GNiTviqADsNCTwBkw2A2k7Yfxf8&gt;<span style="color: #006699; font-weight: bold;">$dt</span>&lt;/a&gt;&lt;/li&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>and add in the appropriate opening and closing tags&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>907
908
909
910
911
912
913
914
915
916
917
918
919
920
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$buff</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_results</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM <span style="color: #006699; font-weight: bold;">$table_name</span> order by datetime desc limit <span style="color: #006699; font-weight: bold;">$max</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;ul&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$buff</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$line</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$tweet</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$line</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">tweet</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$line</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$dt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'m/d/y h:ia'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$line</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">datetime</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;li class=<span style="color: #000099; font-weight: bold;">\&quot;</span>tweet<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #006699; font-weight: bold;">$tweet</span> &lt;a href='<span style="color: #006699; font-weight: bold;">$link</span>'?phpMyAdmin=GNiTviqADsNCTwBkw2A2k7Yfxf8&gt;<span style="color: #006699; font-weight: bold;">$dt</span>&lt;/a&gt;&lt;/li&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;/ul&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>This will enclose all the listed items with an unordered list tag, thus fixing the invalid markup.</p>
<p>The other problem I found was that some of the tweets had special characters (such as an ampersand) that were not converted to the specific html character code.  This will also cause validation errors.  To convert any special characters to use the appropriate special character code, we&#8217;ll need to make a real simple change.</p>
<p>Open <strong>TweetSuite.php</strong> and goto <strong>line 915</strong>:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>915
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;li class=<span style="color: #000099; font-weight: bold;">\&quot;</span>tweet<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #006699; font-weight: bold;">$tweet</span> &lt;a href='<span style="color: #006699; font-weight: bold;">$link</span>'?phpMyAdmin=GNiTviqADsNCTwBkw2A2k7Yfxf8&gt;<span style="color: #006699; font-weight: bold;">$dt</span>&lt;/a&gt;&lt;/li&gt;&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>and change it to&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>915
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;li class=<span style="color: #000099; font-weight: bold;">\&quot;</span>tweet<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tweet</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; &lt;a href='<span style="color: #006699; font-weight: bold;">$link</span>'?phpMyAdmin=GNiTviqADsNCTwBkw2A2k7Yfxf8&gt;<span style="color: #006699; font-weight: bold;">$dt</span>&lt;/a&gt;&lt;/li&gt;&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>This will now convert any special characters in a tweet to use special character code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeffmalterre.com/2009/08/05/tweetsuite-for-wordpress-plugin-w3c-validation-error-fixed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

