<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>Peter&#039;s Useful Crap - Topic: plugin not working</title>
	<link>http://www.theblog.ca/peter-forum/peters-custom-anti-spam-for-wordpress/plugin-not-working-1</link>
	<description><![CDATA[Useful tips on Canada, cell phones, banking, technology, WordPress, PHP and more]]></description>
	<generator>Simple:Press Version 5.5.1</generator>
	<atom:link href="http://www.theblog.ca/peter-forum/peters-custom-anti-spam-for-wordpress/plugin-not-working-1/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Peter on plugin not working</title>
        	<link>http://www.theblog.ca/peter-forum/peters-custom-anti-spam-for-wordpress/plugin-not-working-1#p731</link>
        	<category>Peter's Custom Anti-Spam for WordPress</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-custom-anti-spam-for-wordpress/plugin-not-working-1#p731</guid>
        	        	<description><![CDATA[<p>In a nutshell, this is how I created the "friendlier anti-spam" error pages for the plugin on theblog.ca.  I don't wish to give specific template instructions because the nuances of the template code would be different for each person's theme.</p>
<p><strong>1. Tweak the way the plugin processes anti-spam word errors</strong></p>
<p>Instead of the die() commands in the plugin, make WordPress load some custom error template files. In <em>wp-content/plugins/custom-anti-spam/custom_anti_spam.php</em>:</p>
<p>Replace: </p>
<p><input type="button" class="sfcodeselect" name="sfselectit2942" value="Select Code" onclick="spjSelectCode('sfcode2942');" /></p>
<div class="sfcode" id="sfcode2942">
if ( $securitycode == &#39;&#39; )<br />
{<br />
    die(&#34;&#60;p&#62;{$cas_displaytext[&#39;emptyfield&#39;]}&#60;/p&#62;\\n&#60;p&#62;{$cas_displaytext[&#39;copyfield&#39;]}&#60;/p&#62;\\n&#60;textarea cols=\\&#34;100%\\&#34; rows=\\&#34;10\\&#34; onclick=\\&#34;this.select();\\&#34; readonly=\\&#34;true\\&#34;&#62;$commentbody&#60;/textarea&#62;&#34;);<br />
}
</div>
<p>With:</p>
<p><input type="button" class="sfcodeselect" name="sfselectit9504" value="Select Code" onclick="spjSelectCode('sfcode9504');" /></p>
<div class="sfcode" id="sfcode9504">
if ( $securitycode == &#39;&#39; )<br />
{<br />
    include (TEMPLATEPATH . &#39;/comments-error.php&#39;);<br />
    exit();<br />
}
</div>
<p>Replace:</p>
<p><input type="button" class="sfcodeselect" name="sfselectit3117" value="Select Code" onclick="spjSelectCode('sfcode3117');" /></p>
<div class="sfcode" id="sfcode3117">
// If this row doesn&#39;t exist, say something<br />
if (is_null($matchthis)) die(&#34;&#60;p&#62;{$cas_displaytext[&#39;alreadyused&#39;]}&#60;/p&#62;\\n&#60;p&#62;{$cas_displaytext[&#39;copyfield&#39;]}&#60;/p&#62;\\n&#60;textarea cols=\\&#34;100%\\&#34; rows=\\&#34;10\\&#34; onclick=\\&#34;this.select();\\&#34; readonly=\\&#34;true\\&#34;&#62;$commentbody&#60;/textarea&#62;&#34;);
</div>
<p>With:</p>
<p><input type="button" class="sfcodeselect" name="sfselectit6662" value="Select Code" onclick="spjSelectCode('sfcode6662');" /></p>
<div class="sfcode" id="sfcode6662">
// If this row doesn&#39;t exist, say something<br />
if (is_null($matchthis)) {<br />
    include (TEMPLATEPATH . &#39;/comments-expired.php&#39;);<br />
    exit();<br />
}
</div>
<p>Replace:</p>
<p><input type="button" class="sfcodeselect" name="sfselectit2549" value="Select Code" onclick="spjSelectCode('sfcode2549');" /></p>
<div class="sfcode" id="sfcode2549">
if ( strtolower( $matchthis ) != strtolower( $securitycode ) )<br />
{<br />
    die(&#34;&#60;p&#62;{$cas_displaytext[&#39;wrongfield&#39;]}&#60;/p&#62;\\n&#60;p&#62;{$cas_displaytext[&#39;copyfield&#39;]}&#60;/p&#62;\\n&#60;textarea cols=\\&#34;100%\\&#34; rows=\\&#34;10\\&#34; onclick=\\&#34;this.select();\\&#34; readonly=\\&#34;true\\&#34;&#62;$commentbody&#60;/textarea&#62;&#34;);<br />
}
</div>
<p>With:</p>
<p><input type="button" class="sfcodeselect" name="sfselectit6624" value="Select Code" onclick="spjSelectCode('sfcode6624');" /></p>
<div class="sfcode" id="sfcode6624">
if ( strtolower( $matchthis ) != strtolower( $securitycode ) ) {<br />
    include (TEMPLATEPATH . &#39;/comments-error.php&#39;);<br />
    exit();<br />
}
</div>
<p><strong>2. Create custom error templates</strong></p>
<p>Create some templates <em>comments-error.php</em> and <em>comments-expired.php</em>. These should contain the comment form from your default theme, the header, sidebar, and footer as required by a full page, and some descriptive error text.  If you can get this part right, users are presented with an error page but a blank form.</p>
<p><strong>3. Fill in the error templates' comment form with the posted information.</strong></p>
<p>For each field in your form (name, e-mail address, comment, etc.) print the values of the posted information, so that users don't have to enter their information again.  For example, the code for the name field would look like this:</p>
<p><input type="button" class="sfcodeselect" name="sfselectit2028" value="Select Code" onclick="spjSelectCode('sfcode2028');" /></p>
<div class="sfcode" id="sfcode2028">&#60;p&#62;&#60;input type=&#34;text&#34; name=&#34;author&#34; id=&#34;author&#34; value=&#34;&#60;?php print stripslashes(htmlentities($_POST[&#39;author&#39;],ENT_QUOTES)); ?&#62;&#34; size=&#34;22&#34; tabindex=&#34;1&#34; /&#62;<br />
&#60;label for=&#34;author&#34;&#62;&#60;small&#62;Name &#60;?php if ($req) echo &#34;(required)&#34;; ?&#62;&#60;/small&#62;&#60;/label&#62;&#60;/p&#62;</div>
]]></description>
        	        	<pubDate>Sun, 19 Oct 2008 01:06:41 +0000</pubDate>
        </item>
        <item>
        	<title>Peter on plugin not working</title>
        	<link>http://www.theblog.ca/peter-forum/peters-custom-anti-spam-for-wordpress/plugin-not-working-1#p728</link>
        	<category>Peter's Custom Anti-Spam for WordPress</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-custom-anti-spam-for-wordpress/plugin-not-working-1#p728</guid>
        	        	<description><![CDATA[<p>Hi, yes that is the default behaviour.</p>
]]></description>
        	        	<pubDate>Thu, 16 Oct 2008 11:18:52 +0000</pubDate>
        </item>
        <item>
        	<title>Stephane on plugin not working</title>
        	<link>http://www.theblog.ca/peter-forum/peters-custom-anti-spam-for-wordpress/plugin-not-working-1#p727</link>
        	<category>Peter's Custom Anti-Spam for WordPress</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-custom-anti-spam-for-wordpress/plugin-not-working-1#p727</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>i wanted to say that the only part of the page displayed is the error message and the textarea, all other part is absent</p>
<p>Stephane</p>
]]></description>
        	        	<pubDate>Thu, 16 Oct 2008 09:40:54 +0000</pubDate>
        </item>
        <item>
        	<title>Peter on plugin not working</title>
        	<link>http://www.theblog.ca/peter-forum/peters-custom-anti-spam-for-wordpress/plugin-not-working-1#p721</link>
        	<category>Peter's Custom Anti-Spam for WordPress</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-custom-anti-spam-for-wordpress/plugin-not-working-1#p721</guid>
        	        	<description><![CDATA[<p>Hi Stephane, that is actually the default behavior [Image Can Not Be Found]</p>
<p>If you want some “same page” feedback then you’ll have to do your own JavaScript or Ajax modifications.  If you want something like what I do on my site (new page feedback but integrated into the site design), you’ll have to develop some extra templates.  I’ve been meaning to create a tutorial on the template workflow, but haven’t gotten around to that [Image Can Not Be Found]</p>
]]></description>
        	        	<pubDate>Wed, 15 Oct 2008 14:22:13 +0000</pubDate>
        </item>
        <item>
        	<title>Stephane on plugin not working</title>
        	<link>http://www.theblog.ca/peter-forum/peters-custom-anti-spam-for-wordpress/plugin-not-working-1#p718</link>
        	<category>Peter's Custom Anti-Spam for WordPress</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-custom-anti-spam-for-wordpress/plugin-not-working-1#p718</guid>
        	        	<description><![CDATA[<p>I have installed the plugin without any problems. When i enter the wrong word, the error message and the textarea are now in a  new blank page. Can anyone help me</p>
<p>Stephane</p>
]]></description>
        	        	<pubDate>Wed, 15 Oct 2008 09:33:32 +0000</pubDate>
        </item>
</channel>
</rss>