Fighting spammers: Removing Website URL Field from Comment Form

I’m tired of receiving massive amount of spam comments on my blog (1280 spam comments for about a month) and doing:

DELETE FROM `wp_comments` WHERE `comment_approved` = 0

Beside using SI Captcha Anti-Spam which does pretty good job in keeping some of the automated spam bots at bay, I noticed some trend in the spam comments flooding my posts, they are all full of SEO keywords and they are heavy abusing the Website field in the comment form.

Here is a small “plugin” which will remove (unset) the URL field in the comments form:

<?php
/*
Plugin Name: Remove Website field from comments.
*/
function custom_comment_fields( $fields ){
  if(isset($fields['url']))
    unset($fields['url']);
  return $fields;
}
 
add_filter( 'comment_form_default_fields', 'custom_comment_fields' );

Create a file in /wp-content/plugins/ with the code a bough. Go to the ‘Plugins’ section of the admin panel and activate the newly created plugin named “Remove Website field from comments”.

Yey, no more “Website” field in the “Leave a Reply” section 🙂

Eclipse Hotkeys Fix

Eclipse on GNU/Linux has an annoying bug with hotkeys for users with multiply keyboard layouts.

For example when the user is working with the English keyboard layout, hotkeys such as “Ctrl-C”, “Ctrl-V” will work as expected, but when switched to different layout (ex: Bulgarian) the keys will no longer work.

After a bit of searching I found a fix for this inconvenience at GitHub.

Thank you “amozzhuhin“!

Command Prompt Here

Have you ever wanted to open a Command Prompt in the folder you are currently browsing in Windows Explorer. It’s time saving feauture that’s not present currently in Windows. If you do a Google search, you will find various methods for doing this. The method that I will show you will not require instalation of some software sush as Cmd Here powertoy.

So here is how is done:
1. Open Control Panel ( or in Windows Explorer select the Tools menu and then Folder Options ) and navigate to Folder Options

2. In the “Folder Options” property page select File Types and in the “Registered file types:” list select {NONE} | Folder

Folder Options property page
3.Click the “Advanced” button. The “Edit File Type” dialog will apear


4.Click on the “New” button, the “New Action” dialog will apear


5. In the “Action:” field type “Command Prpmpt” or name of your choice, and in the “Application used to preform the action:” type cmd.exe.

6. Click “OK” to close the “New Action” dialog, click “OK” to close “Edit File Type” dialog and “OK” to close the “Folder Options” dialog.

Now when you right click on a folder in Windows Explorer you shoud see an context menu entry labeled “Command Prompt”, click on it to open a “cmd.exe” window in the selected folder.

Adding custom resources in Visual Studio 2003 “Add Resource” dialog box

For some projects I create resources that can be reused in other projects. Such as dialog boxes, images, etc…

It’s waste of time to recreate those resources again and again for each project you use them in, so after some investigation I have found a way to add custom resources in VS 2003 “Add Resource” dialog box.

Open C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\VCResourceTemplates\1033\mfc.rct in VS 2003. Open a resource file from wich you want to get some resources. Right click on the resource you want to copy and from the popup menu select “Copy” then paste the resource in mfc.rct. Or just drag selected resource to mfc.rct.

Note: mfc.rct may have different path. It depends on your VS 2003 instalation!

Usefull feature in Windows XP SP2

Alternative IP configuration in Windows XP

I think it’s introduced in Windows XP SP2 because I havent noticed the precense of such feature in earlier XP releases.

What is it for? It help’s you to use two different set’s of configurations on one LAN card. Very usefull if you own a laptop. I was thinking of writing such helper tool!

How to reach it.
1. Right click on “My Network Places” and select Properties, then right click on you network connection, from the dialog select “TCP/IP Protocol” and click “Properties”, select the alternative tab.

Windows will switch to your alternative settings if it fails to obtain IP from DHCP server (such as one I has at home). The alternative configuration in my case is that at work.