I’ve come up with a bit of PHP which decides whether a particular commenter is a ‘friend’ or a ‘foe’. If they are a ‘friend’, then when they post their URL with their comment, the URL will not be posted as a redirect. If they are a ‘foe’, then their URL will redirect.
A ‘friend’, by my definition, is someone who regularly offers useful or insighting comments. I have taken down the URLs of the sites of those commenters and then fed them into a PHP script, so that if they post a comment, the URL will not redirect. Any other URLs will redirect.
Update: The original code I posted wouldn’t actually work. Use the new code below which does work.
This is the code I used (with the URLs removed for brevity):
$imax=(count($urls) - 1);
for ($i=0; $i<=$imax; $i++)
if (ereg('^http://' . $urls[$i],$url))
If you were to deploy this script, you would add your friends’ URLs to the array, and then save this as a file. Then, in your Individual Entry Archive, you would include this file at the top, and then, in pace of the code you use to display the author’s site, paste this:
echo('<$MTCommentAuthorLink show_email="0" no_redirect="1"$>');
The code works by iterating through each item in the array and then uses a regular expression to test to see if the URL that has been typed in matches an item in the array. If it does, the function returns true, otherwise it is false. It would take into account slight variations in the URL – for example ‘http://www.metzener.com/dave’ and ‘http://www.metzener.com/chalkboard’ would both be seen as ‘friends’, but it isn’t yet powerful enough to know that URLs do or don’t need ‘www’ in front of them.
At the moment, I have around 30 URLs in there (taken from the 30 most frequent commenters here) but I will add more as time goes on. This means that regular commenters get the bonus of a bit of extra Google PageRank; ‘foes’ – those that don’t comment here often – do not. And that ‘foes’ category includes spammers.
If you don’t post here very much, don’t take this as an indication that your posts are not worth anything – they are. But think of this as a kind of ‘loyalty club’ for those who do post regularly.