Water TrickleYesterday I received an email from BlogRush telling me that they had just trimmed 10,000 websites and that j2fi.net had passed their “strict Quality Guidelines and criteria”.  Thanks … I think.

I know this site can pass strict quality guidelines for most online services because I keep it up to date, and it’s not completely full of garbage (though some posts do leave much to be desired).  They really don’t need to waste our time and bandwidth by sending an email telling us that we’ve been approved to use their service or not.  Perhaps I’m being a bit rough on them, but for all the hype and big-name bloggers, BlogRush has been a massive disappointment.  While I don’t expect a huge increase in traffic, it’d be nice if I could get at least one hit a week with these guys.  Heck, I attract more traffic with PayPerPost advertisers checking out my site and the posts they paid for than I get from BlogRush, and their widget is on tens of thousands of sites.

I have given these people almost a full month of prime real-estate on my little website, and they’ve been given well over 40,000 impressions.  All in all, I’ve had 3 people come to this site through a BlogRush widget.  Forgive me if I’m not exactly impressed.

All that said, I’ve given these people a full month to prove their service to me.  If they cannot give me at least five more hits in the next 48 hours, then their widget comes off the site.  Eight hits per month shouldn’t be too much to ask for when giving away front-page real-estate.

Have you had any success with this service?  If so, what seems to work for you?  While I certainly aim to have decent subject titles, I will not change the way I write my blogs for a traffic service.

So after several hours of coding, I managed to integrate Google Maps into my sidebar to display the locations of visitors to this site (seen in the sidebar above the SMS area).  In that time I was able to learn how to build KML files, integrate it into a Google API class and all sort of neat tricks.  There are just a few little problems with the end result …

I can’t relelase it.

Well … that’s an incomplete statement.  I can’t release it without re-writing how it operates to eliminate it’s dependance on a particular init call.

It seems that in order to make this plugin work, I need to have my body tag look like this: <body onload=”onLoad()”>

While this isn’t a big thing, per se, I can’t expect users will want to open up their theme’s header.php file to update this tag accordingly.  I know that it’s possible to integrate Google Maps into sites without this, but I just haven’t discovered how.  Such is the price we pay for writing code in .NET for several years.

The primary reason I wanted to write a plugin like this was because I haven’t been happy with the visitor maps that have been available online.  They all want to call other sites and many of them are either quite slow to load or just plain suck.  By using Google Maps with a specific KML file, the appearance can be controlled and customized as a user sees fit.

One of the things I liked about the Google Analytics reports was the Geomap Overlay.  However, after comparing data for a set period, I was unable to validate the information shown.  If I had this problem when creating reports at work, I would need to go line by line into the data and determine why my results were different.  While Google Analytics can make lots of data look pretty, it can’t give me the detail that I require (raw IP address logs) to be confident in the data.

Another benefit to pulling this functionality server-side is the potential linking it to Omry Yadan’s FireStats.  I’ve used this software for a while now and I really like the simplicity of the reporting, as well as the ability to filter the user agents and IP addresses that I feel are bots.  I’ve also found that this reporting tool comes the closest to the raw access logs provided by my web host.  I can only think of a few features I’d like to add to this excellent software, and this geomap overlay is one of them.  (The ability to have a custom name appear for known IP addresses would be nice, too).  Once I have the kinks worked out for the home screen, I can then work on integrating it with FireStats.

All this said, there are still a bunch of things that I would want to write into this GeoLocation plugin before releasing it to the public.  We’ll need a way to filter out IPs and user agents of bots, and I’d like to give visitors the option to see the map in a larger window (if they’re really curious about demographics).  Site owners should also have the option to display hit information if they want or not (it looks really bad on there, right now), as well as control the look of the pins.

I tend to have a habit of scope gallop when writing software that I will find personally useful, so hopefully I can make it useful for others, too.  Is this something that others would potentially want on their site?  Should I even worry about making this available or ensuring it will work on something other than WordPress 1.5 to 2.1.x ?

I’d like to apologize to everyone who tried to view some of my images or download files from non-English translations of this site, as it appears this functionality has been failing for a little bit of time.  Seeing as how more than 70% of my site traffic is not in English, I should have noticed this a few months ago, so I can’t really give any excuses for my lapse in site management.

