<?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>The M stands for Monster - The Journal &#187; Programming</title>
	<atom:link href="http://themstandsformonster.com/blog/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://themstandsformonster.com/blog</link>
	<description>A blog about books, design, law school, and other stuff</description>
	<lastBuildDate>Fri, 27 Apr 2012 00:50:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>The Plug Plugin</title>
		<link>http://themstandsformonster.com/blog/2007/03/the-plug-plugin/</link>
		<comments>http://themstandsformonster.com/blog/2007/03/the-plug-plugin/#comments</comments>
		<pubDate>Thu, 22 Mar 2007 03:27:53 +0000</pubDate>
		<dc:creator>monster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Site Updates]]></category>

		<guid isPermaLink="false">http://www.themstandsformonster.com/2007/03/22/the-plug-plugin/</guid>
		<description><![CDATA[Quick update, I installed a new plugin that spits out a list of people who commented on a post and links their name back to their respective websites. It&#8217;s a comment-whoring move to let others plug their sites on yours, but oh well, seeing as how most of the traffic into my site comes in [...]]]></description>
			<content:encoded><![CDATA[<p>Quick update, I installed a <a href="http://dev.wp-plugins.org/browser/comment-plugger/branches">new plugin</a> that spits out a list of people who commented on a post and links their name back to their respective websites. It&#8217;s a comment-whoring move to let others plug their sites on yours, but oh well, seeing as how most of the traffic into my site comes in that form anyway.</p>
<p>If you want to do the same thing (see the &#8220;complements of&#8221; after each post on the index page?), you can download it from that site.</p>
<p>I made a few quick changes to the code, though. I wanted commas in-between each person, so I needed to have the script put in a comma after every entry other than the last one. In order to do so, after the script files all comment authors and URLs into the array <span class="codetag">$commenters</span>, I assigned a new variable <span class="codetag">$count</span> the integer one and got a count of the array. In code form:</p>
<pre lang="php">$result = count($commenters);
$count = 1;</pre>
<p>(Hint: <span class="codetag">$count</span> starts at 1 to account for the fact that I don&#8217;t want a comma after the last commenter) After that, I concatenated a comma onto the string after each commenter and added one to the count, other than the last one, by adding the following line:<br />
<span id="more-92"></span></p>
<pre lang="php">if ($result!=$count) { $output .= ', '; $count++; }</pre>
<p>All together, my version of the script, starting at the <span class="codetag">if ($commenters)</span> line looks something like this (with various other little edits, for example, I took out the &lt; li &gt; and &lt; ul &gt; tags, but you get the general idea):</p>
<pre lang="php">if ($commenters) {
  $output = '';
  $output2 = 'anonymous';
  $commenters = array_reverse($commenters);
  $result = count($commenters);
  $count = 1;

  print "
<div class="commentplugger">";
  print "<span class="postedat">";
  print "Complements of";
  print "</span>   <span class="exacttime">";

foreach ($commenters as $commenter) {
   if (!empty($commenter-&gt;comment_author))  {
      if (!empty($commenter-&gt;comment_author_url)) {
        $output .= '<a title="Visit ' . $commenter-&gt;comment_author . '" href="' . $commenter-&gt;comment_author_url . '">' . $commenter-&gt;comment_author . '</a>';
	   if ($result!=$count) {
                     $output .= ', ';
                     $count++;  }  }
      else {
        $output .= $commenter-&gt;comment_author . '';
           if ($result!=$count) {
                     $output .= ', ';
                     $count++; }   }
      }
      else
        $output .= $output2;
      }  echo $output; print "</span></div>

";
   }
}
?&gt;</pre>
<p>Isn&#8217;t coding fun?!</p>
]]></content:encoded>
			<wfw:commentRss>http://themstandsformonster.com/blog/2007/03/the-plug-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>You asked for it</title>
		<link>http://themstandsformonster.com/blog/2007/01/content/</link>
		<comments>http://themstandsformonster.com/blog/2007/01/content/#comments</comments>
		<pubDate>Sat, 13 Jan 2007 09:11:17 +0000</pubDate>
		<dc:creator>monster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Site Updates]]></category>

		<guid isPermaLink="false">http://www.themstandsformonster.com/2007/01/13/content/</guid>
		<description><![CDATA[I&#8217;ve never had a visitor-geared content on any of my pages. I tried doing it with the 7th version of the collective (before I closed down the whole thing), but I ended up making a very pretty layout for it that was obnoxious to edit so I never ended up doing much. Anyway, my point [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve never had a visitor-geared content on any of my pages. I tried doing it with the 7th version of the collective (before I closed down the whole thing), but I ended up making a very pretty layout for it that was obnoxious to edit so I never ended up doing much. Anyway, my point is, I finally added some content! There&#8217;s a new item on the navigation menu to the left, VISITOR.</p>
<p>Available for download is the script to implement a bookshelf of your very own. It&#8217;s not a very advanced script as it is my first, but I thought I&#8217;d make it available in case anyone was interested. I&#8217;m also working on a tutorial on how to make wordpress plugins. I&#8217;ve only got the first paragraph right now, but I need to first find a plug-in that will let me display programming code on wordpress pages, and then I&#8217;ll be able to keep working on it. Wish me luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://themstandsformonster.com/blog/2007/01/content/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

