Login Logger plugin
20th July 2007The Login Logger WordPress plugin sounds like a great idea and works fine with standard situations. However, go beyond these and things start to go awry. An example is where you have to use unique database table prefixes because you use shared hosting. This is certainly something that I do and it breaks Login Logger. Thankfully, the fix for this is easy enough: just amend the database query on line 22 in the manage.php file as follows:
Before:
$query = "SELECT distinct wp_users.user_login,".$table_name.".username FROM wp_users LEFT OUTER JOIN ".$table_name." ON wp_users.user_login = ".$table_name.".username WHERE ".$table_name.".username IS NULL";
After:
$query = "SELECT distinct " . $table_prefix . "users.user_login,".$table_name.".username FROM " . $table_prefix . "users LEFT OUTER JOIN ".$table_name." ON " . $table_prefix . "users.user_login = ".$table_name.".username WHERE ".$table_name.".username IS NULL";
The issue was caused by hard-coding of the table prefix for the user table, and using the prefix that you yourself have set is the way out of this. What is less easy to resolve is a conflict between the Login Logger and Themed Login plugins. That will take further investigation before I come up with a fix.
What Amateur Photographer recently reviewed
19th July 2007Amateur Photographer seems to have had a run of reviews recently. First off were the Olympus E-410 and E-510 that they seemed to like. Then, they moved onto the Ricoh Caplio GX100, which they seemed to like that too, though they did say that the quality wasn't up to SLR standards. But then again, it is a compact and that might be expecting a bit too much.
This week, Paint Shop Pro comes under the spotlight, as does Epson's V350 scanner. While I have yet to read these, I have been engaging in a spot of equipment acquisition anyway. My CanoScan 5000F scanner has been usurped by Epson's Perfection Photo 4490 and delighted I am with it too. The quality of the scans that I have been doing of prints has been good, and the presence of an on/off switch is a creditable one. When none of the other scanners that I have had possessed it, having to plug something in and out from the power socket is inconvenient to say the least.
In addition, I have also gone and got myself a new DSLR. Seeing Pentax's K10D going with an 18-55 mm lens for £499 at Jessop's overrode my better reasoning, putting paid to ideas of purchasing any other electronic goods for the rest of this year. It's an award-winning gadget, and Photography Monthly's Will Cheung seemed to get on fine with it. While Which Digital Camera said it was heavy, it has to stand up to use in the great outdoors.
Though the sensor may be a 10 megapixel affair, this will be an upgrade to my Canon EOS 10D; that has a sensor in need of clean right now (I plan to get it done by the professionals) and every time that I want to use an image that it has made, Photoshop's healing brush has to be pressed into service. Pentax does boast about all the seals that it has added to the K10D, a good thing if they cut down on the dust entering the camera. And if dust does get in, the sensor cleaning feature will hopefully see it off from the photos.
Image stabilisation, another value adding feature, is also there and may prove interesting. Strangely, there's some video capture as well, and I hope that it doesn't get the EU coming after me to collect retrospective camcorder duty. In any case, it's not a feature that I really need, with the Live View functions on the equivalent Olympus offerings falling into the same category. It'll be interesting to see how the K10D performs, given that it's a change from the Canon/Nikon hegemony that seems to dominate digital photography these days.