All the language translation done on this site is by Altavista’s BabelFish engine.  When you click on one of the flags in the upper portion of the side-bar, you’re actually making use of a great little WordPress plugin written by Davide Pozza.  I’ve been using his Global Translator plugin since January and it’s been a great boom for the reach of this website.  What I find absolutely incredible is the number of visitors from countries that I had never imagined accessing this site.

As of June 1, 2007, this site is read in mostly Spanish followed by English.  I’m really curious to know how well the BabelFish machine translation works.  If you happen to be reading this entry in something other than English, please let me know what you think.

Now, all that said, if you also happen to be using Global Translator and you’ve noticed that people are having trouble downloading .zip, .rar or other files, here’s how you can correct the issue.  Everything you need to change is in the translator.php file.  For those who do not want to manually edit the file, you can find a zipped version of the file at the end of this post.

First, we’ll add a definition to the file.  Shortly after the comment block, you’ll see several lines that start with the word “define”.  They’ll look something like this:  define(’FLAG_BAR_BEGIN’, ‘<!–FLAG_BAR_BEGIN–>’);

Add this right afterwards:

define(’EXT_EXCLUDE’, ‘.jpg|.png|.gif|.zip|.rar’);

If you have any other links or file types that also pass language pointers, feel free to add them here.  For exampe, if you have a link such as http://blog.org/ko/images/picture.bmp, you will want to add .bmp to the definition above.

Next, in function gltr_translate find the following line:

$line = preg_replace($pattern, $repl, $line);

You will want to add a condition around this to make it read:

if (strpos($line, EXT_EXCLUDE) > 0) {
  $line = preg_replace($pattern, $repl, $line);
}

This will ensure that lines with extensions found in EXT_EXCLUDE are not updated to have a language pointer in place.

Now, all this said, it wouldn’t be too hard (in theory) to make this something configurable in the Admin screens, but it’s outside the scope of what I was trying to solve at the moment.

For anyone that hasn’t tried Davide’s plugin and would like to offer their site in multiple languages, I’d strongly recommend Global Translator.  As of this writing, version 0.6.1 is out, which has support for caching, Google Translation, BabelFish Translation, and a few other great little features.

You can download my edited translator.php file here.

Note:  This file is for Global Translator version 0.6.1.

Okay … call me cheap, but here’s yet another BOINC-related plugin.  I’ve decided that this will be the last stand-alone BOINC Stats plugin I’ll release, and the next ones will allow users to display any of the projects that are currently available without using seperate plugins that are pretty much the same.

But enough of that … on with the release!

Einstein Stats is a WordPress plugin that displays your current Einstein@Home Stats.  This was put together mainly because of the recent server failure at the BOINC SETI Project.  Since my computers were sitting idle for far too long, I gave them another task.  I must admit … Einstein is much harder on the processors than SETI ever was.  It takes just over 26 hours for my pair of Dual-Core Xeon’s to get through a work unit each … which is almost unheard of with my SETI data.

That said, this plugin is a little light on features.  Currently it will display your total work units, average work units, and team name (if applicable).  In the future, I plan on having a user-configurable option to display other data like number of PCs on the project, pending credit counts, and personal standings.

You can download the most current version of Einstein Stats here.

Requirements:

Einstein Stats has been tested on WordPress 2.0.4, 2.0.5, 2.0.7, 2.1, 2.1.3 and 2.2 RC1.

Installation:

  • upload the contents of the zip file to your “wp-content/plugins” directory (be sure to write them to the einstein-stats directory)
  • go to the “Plugins” main menu and find ”Einstein Stats Display”, then click “Activate”
  • go to the “Options / Einstein Options” menu and enter your account id, and set the number of hours between stat refreshes

Using:

  • modify the theme file where you wish to display your Einstein stats (usually sidebar.php) and type in the following line:

<php get_emc2_stats(); ?>

Uninstallation:

  • go to the “Plugins” main menu and find “Einstein Stats Display”, then click “Deactivate”
  • delete the files from your “wp-content/plugins” directory

Change Log:

Bug Reports:

