<?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>JSEDLAK &#187; WordPress</title>
	<atom:link href="http://jsedlak.org/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://jsedlak.org</link>
	<description></description>
	<lastBuildDate>Wed, 01 Sep 2010 00:44:02 +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>Well That Didn&#8217;t Last Long&#8230;</title>
		<link>http://jsedlak.org/2008/10/15/well-that-didnt-last-long/</link>
		<comments>http://jsedlak.org/2008/10/15/well-that-didnt-last-long/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 07:22:51 +0000</pubDate>
		<dc:creator>John Sedlak</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Theming]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://jsedlak.com/?p=112</guid>
		<description><![CDATA[Seems as though I am going through a new theme every couple of days. I really liked the last one, but it would have taken a tad too much work to get it to work well with putting code in posts. This one seems a little better suited for that.]]></description>
			<content:encoded><![CDATA[<p>Seems as though I am going through a new theme every couple of days. I really liked the last one, but it would have taken a tad too much work to get it to work well with putting code in posts. This one seems a little better suited for that.</p>
]]></content:encoded>
			<wfw:commentRss>http://jsedlak.org/2008/10/15/well-that-didnt-last-long/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Filtering Comments Via IP in WordPress</title>
		<link>http://jsedlak.org/2008/09/25/filtering-comments-via-ip-in-wordpress/</link>
		<comments>http://jsedlak.org/2008/09/25/filtering-comments-via-ip-in-wordpress/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 13:29:12 +0000</pubDate>
		<dc:creator>John Sedlak</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://jsedlak.com/?p=97</guid>
		<description><![CDATA[One feature that is missing in WordPress is a decent way to filter out comments by IP Address. I decided to tackle that today. First I will do it via a quick hack and then expand it to more tightly integrate with the backend. If someone would like to figure out how to make it [...]]]></description>
			<content:encoded><![CDATA[<p>One feature that is missing in WordPress is a decent way to filter out comments by IP Address. I decided to tackle that today. First I will do it via a quick hack and then expand it to more tightly integrate with the backend. If someone would like to figure out how to make it a plugin, that would be awesome.</p>
<ol>
<li>First you need to add a table to the WordPress database. I named mine wp_banned and added a simple column: IpAddress.</li>
<li>Open up /wp-includes/comment.php and look around line 676 for the wp_new_comment function. Add the following to the beginning:

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p97code2'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p972"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p97code2"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$testIp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'/[^0-9a-fA-F:., ]/'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REMOTE_ADDR'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$ipResults</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 wp_banned WHERE IpAddress = '&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$testIp</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ipResults</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
<li>Upload, add ips to the database and then watch them not appear anymore.</li>
</ol>
<p>Now I just need to figure out how to add some nice buttons to the comment page to &#8220;Ban and Spam&#8221; comments&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://jsedlak.org/2008/09/25/filtering-comments-via-ip-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