Update: I have since perused the current issue of Amateur Photographer and seen that Paint Shop Pro suffered from performance issues on computers that worked fine with Photoshop. Otherwise, it compared well with Adobe's offerings, even if the interface wasn't seen to be as slick. Epson's V350 was well received, though it was apparent that spending more got you a better scanner; that's always the way with these things.
The power of pipes
12th July 2007One of the great features of the UNIX shell is that you can send the output from one command to another for further processing. Take the following example for instance:
ls -l | grep "Jul 12"
This takes the long directory file listing output and sends it to grep for subsetting (all files created today in this example) before it is returned to the screen. The | character is the pipe trigger, and you can have as many pipes in your command as you want, though readability may dictate how far you want to go.
A feast of plugins
6th July 2007Here's a useful idea: get your blog login page to look like it's part of your blog. It does work well on my hillwalking blog, but you do have to watch how it behaves with whatever theme you are using. Strangely, I couldn't make it work on my offline blog, the development mirror of what you see online. The ability to set what page is displayed after logging in or logging out is an especially useful inclusion.
These sound like wonderful ideas: being able to control the running order of things on your blog sidebar is a good thing. What scuppered my using them is that you need widgets turned on for the effect to work, and I have seen issues with how ID's have been set when things are widgetised.
When JavaScript table generation becomes a performance bottleneck
3rd July 2007Recently, I have seen a web application that displays thousands of records in a scrollable table (please bear with me, there is a decent reason for this). From the appearance of the table, it would be reasonable to assume that the table is generated by the server and output directly to the screen, but this isn't the case. What actually happens is that the server more or less outputs JavaScript code that is then executed.
This takes the form of large arrays that are slotted into the DOM as the contents of the required table by a JavaScript function. With the large amounts of data involved, this means that the browser fully loads the client CPU while the JavaScript processing takes place, something that takes up to a minute to complete.
Admittedly, the browser is IE6, but this was all on a PC with a 2.53 GHz Pentium 4 and 512 MB of memory. Getting the server to deliver standards-compliant (X)HTML for what is needed in the first place seems a much, much better approach to me.
Ditching PC Plus?
28th June 2007When I start to lose interest in the features in a magazine that I regularly buy, then it's a matter of time before I stop buying the magazine altogether. Such a predicament is facing PC Plus, a magazine that I have been buying every month over the last ten years. The fate has already befallen titles like Web Designer, Amateur Photographer and Trail, all of which I now buy sporadically.
Returning to PC Plus, I get the impression that it feels more of a lightweight these days. Over the last decade, Future Publishing has been adding titles to its portfolio that take actually from its long-established stalwart. Both Linux Format and .Net are two that come to mind, while there are titles covering Windows Vista and computer music as well. In short, there may be sense in having just a single title for all things computing.
Being a sucker for punishment, I did pick up this month's PC Plus, only for the issue to be as good an example of the malaise as any. Reviews, once a mainstay of the title, are now less prominent than they were. In place of comparison tests, we now find discussions of topics like hardware acceleration, with some reviews mixed in. Topics such as robotics and artificial intelligence do rear their heads in feature articles, when I cannot say that I have a great deal of time for such futurology. The section containing tutorials remains, even if it has been hived off into a separate mini-magazine, and seemingly fails to escape the lightweight revolution.
All this is leading me to dump PC Plus in favour of PC Pro from Dennis Publishing. This feels reassuringly more heavyweight and, while the basic format has remained unchanged over the years, it still managed to remain fresh. Reviews, of both software and hardware, are very much in evidence while it manages to have those value-adding feature articles; this month, digital photography and rip-off Britain come under the spotlight. Add the Real Word Computing section, and it all makes a good read in these times of behemoths like Microsoft, Apple and Adobe delivering new things on the technology front. While I don't know if I have changed, PC Pro does seem better than PC Plus these days.
Another Olympus E-system review
27th June 2007
I don't buy Amateur Photographer much these days, but sight of a review of Olympus' E-410 and E-510 SLR's got a copy into my possession. Amateur Photographer review features are usually comprehensive and this was no exception; there was none of the vitriol directed towards the Live View feature by Practical Photography, a defining feature of what I consider a lop-sided and none too useful review. The verdict was positive in the main, with the E-510 getting the nod over the E-410 because it fared better on the usability side of things. Image quality, my major concern, was said to be impressive with only dynamic range counting against the results. The Live View feature didn't attract the harsh commentary devoted to it by Practical Photography. Following this review, I have to say that the E-510 does tempt me with its combination of good image quality, dust removal and image stabilisation.
Trouble with my Canon CanoScan 5000F
26th June 2007Having had my Canon CanoScan 5000F scanner for nearly four years now, it has performed faultlessly until yesterday. However, it has now developed a fault that may hasten its replacement, and I have to say that my eye is on Epson's Perfection V350 Photo. Looking on the web, I did find scanners hidden away and that the selection available wasn't what I might have expected it to be. Maybe, the digital photography revolution has made the humble scanner a less essential item. And the fault? Scan results are featuring an unacceptably strong magenta cast. In fact, the first scans result in nothing except pitch black, though allowing things to stay on for a while does improve things. That suggests a hardware fault to me. I have raised the issue with Canon and will await their reply, even though it is stopping me from adding any new photos to my online photo gallery. If Canon comes back to me with the "uneconomical to repair" response, I will be ready to go out and buy the Epson. Time will tell with this one...
Update 1: A spot of further exploration has left me wondering if it is the lamp that's on the way out. If that's replaceable at a reasonable price, then the CanoScan might live on after a spot of repair.
Update 2: Canon's advice included reinstalling the scanner driver and, surprisingly given the symptoms, that seems to have helped. While I'll continue to keep an eye on things, it looks like I'll be hanging onto my money for now.
More on mod_rewrite
25th June 2007Today, I caught sight of an article on anti-plagiarism tools at The Blog Herald, and among the tricks was to use mod-rewrite to stop people "borrowing" both your images and your bandwidth. The gist is that you set up one or more conditions that exclude websites from the application of a rule forbidding access to images; the logic is that if the website referencing an image is not one of the websites listed in the conditions, then it doesn't get to display any of your images.
RewriteCond %{HTTP_REFERER} !^http://(www\.)?awebsite.com(/)?.*$ [NC]
RewriteRule .*\.(gif|jpe?g|png|bmp)$ [F,NC]
The wonders of mod_rewrite
24th June 2007When I wrote about tidying dynamic URL's a little while back, I had no inkling that that would be a second part to the tale. My discovery of mod_rewrite, an Apache module that facilitates URL translation. The effect is that one URL is presented to the user in the browser address bar, and the very same URL is also seen by search engines, while another is passed to the server for processing. Though it might sound like subterfuge, it works very well once you manage to get it set up properly. While the web host for my hillwalking blog/photo gallery has everything configured such that it is ready to go, the same did not apply to the offline Apache 2.2.x server that I have going on my own Windows XP box. There were two parts to getting it working there:
- Activating mod-rewrite on the server: this is as easy as uncommenting a line in the
httpd.conffile for the site (the line in question is:LoadModule rewrite_module modules/mod_rewrite.so). - Ensuring that the
.htaccessfile in the root of the web server directory is active. You need to set the values of theAllowOverridedirectives for the server root and CGI directories toAllso that.htaccessis active. Not doing it for the latter will result in an error beginning with the following:Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that. HavingRewriteRuledirective is forbiddenAllow from Allset for the required directories is another option to consider when you see errors like that.
Once you have got the above sorted, add this line to .htaccess: RewriteEngine On. Preceding it with an Options directive to ensure that FollowSymLinks and SymLinksIfOwnerMatch are switched on does no harm at all and may even be needed to get things running. That done, you can set about putting mod_write to work with lines like this:
RewriteRule ^pages/(.*)/?$ pages.php?query=$1
The effect of this is to take http://www.website.com/pages/input and convert it into a form for action by the server; in this case, that is http://www.website.com/pages.php?query=input. Anything contained by a bracket is assigned to the value of a system-named variable. If you have several bracketed sections, they are assigned to sequentially numbered variables as follows: $1 for the first, $2 for the second and so on. It's all good stuff when you get it going, and not only does it make things look much neater, but it also possesses an advantage when it comes to future-proofing too. Web addresses can be kept constant over time, even if things change behind the scenes. It means that any returning visitors will find what they saw the last time that they visited and surely must ensure good karma in the eyes of those all important search engines.