<?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>Ardamis&#187; Wordpress</title>
	<atom:link href="http://www.ardamis.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ardamis.com</link>
	<description>Ardamis is a blog about web development and technology in general.</description>
	<lastBuildDate>Sun, 01 Aug 2010 02:43:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>My favorite themeforest.net WordPress templates</title>
		<link>http://www.ardamis.com/2010/02/21/my-favorite-themeforest-net-wordpress-templates/</link>
		<comments>http://www.ardamis.com/2010/02/21/my-favorite-themeforest-net-wordpress-templates/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 06:20:56 +0000</pubDate>
		<dc:creator>ardamis</dc:creator>
				<category><![CDATA[Web Site Dev]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[themes]]></category>

		<guid isPermaLink="false">http://www.ardamis.com/?p=483</guid>
		<description><![CDATA[A collection of my favorite themeforest.net WordPress templates, mostly intended for web designers or graphics-related businesses.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been collecting links to good WordPress templates for a long time.  Because I&#8217;ve been asked a few times recently if I can recommend some templates, I&#8217;m putting them together here.</p>
<h2>Huge, isolated, animated slideshow</h2>
<p>I really like these themes for focusing almost exclusively on one&#8217;s portfolio.  They feature a massive, animated slideshow that keeps the visitor&#8217;s attention on the images.  In some cases, a shadow underneath the slideshow, combined with the animation, creates a 3-D effect to put the portfolio right in the visitor&#8217;s face.</p>
<ul>
<li><a href="http://themeforest.net/item/black-eve-wordpress-version/full_screen_preview/93185">http://themeforest.net/item/black-eve-wordpress-version/full_screen_preview/93185</a></li>
<li><a href="http://themeforest.net/item/novatorix-10-in-1-business-portfolio-and-blog/full_screen_preview/111717">http://themeforest.net/item/novatorix-10-in-1-business-portfolio-and-blog/full_screen_preview/111717</a></li>
<li><a href="http://themeforest.net/item/iportfolio/full_screen_preview/75877">http://themeforest.net/item/iportfolio/full_screen_preview/75877</a></li>
<li><a href="http://themeforest.net/item/display-3-in-1-business-portfolio-wordpress-/full_screen_preview/74542">http://themeforest.net/item/display-3-in-1-business-portfolio-wordpress-/full_screen_preview/74542</a></li>
<li><a href="http://themeforest.net/item/7-in-1-business-success-wordpress-theme/full_screen_preview/88463">http://themeforest.net/item/7-in-1-business-success-wordpress-theme/full_screen_preview/88463</a></li>
<li><a href="http://themeforest.net/item/flexolio-porfolio-blog-business-cms-wp-theme-/full_screen_preview/81146">http://themeforest.net/item/flexolio-porfolio-blog-business-cms-wp-theme-/full_screen_preview/81146</a></li>
<li><a href="http://themeforest.net/item/discovery-wordpress/full_screen_preview/83792">http://themeforest.net/item/discovery-wordpress/full_screen_preview/83792</a></li>
<li><a href="http://themeforest.net/item/assurance-wordpress-cms-theme/full_screen_preview/84092">http://themeforest.net/item/assurance-wordpress-cms-theme/full_screen_preview/84092</a></li>
</ul>
<h2>Confined slideshow</h2>
<p>These themes are a bit more modest than the first collection.  They still accentuate a portfolio of images, but in a less flashy way.  The slideshow exists within a defined banner area, so the look is a little more traditional.  These templates would be a better fit for businesses.</p>
<ul>
<li><a href="http://themeforest.net/item/vulcan-minimalist-business-wordpress-theme-4/full_screen_preview/111625">http://themeforest.net/item/vulcan-minimalist-business-wordpress-theme-4/full_screen_preview/111625</a></li>
<li><a href="http://themeforest.net/item/creation-minimalist-business-wordpress-theme/full_screen_preview/113734">http://themeforest.net/item/creation-minimalist-business-wordpress-theme/full_screen_preview/113734</a></li>
<li><a href="http://themeforest.net/item/corporate-business-portfolio-wordpress-theme-/full_screen_preview/81507">http://themeforest.net/item/corporate-business-portfolio-wordpress-theme-/full_screen_preview/81507</a></li>
<li><a href="http://themeforest.net/item/luxury-wordpress-template/full_screen_preview/83220">http://themeforest.net/item/luxury-wordpress-template/full_screen_preview/83220</a></li>
<li><a href="http://themeforest.net/item/tylium-premium-wordpress-theme/full_screen_preview/68229">http://themeforest.net/item/tylium-premium-wordpress-theme/full_screen_preview/68229</a></li>
<li><a href="http://themeforest.net/item/shapeshifter-one-page-infinite-possibilities/full_screen_preview/75759">http://themeforest.net/item/shapeshifter-one-page-infinite-possibilities/full_screen_preview/75759</a></li>
<li><a href="http://themeforest.net/item/delericon-businessportfolio-template-wordpress/full_screen_preview/76635">http://themeforest.net/item/delericon-businessportfolio-template-wordpress/full_screen_preview/76635</a></li>
<li><a href="http://themeforest.net/item/twicet-business-portfolio-wordpress-5-in-1/full_screen_preview/49773">http://themeforest.net/item/twicet-business-portfolio-wordpress-5-in-1/full_screen_preview/49773</a></li>
<li><a href="http://themeforest.net/item/benzo/full_screen_preview/50977">http://themeforest.net/item/benzo/full_screen_preview/50977</a></li>
<li><a href="http://themeforest.net/item/creative-wordpress-theme-9-in-1/full_screen_preview/84549">http://themeforest.net/item/creative-wordpress-theme-9-in-1/full_screen_preview/84549</a></li>
<li><a href="http://themeforest.net/item/levitation-wordpress-business-portfolio-4-in-1/full_screen_preview/60299">http://themeforest.net/item/levitation-wordpress-business-portfolio-4-in-1/full_screen_preview/60299</a></li>
<li><a href="http://themeforest.net/item/mapollo/full_screen_preview/60268">http://themeforest.net/item/mapollo/full_screen_preview/60268</a></li>
<li><a href="http://themeforest.net/item/elite-force-premium-wordpress-theme/full_screen_preview/84456">http://themeforest.net/item/elite-force-premium-wordpress-theme/full_screen_preview/84456</a></li>
</ul>
<h2>Partial-banner image rotation</h2>
<p>These themes use only part of the banner to display a rotating group of images, leaving an area for text next to the images.  This allows a short message or tagline to get equal placement.  These are the most conservative themes.</p>
<ul>
<l><a href="http://themeforest.net/item/designer-portfolio-elegant-template-wordpress/full_screen_preview/96810">http://themeforest.net/item/designer-portfolio-elegant-template-wordpress/full_screen_preview/96810</a></li>
<li><a href="http://themeforest.net/item/bluelight-wordpress-20-portfolio-and-blog/full_screen_preview/40433">http://themeforest.net/item/bluelight-wordpress-20-portfolio-and-blog/full_screen_preview/40433</a></li>
<li><a href="http://themeforest.net/item/quadro-wordpress-version/full_screen_preview/79966">http://themeforest.net/item/quadro-wordpress-version/full_screen_preview/79966</a></li>
<li><a href="http://themeforest.net/item/concept-wordpress-a-premium-wp-theme/full_screen_preview/53845">http://themeforest.net/item/concept-wordpress-a-premium-wp-theme/full_screen_preview/53845</a></li>
<li><a href="http://themeforest.net/item/lightcorners/full_screen_preview/82046">http://themeforest.net/item/lightcorners/full_screen_preview/82046</a></li>
<li><a href="http://themeforest.net/item/concise/full_screen_preview/66396">http://themeforest.net/item/concise/full_screen_preview/66396</a></li>
<li><a href="http://themeforest.net/item/spotlight-portfolio-theme-wordpress-edition/full_screen_preview/80959">http://themeforest.net/item/spotlight-portfolio-theme-wordpress-edition/full_screen_preview/80959</a></li>
<li><a href="http://themeforest.net/item/transformer/82402">http://themeforest.net/item/transformer/82402</a></li>
<li><a href="http://themeforest.net/item/scroller-wordpress-theme/full_screen_preview/83162">http://themeforest.net/item/scroller-wordpress-theme/full_screen_preview/83162</a></li>
<li><a href="http://themeforest.net/item/advantage-wordpress-theme-4-in-1/full_screen_preview/88112">http://themeforest.net/item/advantage-wordpress-theme-4-in-1/full_screen_preview/88112</a></li>
<li><a href="http://themeforest.net/item/durable-5-in-1-business-portfolio-wordpress/full_screen_preview/84440">http://themeforest.net/item/durable-5-in-1-business-portfolio-wordpress/full_screen_preview/84440</a></li>
<li><a href="http://themeforest.net/item/equator-global-community-wordpress-theme/full_screen_preview/65549">http://themeforest.net/item/equator-global-community-wordpress-theme/full_screen_preview/65549</a></li>
<li><a href="http://themeforest.net/item/oxygene-clean-environment/full_screen_preview/62657">http://themeforest.net/item/oxygene-clean-environment/full_screen_preview/62657</a></li>
<li><a href="http://themeforest.net/item/foliothemes-portfolio/full_screen_preview/66448">http://themeforest.net/item/foliothemes-portfolio/full_screen_preview/66448</a></li>
<li><a href="http://themeforest.net/item/eclectic-premium-wordpress-theme/full_screen_preview/63212">http://themeforest.net/item/eclectic-premium-wordpress-theme/full_screen_preview/63212</a></li>
<li><a href="http://themeforest.net/item/bitwork-portfolio-and-business-wordpress-theme/full_screen_preview/87092">http://themeforest.net/item/bitwork-portfolio-and-business-wordpress-theme/full_screen_preview/87092</a></li>
<li><a href="http://themeforest.net/item/business-showcase-corporate-layout-html/full_screen_preview/50191">http://themeforest.net/item/business-showcase-corporate-layout-html/full_screen_preview/50191</a></li>
<li><a href="http://themeforest.net/item/corpomino/full_screen_preview/63883">http://themeforest.net/item/corpomino/full_screen_preview/63883</a></li>
<li><a href="http://themeforest.net/item/photography-and-portfolio-wordpress-theme/full_screen_preview/82048">http://themeforest.net/item/photography-and-portfolio-wordpress-theme/full_screen_preview/82048</a></li>
<li><a href="http://themeforest.net/item/kava-wp-theme-for-cms-business-portfolio-blog/full_screen_preview/82551">http://themeforest.net/item/kava-wp-theme-for-cms-business-portfolio-blog/full_screen_preview/82551</a></li>
</ul>
<h2>Creative themes</h2>
<p>This last group of themes break with the conventions of the above themes and use full-screen-width or otherwise larger-than-normal images that rotate behind the other elements of the site.  Undeniably attention-grabbing, but also slower to load.</p>
<ul>
<li><a href="http://themeforest.net/item/the-architect-wp-edition/full_screen_preview/113414">http://themeforest.net/item/the-architect-wp-edition/full_screen_preview/113414</a></li>
<li><a href="http://themeforest.net/item/photome-photography-and-portfolio-template-wp/full_screen_preview/113474">http://themeforest.net/item/photome-photography-and-portfolio-template-wp/full_screen_preview/113474</a></li>
<li><a href="http://themeforest.net/item/wp-portfolius-v9/full_screen_preview/81863">http://themeforest.net/item/wp-portfolius-v9/full_screen_preview/81863</a></li>
<li><a href="http://themeforest.net/item/photo-graphic-studio-wordpress/full_screen_preview/36070">http://themeforest.net/item/photo-graphic-studio-wordpress/full_screen_preview/36070</a></li>
<li><a href="http://themeforest.net/item/desktop-press-creative-wordpress-theme/full_screen_preview/87968">http://themeforest.net/item/desktop-press-creative-wordpress-theme/full_screen_preview/87968</a></li>
<li><a href="http://themeforest.net/item/luna-premium-wordpress-theme/full_screen_preview/85233">http://themeforest.net/item/luna-premium-wordpress-theme/full_screen_preview/85233</a></li>
</ul>
<h2>Single page</h2>
<p>These are single-page web sites.  These types of pages are great as business cards or resumes, or as place holders while a larger site is developed.</p>
<ul>
<li><a href="http://themeforest.net/item/galeria-single-page-wordpress-portfolio/full_screen_preview/105848">http://themeforest.net/item/galeria-single-page-wordpress-portfolio/full_screen_preview/105848</a></li>
<li><a href="http://themeforest.net/item/path-finder-keyboard-navigation-wordpress-theme/full_screen_preview/109983">http://themeforest.net/item/path-finder-keyboard-navigation-wordpress-theme/full_screen_preview/109983</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ardamis.com/2010/02/21/my-favorite-themeforest-net-wordpress-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using timestamps to reduce WordPress comment spam</title>
		<link>http://www.ardamis.com/2007/12/15/using-timestamps-to-reduce-wordpress-comment-spam/</link>
		<comments>http://www.ardamis.com/2007/12/15/using-timestamps-to-reduce-wordpress-comment-spam/#comments</comments>
		<pubDate>Sat, 15 Dec 2007 08:33:15 +0000</pubDate>
		<dc:creator>ardamis</dc:creator>
				<category><![CDATA[Web Site Dev]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[comment spam]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.ardamis.com/2007/12/15/using-timestamps-to-reduce-wordpress-comment-spam/</guid>
		<description><![CDATA[In this post, I&#8217;ll explain how to reduce the amount of comment spam your WordPress blog receives by using an unobtrusive &#8216;handshake&#8217; between the two files necessary for a valid comment submission to take place. I&#8217;ve written a few different articles on reducing comment spam by means of a challenge response test that the visitor [...]]]></description>
			<content:encoded><![CDATA[<p>In this post, I&#8217;ll explain how to reduce the amount of comment spam your WordPress blog receives by using an unobtrusive &#8216;handshake&#8217; between the two files necessary for a valid comment submission to take place.  I&#8217;ve written a few different articles on reducing comment spam by means of a challenge response test that the visitor must complete before submitting a comment, but I&#8217;m now looking for ways to achieve the same results while keeping the anti-spam method invisible to the visitor.</p>
<p>I&#8217;m a big fan of Akismet, but I also want to block as much spam as possible before it is caught by Akisment in order to reduce the number of database entries.</p>
<p>One thing this method does not do is <a href="http://www.ardamis.com/2007/09/12/defeating-wordpress-comment-spam/">rename and hide the path to the form processing script</a>, but it makes that technique obsolete, anyway.</p>
<p>In the timestamp handshake method, a first timestamp is generated and written as a hidden input field when the post page loads.  When the comment is submitted, a second timestamp is generated by the comment-processing script and it and the page-load timestamp are saved as variables.  If the page-load timestamp variable is blank, which should be the case if the spambot uses any other page to populate the comment, the script will die.  The page-load timestamp is then subtracted from the comment-submission timestamp.  If the comment was submitted less than 60 seconds after the post page was loaded, the script dies with a descriptive error message.  Hopefully, this will separate the bots&#8217; comments from those left by thoughtful human visitors who have taken the time to read your post.  If a human visitor does happen to submit a comment within 60 seconds of the page loading, he or she can click his or her browser&#8217;s back button and try resubmitting the comment again in a few seconds.</p>
<p>One drawback is that this method does involve editing a core file &#8211; <strong>wp-comments-post.php</strong>.  You&#8217;ll have to re-edit it each time you upgrade WordPress, which is a nuisance, I know.  The good thing is that if you forget to do this, people can still comment &#8211; you just won&#8217;t have the anti-spam protection.</p>
<p>Note that the instructions in the following steps are based on the code in WordPress version 2.3 and the Kubrick theme included with that release.  You may need to adjust for your version of WordPress.</p>
<h2>Step 1 &#8211; Add the hidden timestamp input field to the comment form</h2>
<p>Open the <strong>comments.php</strong> file in your current theme&#8217;s folder and find the following lines:</p>
<pre class="brush: xml;">
&lt;p&gt;&lt;textarea name=&quot;comment&quot; id=&quot;comment&quot; cols=&quot;100%&quot; rows=&quot;10&quot; tabindex=&quot;4&quot;&gt;&lt;/textarea&gt;&lt;/p&gt;

&lt;p&gt;&lt;input name=&quot;submit&quot; type=&quot;submit&quot; id=&quot;submit&quot; tabindex=&quot;5&quot; value=&quot;Submit Comment&quot; /&gt;
</pre>
<p>Add the following line between them:</p>
<pre class="brush: xml;">
&lt;p&gt;&lt;input type=&quot;hidden&quot; name=&quot;timestamp&quot; id=&quot;timestamp&quot; value=&quot;&lt;?php echo time(); ?&gt;&quot; size=&quot;22&quot; /&gt;&lt;/p&gt;
</pre>
<h2>Step 2 &#8211; Modify the <strong>wp-comments-post.php</strong> file to create the second timestamp and perform the comparison</h2>
<p>Open <strong>wp-comments-post.php</strong> and find the lines:</p>
<pre class="brush: php;">
$comment_author       = trim(strip_tags($_POST['author']));
$comment_author_email = trim($_POST['email']);
$comment_author_url   = trim($_POST['url']);
$comment_content      = trim($_POST['comment']);
</pre>
<p>Immediately after them, add the following lines:</p>
<pre class="brush: php;">
$comment_timestamp    = trim($_POST['timestamp']);
$submitted_timestamp  = time();

if ( $comment_timestamp == '' )
	wp_die( __('Hello, spam bot!') );

if ( $submitted_timestamp - $comment_timestamp &lt; 60 )
	wp_die( __('Error: you must wait at least 1 minute before posting a comment.') );
</pre>
<p>That&#8217;s it; you&#8217;re done.  </p>
<h2>Credits</h2>
<p>Thanks to Jonathan Bailey for suggesting the handshake in his post at <a href="http://www.plagiarismtoday.com/2007/07/24/wordpress-and-comment-spam/">http://www.plagiarismtoday.com/2007/07/24/wordpress-and-comment-spam/</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ardamis.com/2007/12/15/using-timestamps-to-reduce-wordpress-comment-spam/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Defeating WordPress comment spam</title>
		<link>http://www.ardamis.com/2007/09/12/defeating-wordpress-comment-spam/</link>
		<comments>http://www.ardamis.com/2007/09/12/defeating-wordpress-comment-spam/#comments</comments>
		<pubDate>Wed, 12 Sep 2007 06:38:34 +0000</pubDate>
		<dc:creator>ardamis</dc:creator>
				<category><![CDATA[Web Site Dev]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[comment spam]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.ardamis.com/2007/09/12/defeating-wordpress-comment-spam/</guid>
		<description><![CDATA[Comment spam comes from humans who are paid to post it and robots/scripts that do it automatically. The majority of spam comes from the bots. There&#8217;s very little one can do to defend against a determined human being, but bots tend to behave predictably, and that allows us to develop countermeasures. From my observations, it [...]]]></description>
			<content:encoded><![CDATA[<p>Comment spam comes from humans who are paid to post it and robots/scripts that do it automatically.  The majority of spam comes from the bots.  There&#8217;s very little one can do to defend against a determined human being, but bots tend to behave predictably, and that allows us to develop countermeasures.</p>
<p>From my observations, it seems that the spambots are first given a keyword phrase to hunt down.  They go through the search engine results for pages with that keyword phrase, and follow the link to each page.  If the page happens to be a WordPress post, they pass their spammy content to the comment form.  Apparently, they do this in a few different ways.  Some bots seem to inject their content directly into the form processing agent, a file in the blog root named wp-comments-post.php, using the WordPress default form field IDs.  Other bots seem to fill in any fields they come across before submitting the form.  Still others seem to fill out the form, but ignore any unexpected text input fields.  All of these behaviors can be used against the spammers.</p>
<p>One anti-spam technique that has been used for years is to rename the script that handles the form processing.  If you look at the HTML of a WordPress post with comments enabled, you&#8217;ll see a line that reads:</p>
<pre><code>
<form action="http://yourdomain.com/wp-comments-post.php" method="post" id="commentform"></code></pre>
<p>The &#8216;wp-comments-post.php&#8217; file handles the comment form processing, and a good amount of spam can be avoided by simply renaming it.  Many bots will try to pass their content to directly to that script, even if it no longer exists, to no effect.  </p>
<p>More sophisticated bots will look through the HTML for the URL of the form processing script, and in doing so will learn the URL of the newly renamed script and pass their contents to that script instead.  The trick is to prevent these smarter bots from discovering the URL of the new script.  Because it seems that the bots aren&#8217;t looking through external JavaScript files yet, that&#8217;s where we will hide the URL.  (If you do use this technique, it would be very considerate to tell your visitors that JavaScript is required to post comments.)</p>
<h2>Step 1</h2>
<p>Rename the wp-comments-post.php file to anything else.  Using a string of <a href="https://www.grc.com/passwords.htm">random hexadecimal characters</a> would be ideal.  Once you&#8217;ve renamed the file, enter the address of the file in your browser.  The page should be blank; if you get a 404 error, something is wrong.  Make a note of that address, because you&#8217;ll need it later.  Verify that the wp-comments-post.php file is empty or is no longer on your server.</p>
<p>(Because I was curious about how many bots were hitting the wp-comments-post.php file directly, I replaced the code with a hitcounter.  Sure enough, bots are still hitting the file directly, even though there is no longer any path leading to it.)</p>
<h2>Step 2</h2>
<p>Open up the &#8216;comments.php&#8217; file in your theme directory.  Find the line:</p>
<pre><code>
<form action="http://yourdomain.com/wp-comments-post.php" method="post" id="commentform"></code></pre>
<p>and change the value of the action attribute to a number sign (or pound sign, or hash), like so:</p>
<pre><code>
<form action="#" method="post" id="commentform"></code></pre>
<p>Any bots that come to the page and search for the path to your comment processing script will just see the hash, so they will never discover the URL to the real script.  This change also means that if a bot or a visitor tries to submit the form, the form will fail, because a WordPress single post page isn&#8217;t designed to process forms.  We want the bots to fail, but we&#8217;ll need to put things right for humans.</p>
<p>If you are tempted to designate a separate page for the action value, note that the only people likely to ever see this page are visitors without JavaScript enabled who fill out the form.  </p>
<h2>Step 3</h2>
<p>Create a new JavaScript file with the following code.</p>
<pre><code>function commentScriptReveal() {
	// enter the URL of your renamed wp-comments-post.php file below
	var scriptPath = "http://yourdomain.com/renamed-wp-comments-post.php";
	document.getElementById("commentform").setAttribute("action", scriptPath);
}
</code></pre>
<p>Enter the address of your renamed file as the value for the variable <code>scriptPath</code>.  The function <code>commentScriptReveal</code>, when called, will find the element with the ID &#8216;commentform&#8217; (that&#8217;s the comment form) and change its action attribute to the URL of the renamed file, allowing the form to be successfully sent to the processing agent.  </p>
<p>Save the file as &#8216;commentrevealer.js&#8217; and upload it to the /scripts/ directory in your blog&#8217;s root.  Add the script to your theme&#8217;s header.php file:</p>
<pre><code><script src="<?php echo bloginfo('url'); ?>/scripts/commentrevealer.js" type="text/javascript"></script>
</code></pre>
<p>Now we just need to decide how to call the <code>commentScriptReveal</code> function.</p>
<h2>Step 4</h2>
<p>The ideal method of calling the function would be the one where the human visitor always calls the function, and the bot never calls it.  To do this, we need to know something about how the bots work.</p>
<p><strong>Step 4a &#8212; For spam bots that ignore unexpected text input fields:</strong></p>
<p>If the bots ignore unexpected text input fields, we can simply add a field, label it &#8216;required&#8217;, and attach the script revealer to that field with one of the following event handlers:  </p>
<ul>
<li><strong>onchange</strong> triggered when the user changes the content of a field</li>
<li><strong>onkeypress</strong> triggered when a keyboard key is pressed or held down</li>
<li><strong>onkeydown</strong> triggered when a keyboard key is pressed</li>
<li><strong>onkeyup</strong> triggered when a keyboard key is released</li>
<li><strong>onfocus</strong> triggered when an element gets focus</li>
<li><strong>onblur</strong> triggered when an element loses focus</li>
</ul>
<p>I&#8217;m intentionally vague about how to trigger the function <code>commentScriptReveal</code> because this technique will be efficacious longer if different people use different events.  Furthermore, the text input field doesn&#8217;t necessarily need to do anything, its contents will just be discarded when the form is processed.  In fact, it doesn&#8217;t even need to be a text input field.  It can be any form control&#8212;a button, a checkbox, a radio button, a menu, etc.  We just need human visitors to interact with it somehow.  Those bots that skip over the control won&#8217;t trigger the revealer event, and your visitors (who always follow directions) will.</p>
<p>If everyone goes about implementing this method in a slightly different way, the spammers should find it much more difficult to counter.  </p>
<p>For further reading on JavaScript events: <a href="http://www.quirksmode.org/js/introevents.html">QuirksMode &#8211; Javascript &#8211; Introduction to Events</a>.</p>
<p><strong>Step 4b &#8212; For spam bots that add text to every input field they come across:</strong></p>
<p>If the bots are hitting every text input field with some text, follow Step 4a, and then create a second JavaScript file, named &#8216;commentconcealer.js&#8217;, with the following code:</p>
<pre><code>function commentScriptConceal() {
	// enter the URL of your renamed wp-comments-post.php file below
	var scriptPath = "#";
	document.getElementById("commentform").setAttribute("action", scriptPath);
}
</code></pre>
<p>The function <code>commentScriptConceal</code> re-rewrites the action attribute back to &#8220;<code>#</code>&#8220;.</p>
<p>Upload the file and add the script to your theme&#8217;s header.php file:</p>
<pre><code><script src="<?php echo bloginfo('url'); ?>/scripts/commentconcealer.js" type="text/javascript"></script>
</code></pre>
<p>Add another text input field somewhere below the one you added in Step 4a.  Hide this field from visitors with {display: none;}.  Call the function with an onfocus (or onblur, etc.) event on the second input field:</p>
<pre><code>
<p style="display: none;">
<input type="text" name="reconceal" id="reconceal" value="" size="22" onfocus="return commentScriptConceal()" />
<label for="reconceal"><small>OMG Don't Touch This Field!?!?</small></label>

</code></pre>
<p>The legitimate visitors will never trigger this, but any bot that interacts with every field on a page will.</p>
<h2>Step 5</h2>
<p>If you chose to use a text input field in Step 4a, consider making that a challenge-response test.  It&#8217;s always a good idea to use a server-side check to back up a client-side check.  I like to ask the question &#8220;<strong>What color is an orange?</strong>&#8221; as a tip of the hat to <a href="http://meyerweb.com/">Eric Meyer</a>.  This <a href="http://www.jeff-barr.com/?p=103">challenge-response test can be integrated into wp-comments-post.php</a>, so that if the user fails the test, the form submission dies in the same way it would if a required field were left blank.  </p>
<p>For this example, let&#8217;s ask the question &#8220;<strong>What color is Kermit the Frog?</strong>&#8221;  The answer, of course, is <strong>green</strong>.</p>
<p>Open your wp-comments-post.php file, and (in WP version 2.2.2) somewhere around line 31 add:</p>
<pre><code>$comment_verify = strtolower(trim($_POST['verify']));</code></pre>
<p>This will trim any whitespace from the answer to the challenge question, and convert the characters to lowercase.</p>
<p>Around line 45, find the lines:</p>
<pre><code>} else {
	if ( get_option('comment_registration') )
		wp_die( __('Sorry, you must be logged in to post a comment.') );
}
</code></pre>
<p>And add the following lines to them, as so:</p>
<pre><code>} else {
	if ( get_option('comment_registration') )
		wp_die( __('Sorry, you must be logged in to post a comment.') );
	if ( $comment_verify != 'green' )
		wp_die( __('Sorry, you must correctly answer the "Kermit" question to post a comment.') );
}
</code></pre>
<p>This will check the visitor&#8217;s answer against the correct answer, and if they don&#8217;t match, the script will stop and the comment won&#8217;t be submitted.  The visitor can hit the back button to change the answer.</p>
<p>Now we need to add the challenge question to the theme file comments.php.  Find the lines:</p>
<pre><code>
<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
<label for="url"><small>Website</small></label>

</code></pre>
<p>And right below them, add the following lines:</p>
<pre><code>
<input type="text" name="verify" id="verify" value="" size="22" tabindex="4" />
<label for="verify"><small>What color is Kermit the Frog? (anti-spam) (required)</small></label>

</code></pre>
<p>(You may need to update all the tabindex numbers after you add this field.)</p>
<p>That&#8217;s it, your visitors will now have to correctly answer the Kermit the Frog question to submit the form.</p>
<h2>Further customization</h2>
<p>The methods described here just scratch the surface of what can be done to obfuscate the comment handling script.  For example, the URL could be broken up into parts and saved as multiple variables.  It could have a name comprised of numbers, and the <code>commentScriptReveal</code> JavaScript could perform math to assemble it.  </p>
<p>I can&#8217;t imagine I&#8217;m the first person to come up with this, but&#8230; the user could be required to complete a challenge-response question, the correct answer to which would be used as part of the name of the script&#8212;the URL to the script doesn&#8217;t exist anywhere <i>until the visitor creates it</i>.</p>
<p>But, there are some people who don&#8217;t want to impose even a minor inconvenience on their visitors.  If you don&#8217;t like challenge-response tests, what about using JavaScript to invisibly check the screen resolution of the user agent?  And we haven&#8217;t even considered using cookies yet.</p>
<h3>Credits</h3>
<p>Many thanks to <a href="http://www.jeff-barr.com/">Jeff Barr</a> for demonstrating how to put a challenge-response test into the wp-comments-post.php file in his post <a href="http://www.jeff-barr.com/?p=103">WordPress Comment Verification (With Source Code)</a>.  I had been using only JavaScript for validation up until that point, shame on me.</p>
<p>Many thanks also to <a href="http://www.willmaster.com/">Will Bontrager</a> for writing a provocative explanation of how to temporarily hide the form processing script using JavaScript in <a href="http://www.willmaster.com/blog/javascript/spamming-with-forms.html">Spamming You Through Your Own Forms</a>.</p>
<p>Huge thanks to <a href="http://meyerweb.com/">Eric Meyer</a>, who wrote a pre-plugin, challenge-response test script called <a href="http://meyerweb.com/eric/tools/wordpress/wp-gatekeeper.html">WP-Gatekeeper</a> for a very early version of WordPress.</p>
<p>I&#8217;ve described two similar methods for <a href="http://www.ardamis.com/2007/07/12/defeating-contact-form-spam/">defeating contact form spam by hiding the webmail script</a> in an eariler post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ardamis.com/2007/09/12/defeating-wordpress-comment-spam/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Fixing warnings in the WordPress Sociable plugin</title>
		<link>http://www.ardamis.com/2007/09/02/fixing-warnings-in-the-wordpress-sociable-plugin/</link>
		<comments>http://www.ardamis.com/2007/09/02/fixing-warnings-in-the-wordpress-sociable-plugin/#comments</comments>
		<pubDate>Sun, 02 Sep 2007 18:08:17 +0000</pubDate>
		<dc:creator>ardamis</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.ardamis.com/2007/09/02/fixing-warnings-in-the-wordpress-sociable-plugin/</guid>
		<description><![CDATA[This plugin is once again actively supported. Please download the latest version from http://wordpress.org/extend/plugins/sociable/. I&#8217;ve fixed some errors that I was experiencing with version 2.0 (dated 2007-02-02) of the Sociable WordPress plugin by Peter Harkins. Specifically, when running WordPress 2.2+, I would get the following warnings when saving changes: Warning: implode() [function.implode]: Bad arguments. in [...]]]></description>
			<content:encoded><![CDATA[<div class="success">This plugin is once again actively supported.  Please download the latest version from <a href="http://wordpress.org/extend/plugins/sociable/">http://wordpress.org/extend/plugins/sociable/</a>.
</div>
<p>I&#8217;ve fixed some errors that I was experiencing with version 2.0 (dated 2007-02-02) of the <a href="http://push.cx/sociable">Sociable</a> WordPress plugin by <a href="http://push.cx/">Peter Harkins</a>.  Specifically, when running WordPress 2.2+, I would get the following warnings when saving changes:</p>
<pre><code>Warning: implode() [function.implode]: Bad arguments. in PATH\wp-content\plugins\sociable\sociable.php on line 651

Warning: Invalid argument supplied for foreach() in PATH\wp-content\plugins\sociable\sociable.php on line 762
</code></pre>
<p>For each button, I&#8217;d get another error:</p>
<pre><code>Warning: in_array() [function.in-array]: Wrong datatype for second argument in PATH\wp-content\plugins\sociable\sociable.php on line 797
</code></pre>
<p>I think I&#8217;ve narrowed the cause down to the way the plugin was writing the newly selected options to the database.</p>
<p>In addition to fixing those warnings, I also corrected a few behaviors:</p>
<ol>
<li>The StumbleUpon button didn&#8217;t send the URL to the correct address at http://www.stumbleupon.com/.  The button now works correctly, and also sends the page&#8217;s title.</li>
<li>In Options -> Sociable, leaving the field for &#8220;text displayed in front of the icons&#8221; blank now results in no extraneous code being inserted into the page.  Leaving the field blank also eliminates the popup &#8220;These icons link to social bookmarking sites&#8230;&#8221; text.</li>
<li>The links to the social networking sites are now all <code>rel="nofollow"</code>.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.ardamis.com/2007/09/02/fixing-warnings-in-the-wordpress-sociable-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A plugin for adding the post date to wp_get_archives</title>
		<link>http://www.ardamis.com/2007/06/25/adding-the-post-date-to-wp_get_archives/</link>
		<comments>http://www.ardamis.com/2007/06/25/adding-the-post-date-to-wp_get_archives/#comments</comments>
		<pubDate>Mon, 25 Jun 2007 05:48:18 +0000</pubDate>
		<dc:creator>ardamis</dc:creator>
				<category><![CDATA[Web Site Dev]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.ardamis.com/2007/06/25/adding-the-post-date-to-wp_get_archives/</guid>
		<description><![CDATA[The WordPress function wp_get_archives(&#8216;type=postbypost&#8217;) displays a lovely list of posts, but won&#8217;t show the date of each post. This plugin adds each post&#8217;s date to those &#8216;postbypost&#8217; lists, like so: Recently 07.30Ardamis.com&#8217;s Google Page Speed score is 93/100 07.21Ardamis.com is HTML5 07.17How to send the correct headers to leverage browser caching 07.14I want this Microsoft [...]]]></description>
			<content:encoded><![CDATA[<p>The WordPress function wp_get_archives(&#8216;type=postbypost&#8217;) displays a lovely list of posts, but won&#8217;t show the date of each post.  This plugin adds each post&#8217;s date to those &#8216;postbypost&#8217; lists, like so:</p>
<h3>Recently</h3>
<ul style="list-style: none">
<li><span class="recentdate">07.30</span><a href='http://www.ardamis.com/2010/07/30/ardamis-google-page-speed-score/' title='Ardamis.com&#8217;s Google Page Speed score is 93/100'>Ardamis.com&#8217;s Google Page Speed score is 93/100</a></li>
<li><span class="recentdate">07.21</span><a href='http://www.ardamis.com/2010/07/21/ardamis-com-is-html5/' title='Ardamis.com is HTML5'>Ardamis.com is HTML5</a></li>
<li><span class="recentdate">07.17</span><a href='http://www.ardamis.com/2010/07/17/sending-headers-to-leverage-browser-caching/' title='How to send the correct headers to leverage browser caching'>How to send the correct headers to leverage browser caching</a></li>
<li><span class="recentdate">07.14</span><a href='http://www.ardamis.com/2010/07/14/microsoft-lifecam-cinema/' title='I want this Microsoft LifeCam Cinema webcam'>I want this Microsoft LifeCam Cinema webcam</a></li>
<li><span class="recentdate">07.13</span><a href='http://www.ardamis.com/2010/07/13/one-million-inbound-links/' title='One million inbound links'>One million inbound links</a></li>
</ul>
<h3>Usage</h3>
<ol>
<li>Upload and activate the plugin</li>
<li>Edit your theme, replacing <code>wp_get_archives('type=postbypost')</code> with <code>ard_get_archives();</code></li>
</ol>
<p>The function <code>ard_get_archives();</code> replaces <code>wp_get_archives('type=postbypost')</code>, meaning you don&#8217;t need to specify <code>type=postbypost</code>.  You can use all of the wp_get_archives() parameters except &#8216;type&#8217; and &#8216;show_post_count&#8217; (limit, format, before, and after).  In addition, there&#8217;s a new parameter: <code>show_post_date</code>, that you can use to hide the date, but the plugin will show the date by default.</p>
<p><strong>show_post_date</strong><br />
<em>(boolean)</em> Display date of posts in an archive (1 &#8211; true) or do not (0 &#8211; false). For use with ard_get_archives(). Defaults to 1 (true).</p>
<h3>Customizing the date</h3>
<p>By default, the plugin displays the date as &#8220;(MM/DD/YYYY)&#8221;, but you can change this to use any standard <a href="http://www.php.net/date">PHP date characters</a> by editing the plugin at the line:</p>
<pre><code>$arc_date = date('m/d/Y', strtotime($arcresult->post_date));  // new</code></pre>
<p>The date is wrapped in <code><span class="recentdate"></code> tags, so you can style the date independently of the link.</p>
<h3>How does it work?</h3>
<p>The plugin replaces the &#8216;postbypost&#8217; part of the function wp_get_archives, and adds the date to $before.  The relevant code is below.  You can compare it to the corresponding lines in general-template.php.</p>
<pre><code>	} elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) {
		('alpha' == $type) ? $orderby = "post_title ASC " : $orderby = "post_date DESC ";
		$arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit");
		if ( $arcresults ) {
			$beforebefore = $before;  // new
			foreach ( $arcresults as $arcresult ) {
				if ( $arcresult->post_date != '0000-00-00 00:00:00' ) {
					$url  = get_permalink($arcresult);
					$arc_title = $arcresult->post_title;
					$arc_date = date('m/d/Y', strtotime($arcresult->post_date));  // new
					if ( $show_post_date )  // new
						$before = $beforebefore . '<span class="recentdate">' . $arc_date . '</span>';  // new
					if ( $arc_title )
						$text = strip_tags(apply_filters('the_title', $arc_title));
					else
						$text = $arcresult->ID;
					echo get_archives_link($url, $text, $format, $before, $after);
				}
			}
		}
	}
</code></pre>
<p>The lines ending in &#8216;// new&#8217; are the only changes.</p>
<p>So you want the date to appear after the title?  Edit the plugin to modify $after, instead:</p>
<pre><code>	} elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) {
		('alpha' == $type) ? $orderby = "post_title ASC " : $orderby = "post_date DESC ";
		$arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit");
		if ( $arcresults ) {
			$afterafter = $after;  // new
			foreach ( $arcresults as $arcresult ) {
				if ( $arcresult->post_date != '0000-00-00 00:00:00' ) {
					$url  = get_permalink($arcresult);
					$arc_title = $arcresult->post_title;
					$arc_date = date('j F Y', strtotime($arcresult->post_date));  // new
					if ( $show_post_date )  // new
						$after = '&nbsp;(' . $arc_date . ')' . $afterafter;  // new
					if ( $arc_title )
						$text = strip_tags(apply_filters('the_title', $arc_title));
					else
						$text = $arcresult->ID;
					echo get_archives_link($url, $text, $format, $before, $after);
				}
			}
		}
	}
</code></pre>
<h3>Download</h3>
<p>Get the files here: (Current version: 0.1 beta)</p>
<p class="download"><a href="http://www.ardamis.com/download-manager.php?id=14">Download the DateMe WordPress Plugin</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ardamis.com/2007/06/25/adding-the-post-date-to-wp_get_archives/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Halo 3 Service Record WordPress Plugin</title>
		<link>http://www.ardamis.com/2007/06/10/halo-3-service-record-wordpress-plugin/</link>
		<comments>http://www.ardamis.com/2007/06/10/halo-3-service-record-wordpress-plugin/#comments</comments>
		<pubDate>Sun, 10 Jun 2007 05:13:54 +0000</pubDate>
		<dc:creator>ardamis</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Web Site Dev]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.ardamis.com/2007/06/10/halo-3-service-record-wordpress-plugin/</guid>
		<description><![CDATA[This plugin allows you to add information from your Halo 3 Service Record to your WordPress blog.]]></description>
			<content:encoded><![CDATA[<div class="error"><strong>Update 7/31/10:</strong> I no longer support this plugin and have removed it from the site.  You can still download the code, if you like, but it needs to be updated before it will work correctly.
</div>
<p>This plugin allows you to add information from your Halo 3 Service Record to your WordPress blog.</p>
<p>The plugin displays your emblem, rank and grade, but with a little editing it could also display total the total number of games played, the date and time of the last game played, and any other information on the Halo 3 Service Record page at <a href="http://www.bungie.net/Stats/Halo3/Default.aspx?player=ardamis">Bungie.net</a>.</p>
<h3>Installation</h3>
<p>The download includes:</p>
<ul>
<li>ardamis-halo3.php (put this in your /plugins/ directory)</li>
<li>halo3stats.css (copy and paste the contents into your theme&#8217;s style.css)</li>
</ul>
<p>The plugin attempts to create a text file (halo3_cache_YOURTAG.txt) for use as a cache in your blog&#8217;s root folder automatically.  Some server configurations may not permit the plugin to create this file and you&#8217;ll see resultant errors; in this case, you may have to manually create a file with that name and upload it to your blog&#8217;s root (and perhaps set permissions).</p>
<h3>Usage</h3>
<p>The plugin accepts one argument: your gamertag.</p>
<p>Insert the code:</p>
<pre class="brush: php;">&lt;?php if (function_exists('ardamis_halo3')) ardamis_halo3('YOURTAG'); ?&gt;</pre>
<p>into a template file wherever you want the Service Record to appear, replacing YOURTAG with your actual Xbox Live gamertag, ex.:</p>
<pre class="brush: php;">&lt;?php if (function_exists('ardamis_halo3')) ardamis_halo3('ardamis'); ?&gt;</pre>
<h3>Download</h3>
<p>Get the files here: (Current version: 1.0 beta)</p>
<p class="download"><a href="http://www.ardamis.com/download-manager.php?id=9">Download the Halo 3 WordPress Plugin</a></p>
<h2>How can I add the Service Record to a post?</h2>
<p>Thanks to a really neat plugin, <a href="http://www.navidazimi.com/projects/wp-exec">The Execution of All Things</a>, you can call functions from any activated plugin from within a post.  Once you have both the Halo 3 Service Record plugin and the wp-exec plugin installed, you can include the sig in a post with the line:</p>
<pre class="brush: php;">&lt;exec type=&quot;function&quot; name=&quot;ardamis_halo3&quot; params=&quot;YOURTAG&quot; /&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ardamis.com/2007/06/10/halo-3-service-record-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Apricot &#8211; A Minimalist WordPress Theme</title>
		<link>http://www.ardamis.com/2007/06/03/apricot/</link>
		<comments>http://www.ardamis.com/2007/06/03/apricot/#comments</comments>
		<pubDate>Mon, 04 Jun 2007 04:44:28 +0000</pubDate>
		<dc:creator>ardamis</dc:creator>
				<category><![CDATA[Web Site Dev]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.ardamis.com/2007/06/03/apricot/</guid>
		<description><![CDATA[Apricot is a text-heavy and graphic-light, widget- and tag-supporting minimalist WordPress theme built on a Kubrick foundation. Apricot validates as XHTML 1.0 Strict and uses valid CSS. It natively supports the excellent Other Posts From Cat and the_excerpt Reloaded plugins, should you want to install them. WordPress version 2.3 introduces native support for &#8216;tags&#8217;, a [...]]]></description>
			<content:encoded><![CDATA[<p>Apricot is a text-heavy and graphic-light, widget- and tag-supporting minimalist WordPress theme built on a Kubrick foundation.  Apricot validates as XHTML 1.0 Strict and uses valid CSS.  It natively supports the excellent <a href="http://www.dagondesign.com/articles/other-posts-from-cat-plugin-for-wordpress/">Other Posts From Cat</a> and <a href="http://guff.szub.net/plugins/">the_excerpt Reloaded</a> plugins, should you want to install them.</p>
<p>WordPress version 2.3 introduces native support for &#8216;tags&#8217;, a method of organizing posts according to key words.  Apricot has been updated to use this native tag system.  The tag cloud will appear in the sidebar and the tags for each post appear above the meta data.</p>
<p>I used Apricot on this site for over a year, making little tweaks and adjustments the whole time, so the theme is pretty thoroughly tested in a variety of different browsers and resolutions.  While the markup is derived from the WordPress default theme, Kubrick, I&#8217;ve added a few modifications of my own.  I&#8217;ve listed some of these changes below.</p>
<h3>header.php</h3>
<ul>
<li>Title tag reconfigured to display &#8220;Page Title | Site Name&#8221;</li>
</ul>
<h3>single.php</h3>
<ul>
<li>Post title is now wrapped in H1 tags</li>
<li>Metadata shows when the post was last modified (if ever)</li>
<li><span  style="text-decoration: line-through;">Added links to social bookmarking/blog indexing sites:  Del.icio.us, Digg, Furl, Google Bookmarks, and Technorati</span><br/>I&#8217;ve published a <a href="http://www.ardamis.com/2007/09/02/fixing-warnings-in-the-wordpress-sociable-plugin/">fix for the Sociable plugin</a>, which I&#8217;m now using instead of hard-coded links</li>
<li>If the <a href="http://www.dagondesign.com/articles/other-posts-from-cat-plugin-for-wordpress/">Other Posts From Cat</a> plugin is active, the theme will use it</li>
<li>Comments by the post&#8217;s author can be styled independently</li>
</ul>
<h3>page.php</h3>
<ul>
<li>Displays the page&#8217;s last modified date (instead of date of publication)</li>
</ul>
<h3>index.php</h3>
<ul>
<li>Displays the full text of the latest post and an excerpt from each of the next nine most recent posts</li>
<li>Native support for <a href="http://guff.szub.net/plugins/">the_excerpt Reloaded</a> plugin, if active</li>
</ul>
<h3>sidebar.php</h3>
<ul>
<li>Displays tag cloud, if tags are enabled</li>
</ul>
<h3>search.php</h3>
<ul>
<li>If no results found, displays the site&#8217;s most recent five posts</li>
</ul>
<h3>404.php</h3>
<ul>
<li>Displays the site&#8217;s most recent five posts</li>
</ul>
<h3>footer.php</h3>
<ul>
<li>Archive and index page titles + blog name wrapped in H1 tags</li>
</ul>
<h3>Screen shot</h3>
<p><a class="hidelink" href="http://www.ardamis.com/images/apricot/apricot_full.png" title="Apricot - A WordPress theme by Ardamis.com"><img class="centered" src="http://www.ardamis.com/images/apricot/apricot_500.png" alt="Apricot - A WordPress theme by Ardamis.com" /></a></p>
<h2>Search engine optimization</h2>
<p>Apricot takes care of most of the on-page factors that Google values highly.  It places the post&#8217;s title at the beginning of the title tag and in a H1 tag near the top of the page.  It is free of extraneous markup and the navigation is easily spiderable.  It generates what I think is a pretty logical site structure from the various post and category pages, though I have yet to study the effect of the new tagging system.</p>
<p>I&#8217;ve had a few top-ranked pages with this and other structurally similar layouts.  Your mileage with the search engines may vary, but the layout uses fundamentally sound structural markup, which should give your site a good start.</p>
<h3>Download</h3>
<p class="download"><a href="http://www.ardamis.com/download-manager.php?id=10">Download the Apricot WordPress Theme</a> (40kb)</p>
<h3>What if I want to use an image as a header?</h3>
<p>Lots of people would rather use a graphic as a header, including me, but the WordPress guys insist on each theme uploaded to <a href="http://wordpress.org/extend/themes/">http://wordpress.org/extend/themes/</a> display the blog title and tag line.</p>
<p>If you want to replace the blog title and tag line with an image, download this zip file and follow these instructions (also included in readme.txt).</p>
<p>1. Make a PNG image, name it &#8220;header.png&#8221; and upload it to the /wp-content/themes/apricot/images/ folder.  It should be 800px wide by 130px tall, or less.</p>
<p>2. Replace the original Apricot theme&#8217;s header.php file with the header.php file from this folder.</p>
<p class="download"><a href="http://www.ardamis.com/download-manager.php?id=21">Download the Apricot Image Header</a> (4kb)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ardamis.com/2007/06/03/apricot/feed/</wfw:commentRss>
		<slash:comments>52</slash:comments>
		</item>
		<item>
		<title>Halo 2 Stats WordPress Plugin</title>
		<link>http://www.ardamis.com/2007/04/23/halo-2-stats-wordpress-plugin/</link>
		<comments>http://www.ardamis.com/2007/04/23/halo-2-stats-wordpress-plugin/#comments</comments>
		<pubDate>Mon, 23 Apr 2007 07:35:10 +0000</pubDate>
		<dc:creator>ardamis</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Web Site Dev]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.ardamis.com/2007/04/23/halo-2-stats-wordpress-plugin/</guid>
		<description><![CDATA[Update 7/31/10: I no longer support this plugin and have removed it from the site. You can still download the code, if you like, but it needs to be updated before it will work correctly. This plugin allows you to add an XHTML and CSS Halo 2 Stats sig to your WordPress blog, which you [...]]]></description>
			<content:encoded><![CDATA[<div class="error"><strong>Update 7/31/10:</strong> I no longer support this plugin and have removed it from the site.  You can still download the code, if you like, but it needs to be updated before it will work correctly.
</div>

<p>This plugin allows you to add an XHTML and CSS Halo 2 Stats sig to your WordPress blog, which you can then style to fit your layout.  The plugin displays your emblem, your level in each of the ranked game types, and your overall rank, which is equal to the highest ranked gametype.  If Bungie calculates this differently, I can&#8217;t tell.  It also displays the total number of games played and the date and time of your last game.  By default, the plugin uses the background from your profile page at Bungie.net: <a href="http://www.bungie.net/Account/Profile.aspx?player=ardamis">http://www.bungie.net/Account/Profile.aspx?player=ardamis</a>.  You can change this in your profile preferences.</p>

<p>It&#8217;s a pretty neat set up already, but the best part is that because it&#8217;s all XHTML and CSS, it is completely customizable.  Change the font or the colors, move the elements around, even hide some of them, whatever, to suit your site.  If you&#8217;re comfortable with PHP, you can even edit the plugin to display more or less information.  I&#8217;ve written a brief explanation about how the plugin grabs the data in the post at <a href="http://www.ardamis.com/2007/03/29/xbox-360-gamercard-wordpress-plugin/">Xbox 360 Gamercard WordPress Plugin</a>.</p>

<h3>Installation</h3>

<p>The download includes:</p>
<ul>
<li>halo2stats.php (put this in your /plugins/ directory)</li>
<li>halo2stats.css (copy and paste the contents into your theme&#8217;s style.css)</li>
</ul>

<p>The plugin attempts to create a text file (halo2_cache_YOURTAG.txt) for use as a cache in your blog&#8217;s root folder automatically.  Some server configurations may not permit the plugin to create this file and you&#8217;ll see resultant errors; in this case, you may have to manually create a file with that name and upload it to your blog&#8217;s root (and perhaps set permissions).</p>

<h3>Usage</h3>

<p>The plugin accepts two arguments: your gamertag and &#8216;nolinks&#8217;, a parameter to hide links to this page, the detailed game stats from Bungie.net, and the recent games RSS feed.</p>

<p>Insert the code:</p>

<pre class="brush: php;">&lt;?php if (function_exists('ardamis_halo2')) ardamis_halo2('YOURTAG'); ?&gt;</pre>

<p>into a template file wherever you want the sig to appear, replacing YOURTAG with your actual Xbox Live gamertag, ex.:</p>

<pre class="brush: php;">&lt;?php if (function_exists('ardamis_halo2')) ardamis_halo2('ardamis'); ?&gt;</pre>

<p>If you don&#8217;t want to display the various off-site links, add the &#8216;nolinks&#8217; argument:</p>

<pre class="brush: php;">&lt;?php if (function_exists('ardamis_halo2')) ardamis_halo2('YOURTAG',nolinks); ?&gt;</pre>

<h3>Limitations</h3>

<p>The data we are interested in is served as HTML, not RSS.   Incorporating an RSS feed into a page is pretty simple.  Bungie does offer an RSS feed of recent game stats, but the feed is missing some crucial player stats, such as overall rank, rank by game type, games played and won per game type, and percentage experience needed for the next rank.   All of this information, except the overall ranking, is available on <a href="http://www.bungie.net/Stats/PlayerStats.aspx?player=ardamis">Bungie&#8217;s player stats page</a>.  I don&#8217;t need all of this data, but I would like to be able to see my overall ranking.  Unfortunately (there always seems to be an unfortunately), the Bungie player stats page doesn&#8217;t always provide accurate and complete information (you&#8217;ll often see an incorrect &#8220;No Games Played&#8221; message in place of your rank for a specific game type), and each change Bungie makes to that page has the potential to break the plugin.  This is because the regular expression matching method I use to extract it expects to see specific lines of HTML code in the page.  Should the layout change, the plugin might not find what it&#8217;s looking for, and so the whole system is both unreliable and fragile.   For example, the plugin would have broken when Bungie changed the site around to add a section for Halo 3 stats, and it broke when the stats were reset and the new maps added on May 10, 2007.  I&#8217;ll try to maintain this thing and quickly update it if/when Bungie&#8217;s changes break it, but I&#8217;m making no promises about future performance or usability.</p>

<p>The plugin takes the ranking for each game type and then sorts through them to find the highest one.  The highest individual game type ranking is displayed as the player&#8217;s overall ranking.   If Bungie has a more sophisticated method of determining overall rank, I&#8217;m not aware of it.  But because of the occasional &#8220;No Games Played&#8221; message, the overall ranking might be incorrect.</p>

<h3>Download</h3>

<p>Get the files here: (Current version: 1.4 beta)</p>

<p class="download"><a href="http://www.ardamis.com/download-manager.php?id=6">Download the Halo 2 Stats WordPress Plugin</a></p>

<h2>Can I get this as a WordPress Widget?</h2>

<p>Honestly, the plugin is much more flexible than a widget.  Widgets are limited to your sidebar, while the plugin can be used in any template.  Furthermore, this thing is 420 pixels wide, is that going to fit in your sidebar?  Maybe some day when I have nothing else coming down the pike I&#8217;ll modify my plugins to be used as widgets, but not today.</p>

<h2>How can I add the stats to a post?</h2>

<p>Thanks to a really neat plugin, <a href="http://www.navidazimi.com/projects/wp-exec">The Execution of All Things</a>, you can call functions from any activated plugin from within a post.  Once you have both the Halo 2 stats plugin and the wp-exec plugin installed, you can include the sig in a post with the line:</p>

<pre class="brush: php;">&lt;exec type=&quot;function&quot; name=&quot;ardamis_halo2&quot; params=&quot;YOURTAG&quot; /&gt;</pre>

<h2>How can I add the stats to a non-WordPress site?</h2>

<p>I&#8217;ve been asked a few times for a way to get the same functionality outside of WordPress.  I&#8217;ve put together a PHP script that you can include from any page with the line:</p>

<pre class="brush: php;">&lt;?php include 'FULL-PATH-TO-SCRIPT/halo2stats-standalone.php?h2tag=YOURTAG'; ?&gt;</pre>

<p>Obviously, you&#8217;ll replace &#8216;YOURTAG&#8217; with your gamertag.  If you have spaces in your gamertag, replace each space with <code>%20</code>.

<p class="download"><a href="http://www.ardamis.com/download-manager.php?id=8">Download the Halo 2 Stats Standalone Script</a></p>

<h3>I&#8217;m getting an error message</h3>

<p>If your server does not have cURL enabled, you&#8217;ll get an error message that reads something like <code>Fatal error: Call to undefined function curl_init() in PATH\wp-content\plugins\halo2stats.php on line 64</code>.  The best solution is to ask your host to recompile PHP with cURL.  If that option is unavailable, I&#8217;ve provided an alternative plugin that uses the function file_get_contents(), but a number of hosts have disabled the URL retrieving capabilities in file_get_contents() for security reasons.  <a href="http://www.ardamis.com/download-manager.php?id=13">Download the FGC Halo 2 Stats WordPress Plugin</a> only if you are getting an error message with the regular download.</p>

<p>If you are trying to use the stand-alone script, but getting an error message similar to <code>Warning: include(halo2stats-standalone.php?h2tag=YOURTAG) [function.include]: failed to open stream: Invalid argument in PATH</code>, you are not using the full URL in the path to the stand-alone script.  You must use the full URL in your include whenever you use variables in the URL.  Otherwise, the server looks for a file named halo2stats-standalone.php?h2tag=YOURTAG instead of executing the file halo2stats-standalone.php with the variable ?h2tag=YOURTAG.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ardamis.com/2007/04/23/halo-2-stats-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Xbox 360 Gamercard WordPress Plugin</title>
		<link>http://www.ardamis.com/2007/03/29/xbox-360-gamercard-wordpress-plugin/</link>
		<comments>http://www.ardamis.com/2007/03/29/xbox-360-gamercard-wordpress-plugin/#comments</comments>
		<pubDate>Thu, 29 Mar 2007 06:51:29 +0000</pubDate>
		<dc:creator>ardamis</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Web Site Dev]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.ardamis.com/2007/03/29/xbox-360-gamercard-wordpress-plugin/</guid>
		<description><![CDATA[A WordPress plugin that will display a customizable XHTML and CSS Xbox 360 gamer card.]]></description>
			<content:encoded><![CDATA[<link rel="stylesheet" href="http://www.ardamis.com/wp-content/themes/salinger/gamercard.css" type="text/css" />

<p>I&#8217;ve put together a WordPress plugin that will display a customizable XHTML and CSS Xbox 360 gamer card.  There are plenty of sites out there that will make good looking gamer cards using image files, but this method will give you complete control over the appearance.  It also acts like a gamer card, with a link to your Xbox Live profile and &#8220;compare to&#8221; links to your five most recently played games, something the image file cards can&#8217;t do.</p>

<p>For those of you who want a raw PHP script with the same functionality, I&#8217;ve included one farther down in the post.</p>

<div class="isolate">

		<div class="gamercard">
	<div class="gamertag"><a class="links" href="http://www.ardamis.com/2007/03/29/xbox-360-gamercard-wordpress-plugin/" title="Xbox 360 Gamercard WordPress Plugin">&#176;</a><a class="taglink" href="http://live.xbox.com/member/ardamis">ardamis</a></div>
	<div class="stats">
		<a href="http://live.xbox.com/member/ardamis"><img class="gamerimg" src="http://avatar.xboxlive.com/avatar/ardamis/avatarpic-l.png" alt="" title="" /></a>
		<div><span class="gcinfo"><img class="repimg" alt="Reputation for ardamis" src="http://www.ardamis.com/images/gc_images/rep20.png" /></span>Rep:</div>
		<div><span class="gcinfo">5485</span>Gamerscore:</div>
		<div><span class="gcinfo">Recreation</span>Zone:</div>
    </div></div>
</div>

<h2>How the plugin works</h2>

<p>The plugin uses <a href="http://curl.haxx.se/">cURL</a>, a command line tool for transferring files with URL syntax, to read the contents of your Xbox Live gamer card from http://gamercard.xbox.com/YOURTAG.card into a string, and then uses the PHP function <strong>preg_match</strong> to perform regular expression matching on that string.  The various elements of your gamer card are extracted and then assigned to variables for later output.</p>

<p>The plugin attempts to create a unique text file for each gamertag (gamercard_cache_YOURTAG.txt) for use as a cache in your blog&#8217;s root folder automatically.  This is done to reduce the number of times the target HTML page must be accessed and parsed and therefore reduce server load and page load time.  Some server configurations may not permit the plugin to create this file and you&#8217;ll see resultant errors; in this case, you may have to upload a file with that name and perhaps set permissions on the file.  You can edit the plugin to adjust how old the cache can grow before the script refreshes the information from gamercard.xbox.com.</p>

<h3>Usage</h3>

<p>The plugin accepts two arguments: the first is your gamertag; the second, which is optional, toggles whether the recently played games are displayed.</p>

<p>Insert the code:</p>

<pre class="brush: php;">&lt;?php if (function_exists('gamercard')) gamercard('YOURTAG'); ?&gt;</pre>

<p>into a template file wherever you want the gamer card to appear, replacing YOURTAG with your actual Xbox Live gamertag, ex.:</p>

<pre class="brush: php;">&lt;?php if (function_exists('gamercard')) gamercard('ardamis'); ?&gt;</pre>

<p>You can include multiple, different gamer cards on each page.</p>

<h3>Customization</h3>

<p>To show the recently played games icons, add the &#8220;full&#8221; argument, ex.:</p>

<pre class="brush: php;">&lt;?php if (function_exists('gamercard')) gamercard('ardamis', full); ?&gt;</pre>

<div class="isolate">

		<div class="gamercard">
	<div class="gamertag"><a class="links" href="http://www.ardamis.com/2007/03/29/xbox-360-gamercard-wordpress-plugin/" title="Xbox 360 Gamercard WordPress Plugin">&#176;</a><a class="taglink" href="http://live.xbox.com/member/ardamis">ardamis</a></div>
	<div class="stats">
		<a href="http://live.xbox.com/member/ardamis"><img class="gamerimg" src="http://avatar.xboxlive.com/avatar/ardamis/avatarpic-l.png" alt="" title="" /></a>
		<div><span class="gcinfo"><img class="repimg" alt="Reputation for ardamis" src="http://www.ardamis.com/images/gc_images/rep20.png" /></span>Rep:</div>
		<div><span class="gcinfo">5485</span>Gamerscore:</div>
		<div><span class="gcinfo">Recreation</span>Zone:</div>
    </div><div class="playedgames"><a href="http://live.xbox.com/en-US/profile/Achievements/ViewAchievementDetails.aspx?tid=%09%5d%3adh)k%3f%0bq&amp;compareTo=ardamis"><img height="32" width="32" title="Mass Effect 2" alt="" src="http://tiles.xbox.com/tiles/HY/t-/0Gdsb2JgbA9ECgQNGwEfViwmL2ljb24vMC84MDAwIAABAAAAAP9QiwI=.jpg" /></a><a href="http://live.xbox.com/en-US/profile/Achievements/ViewAchievementDetails.aspx?tid=%09%5d%3a%12%1e)kFu%02&amp;compareTo=ardamis"><img height="32" width="32" title="LEGO Star Wars II" alt="" src="http://tiles.xbox.com/tiles/1G/ce/0Gdsb2JgbA9ECgR7GwEfWStSL2ljb24vMC84MDAwIAABAAAAAP8xZ8s=.jpg" /></a><a href="http://live.xbox.com/en-US/profile/Achievements/ViewAchievementDetails.aspx?tid=%09%5d%3bco(j7%05%07&amp;compareTo=ardamis"><img height="32" width="32" title="FINAL FANTASY XIII" alt="" src="http://tiles.xbox.com/tiles/LD/p7/1Gdsb2JgbA9ECgULGgEfWSpXL2ljb24vMC84MDAwIAABAAAAAPtUOjM=.jpg" /></a><a href="http://live.xbox.com/en-US/profile/Achievements/ViewAchievementDetails.aspx?tid=%09%5d%3a%60m%2fl%3b%7cw&amp;compareTo=ardamis"><img height="32" width="32" title="Modern Warfare® 2" alt="" src="http://tiles.xbox.com/tiles/Z+/tF/12dsb2JgbA9ECgQJGgYfVl5UL2ljb24vMC84MDAwIAABAAAAAPhq63g=.jpg" /></a><a href="http://live.xbox.com/en-US/profile/Achievements/ViewAchievementDetails.aspx?tid=%09%5d%3bdh-o0%03%0f&amp;compareTo=ardamis"><img height="32" width="32" title="BioShock" alt="" src="http://tiles.xbox.com/tiles/jY/S4/1mdsb2JgbA9ECgUMGgQfWStbL2ljb24vMC84MDAwIAABAAAAAPmXhJI=.jpg" /></a></div></div>
</div>

<p>Do whatever you want with the CSS to integrate the gamer card into your site.</p>

<h3>Installation</h3>

<p>The download includes:</p>
<ul>
<li>xbox-gamercard.php (put this in your /plugins/ directory)</li>
<li>gamercard.css (copy and paste the contents into your theme&#8217;s style.css)</li>
<li>/gc_images/ (optional &#8211; put this folder of reputation images in your WordPress theme&#8217;s /images/ folder if you want to use them)</li>
</ul>

<p>The plugin by default now uses the gold stars with transparent background from the &#8216;mini-card&#8217; in the top navigation of <a href="http://www.xbox.com/">http://www.xbox.com/</a>.  The rep image is a transparent .png, however.  If you&#8217;re worried that people using IE6 will see an ugly rep because of IE6&#8242;s lack of support for transparent .png, you may want to edit the plugin to use a different rep image.  It&#8217;s easy.</p>

<div class="isolate">
<img style="padding:2px; border: 1px solid #cacaca" src="http://www.ardamis.com/images/xbox-com.jpg" alt="screen shot of mini-card from Xbox.com" />
<p>a screen shot of the &#8216;mini-card&#8217; from Xbox.com</p>
</div>

	
<p>The optional &#8216;gc_images&#8217; folder contains 20 images, one for each reputation rank, to replace the default gamercard gauge.   They are based on the gauge used in the smaller, menu bar gamercard on the old http://live.xbox.com/ site, but with transparent backgrounds instead of gray for greater flexibility.  You don&#8217;t need to use these, of course.  I&#8217;ve written 3 variables into the plugin if you want to use the official Xbox rep images.  Just edit the plugin to replace <strong>$navgamerrep</strong> in the output with one of the other variables. (Seriously, it&#8217;s easy.)</p>

<h3>Download (beta 1.3)</h3>

<p>Get the files here:</p>

<p class="download"><a href="http://www.ardamis.com/download-manager.php?id=5">Download the Xbox 360 Gamer Card WordPress Plugin</a></p>

<h3>I&#8217;m getting an error message</h3>

<p>If your server does not have cURL enabled, you&#8217;ll get an error message that reads something like <strong>Fatal error: Call to undefined function curl_init() in PATH\wp-content\plugins\xbox-gamercard.php on line 54</strong>.  The best solution is to ask your host to enable cURL.  If that option is unavailable, I&#8217;ve provided an alternative that uses the function file_get_contents(), but a number of hosts have disabled the URL retrieving capabilities in file_get_contents() for security reasons.  <a href="http://www.ardamis.com/download-manager.php?id=7">Download the FGC Gamer Card WordPress Plugin</a> only if you&#8217;re getting an error message with the regular download.</p>

<h2>Can I get this as a WordPress Widget?</h2>

<p>Honestly, the plugin is much more flexible than a widget.  Widgets are limited to your sidebar, while the plugin can be used in any template.  Installing the plugin isn&#8217;t very complicated, either.  So, in short, there are no plans to adapt this as a widget right now.</p>

<h2>How can I use this on a non-WordPress site?</h2>

<p class="download"><a href="http://www.ardamis.com/download-manager.php?id=15">Download the Xbox 360 Gamer Card Stand-alone Script</a></p>

<p>Just PHP include the xbox-gamercard-standalone.php script wherever you want the card to be displayed, adjusting the path to the reputation images.  Add the contents of gamercard.css to your main CSS file, and modify to suit your site.</p>

<p>Be aware that message boards and forums (eg: vBulletin forums) won&#8217;t allow you to use PHP as part of your post or signature.  In short, don&#8217;t expect this method to work anywhere but on your own site.</p>

<p>You can either edit the script to use your gamertag, or call the script with the line:</p>

<pre class="brush: php;">&lt;?php include 'PATH-TO-SCRIPT/xbox-gamercard-standalone.php?tag=YOURTAG'; ?&gt;</pre>

<p>To show the recent games, use:</p>

<pre class="brush: php;">&lt;?php include 'PATH-TO-SCRIPT/xbox-gamercard-standalone.php?tag=YOURTAG&amp;full=full'; ?&gt;</pre>

<p>Obviously, you&#8217;ll replace &#8216;YOURTAG&#8217; with your gamertag. If you have any spaces in your gamertag, replace each space with <strong>%20</strong>.</p>

<h3>Further customization (optional)</h3>

<p>A number of neat image and Flash sigs contain way more information than just what&#8217;s provided at http://gamercard.xbox.com/YOURTAG.card, but as far as I can tell, it&#8217;s all gathered in the same way. If there&#8217;s something you&#8217;d like added to the script, find a page that contains the information and post a comment about it, or give programming a shot yourself&#8230;</p>

<p>View the source code of the target page and locate the data you wish to extract.  What we want to do is identify everything <strong>but</strong> the desired data.  Isolate the desired data within the source code of the target page by copying everything from the first character before the data back to and including something unique, such as a div&#8217;s id.  Paste that into a <strong>preg_match</strong> line as the first half of the pattern that the script will look for.  Follow that with the characters <strong>(.+?)</strong>, a bit of code that represents the data we want to extract.  Do not copy the actual desired data from the target page into the modified script.  Last, select and copy a few characters immediately after the data, such as the closing div, and paste that after the <strong>(.+?)</strong>.  Everything in between the two copied strings&#8212;the stuff now represented by the <strong>(.+?)</strong> characters&#8212;will be assigned to a variable.</p>

<h3>Credits</h3>

<p>Thanks to <a href="http://consti.de/">Constantin Hofstetter</a> for getting me started on this project and to Jeremy at <a href="http://www.360gamercards.com/">360gamerCards.com</a> for eliminating the need for the Snoopy script, reducing the process to a single file and otherwise greatly simplifying the whole thing. And thanks to everyone who emailed or posted with error messages and other problems; it&#8217;s a better, more robust plugin because of your efforts.</p>

<p>My gamertag is <strong>ardamis</strong>, should you want to <a href="http://live.xbox.com/en-US/profile/Friends.aspx">add me to your friends list</a> and give me some positive feedback.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ardamis.com/2007/03/29/xbox-360-gamercard-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>84</slash:comments>
		</item>
		<item>
		<title>WordPress comments feed in Google&#8217;s Supplemental Index</title>
		<link>http://www.ardamis.com/2007/01/13/wordpress-comments-feed-in-googles-supplemental-index/</link>
		<comments>http://www.ardamis.com/2007/01/13/wordpress-comments-feed-in-googles-supplemental-index/#comments</comments>
		<pubDate>Sat, 13 Jan 2007 07:58:27 +0000</pubDate>
		<dc:creator>ardamis</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Web Site Dev]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.ardamis.com/2007/01/13/wordpress-comments-feed-in-googles-supplemental-index/</guid>
		<description><![CDATA[I was tired of seeing the majority of my posts&#8217; comments feeds show up in Google&#8217;s Supplemental Index, so I changed all the individual posts&#8217; comments RSS links to rel=&#8221;nofollow&#8221;. This should at least cause Googlebot to stop passing PageRank through those links, but what I really want is for Googlebot to stop spidering the [...]]]></description>
			<content:encoded><![CDATA[<p>I was tired of seeing the majority of my posts&#8217; comments feeds show up in Google&#8217;s Supplemental Index, so I changed all the individual posts&#8217; comments RSS links to rel=&#8221;nofollow&#8221;.  This should at least cause Googlebot to stop passing PageRank through those links, but what I really want is for Googlebot to stop spidering the individual posts&#8217; comment feeds, in hopes that they&#8217;ll eventually be removed from the index. To see only those pages of a site that are in the Supplemental Index, use this neat little search feature: <code>site:DOMAIN.com *** -view</code>.  For example, to see which pages of Ardamis.com are in the SI, I&#8217;d search for: <code>site:ardamis.com *** -view</code>.  This is much easier than the old way of scanning all of the indexed pages and picking them out by hand.</p>
<p>To change all the individual posts&#8217; comments feed links to rel=&#8221;nofollow&#8221;, open &#8216;\wp-includes\feed-functions.php&#8217; and add rel=&#8221;nofollow&#8221; to line 84 (in WordPress version 2.0.6), as so:</p>
<pre><code>echo "<a href=\"$url\" rel=\"nofollow\">$link_text</a>";
</code></pre>
<p>One could use the robots.txt file to disallow Googlebot from all /feed/ directories, but this would also restrict it from the general site&#8217;s feed and the all-inclusive /comments/feed/, and I&#8217;d like the both of these feeds to continue to be spidered. Another, minor consequence of using robots.txt to restrict Googlebot is that Google Sitemaps will warn you of &#8220;URLs restricted by robots.txt&#8221;.</p>
<p>To deny all spiders from any /feed/ directory, add the following to your robots.txt file:</p>
<pre>
User-agent:*
Disallow: /feed/
</pre>
<p>To deny just Googlebot from any /feed/ directory, use:</p>
<pre>
User-agent: Googlebot
Disallow: /feed/
</pre>
<p>For whatever reason, the whole-site comments feed at <a href="feed:http://www.ardamis.com/comments/feed/">http://www.ardamis.com/comments/feed/</a> does not appear among my indexed pages, while the nearly empty individual post feeds are indexed.  Also, the general site feed at <a href="http://www.ardamis.com/feed/">http://www.ardamis.com/feed/</a> is in the Supplemental Index.  It&#8217;s a mystery to me why.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ardamis.com/2007/01/13/wordpress-comments-feed-in-googles-supplemental-index/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
