iPod update

I haven’t updated the iPod in a while, and I noticed after doing it tonight that it gives it a nice new icon, and when restarting the iPod it gives a progress bar, just like booting up a Mac.

Simple Catchpa

Note: This has been updated to reflect most of the feedback I received from the comments and emails. One of the ways to combat comment spam is to use a Catchpa: or a Completely Automated Turing Test to Tell Humans and Computers Apart. I have implemented one with a simple bit of JavaScript. You need to have two sections of code in your comments.html:

 1     function checkCatchpa()
 2     {
 3         var catchpaResponse = document.getElementById("catchpa").value;
 4             if( catchpaResponse == theAnswer )
 5             {
 6                 return true;
 7             }
 8         return false;
 9     }
10     
11     function SubmitComment()
12     {
13         if (checkCatchpa() == true)
14         {
15             document.commentform.submit();
16         }
17     }

This one needs to be inside a <script> block: I have it where I also use a couple of functions to show a comment preview. You will also need to surround the script block with {literal} tags to prevent it from screwing up your template. The next one creates the puzzle. It should go after the URI box in your comment form:

 1     <p>
 2         <input type="text" name="catchpa" id="catchpa" value="" size="28" tabindex="4" />
 3         <label for="catchpa">{_e text="<acronym title='Completely Automated Turing Test to Tell Humans and Computers Apart'>Catchpa</acronym>: "}</label> 
 4         <script type="text/javascript">
 5             var firstNumber = Math.ceil(Math.random()*10); 
 6             var secondNumber = Math.ceil(Math.random()*10); 
 7             document.write("What is "+firstNumber+" plus "+secondNumber+"?");
 8             var theAnswer = firstNumber + secondNumber;
 9         </script>
10     </p>

You will also then need to tell the form itself to call the checkCatchpa() function, rather than just submitting:

1          <form action="{$siteurl}/wp-comments-post.php" method="post" id="commentform" name="commentform" onSubmit="return checkCatchpa()">

Depending on your setup, you may also need to use the SubmitComment() call on your link or button that actually submits the form.

1     <a class='button' href='javascript:SubmitComment();'> Post Reply </a>

I’ve tested this and it works: I’ll leave it on my site for a couple of days so you can test it out: if you have any problems, leave a response here (if you can!), or AIM/email me.

Boing Boing: Interesting words from around the world

Boing Boing: Interesting words from around the world My favourite: bakku-shan: a girl who appears pretty from behind but not the front. Japanese.

WordPress PHP files

Since someone on the forums mentioned that you can change some hardcore options with /wp-admin/options.php, I got a little interested, and discovered there are other filest that you can run, and do interesting stuff with. All of these PHP files are located in http://yourblogname.blogsome.com: /wp-admin/install-xxx.php, where xxx can be: b2, blogger, greymatter, livejournal, mt, rss, textpattern. These will allow you to import the contents of your blog directly into blogsome, I assume. I haven’t done this, so cannot tell if they will work – I imported mine via ecto, an offline reader. Actually, it looks like the b2, blogger, greymatter ones might work – the others require you to edit the files that you open. And I cannot seem to identify these files in the editing screen, so I’m stuck. /wp-admin/plugin-editor.php This would be cool, except you cannot actually change any files. Oh well, at least you can examine a plugin and see how it works… Also interesting are the Smarty Template files. I may learn something here about what extra things I can do from Smarty in Blogsome. custom_fields.enclosure.php & custom_fields.photoblog.php I already use enclosure, but I didn’t know about photoblog. Have to investigate that one. function.blogroll.php, function.cork.php, function.eightball.php, function.googleit.php, function.photoblog.php, function.pirate.php & function.relatedstories.php {blogroll} allows you to use blo.gs to track your blogroll. I’m pretty happy with RSS at home, so I’ll leave it there. {cork} – don’t know what this does yet. {eightball} looks like it wants to be a magic eightball simulator, but only ever seems to give me the one result: Maybe in your reality. {googleit}, {photoblog} & {pirate} will require further study. {relatedstories} looks interesting, but I cannot get any result as yet: this I may work on. I think it’s pretty much like {todayayearago}. outputfilter.protect_email.php {'string'|protect_email} does not work: it causes the pages not to load.