As always with initial releases, I’m sure there will be one or two things that I forgot to check.  If you happen to find a bug, please let me know.

Enjoy!

Anyone else tired of Google’s 403 messages when using previous versions of Davide Pozza’s Global Translator?  For some weeks I’ve been noticing a larger number of them than usual, but have lacked the resolve to either write in a caching mechanism for the translated pages, or change the code to work with AltaVista’s BabelFish service.

Luckily, Mr. Pozza decided to do both.

Yesterday Global Translator 0.6-beta was released, and I was interested to know how it would run.  This version comes with support for both Google Translator and BabelFish, and will permit pages to be cached for faster loading.  The only downside to this version was it’s inability to play nice with Omry Yadan’s FireStats.  But since I really enjoy both of these plugins, I thought that I would make the effort and find a way to make these work together like I had for version 0.4.1.

While testing this I had found two issues would arise if both plugins were active simultaneously.  First, the translation service would receive an address like http://blog.net/http://blog.net/wp-content/firestats/, and second, the Flags Bar would have “double-language” links ( http://blog.net/fr/jp/ ) after coming back from translation.  Luckily there was only one function in translator.php that needed to be updated, and these changes are really minor.

In the translate function, change the lines:

$url_to_translate = BLOG_HOME . ‘/’ . $url;
$resource = build_translation_url(BASE_LANG, $lang, $url_to_translate);

to:

$url_to_translate = BLOG_HOME . str_replace(’//’, ”, ‘/’ . preg_replace(LANGS_PATTERN, ”, $_SERVER['REQUEST_URI']));
$resource = build_translation_url(BASE_LANG, $lang, $url_to_translate);

Under the line:

$fp = @fsockopen($host, $port, $errno, $errstr);

add:

$rep_url = ‘<a href=”‘ . BLOG_HOME;
$repl = ‘<a href=”‘ . BLOG_HOME . ‘/’ . $lang;

Then replace:

if (!(strpos($line, FLAG_BAR_BEGIN)===false) && !(strpos($line, FLAG_BAR_END)===false)) {
  $line = get_flags_bar();
  } else {
  //Clean the links modified by the translation engine
  $line = preg_replace($gt_engine->get_links_pattern(), $gt_engine->get_links_replacement(), urldecode ($line)); 
 
  $pattern = “/<a href=\”" . BLOG_HOME_ESCAPED . “([^\"]*)\”[\s|>]{1}/i”;
  $repl = “<a href=\”" . BLOG_HOME . ‘/’ . $lang . “$1\” “;
  $line = preg_replace($pattern, $repl, $line);
}

with:

//Clean the links modified by the translation engine
$line = preg_replace($gt_engine->get_links_pattern(), $gt_engine->get_links_replacement(), urldecode ($line));       

if ((strpos($line, ‘hreflang=’))===false) {
  $line = str_replace($rep_url, $repl, $line);
}

And you’re done!

For those of you that don’t want to go into the code and change a bunch of things, you can download the modified translate.php file here.

One word of caution, though.  It seems that a formatting issue arises on sites that are using some heavy CSS.  Before using this version of the Global Translator plugin, I was using a sweet theme created by miloIIIIVII … unfortunately, after translation there is quite a bit of header space and I lose the sweet cascading menus.  I haven’t yet determined if this is from the translation, or something else … but I’ll update this post if I can resolve it.

If this works for you, let me know.  I also encourage you to head over to Davide’s site and let him know that his efforts are appreciated.  These two plugins have proven themselves to be invaluable to me, and hopefully you find them just as useful.

UPDATE:

Davide’s current release of Global Translator (0.6 Beta5) resolves the issues reported here, making my suggested fixes rather obsolete.  However, I’d like to thank Davide for all the work he’s put into this release and I’m sure that everyone will agree with it’s superior handling.

One note I would like to re-iterate, though, is that after upgrading to Beta5 you will need to either deactivate/activate the plugin or go to the Global Stats admin page (under options) and clear your cache, then hit “Save Options”.  Reason is there is a function that needs to be initialized, and until you refresh the plugin’s data, your site will show an array error.  This is in the user documentation, but how many of us actually read documents? :P