I had previously complained about rather inane yet draconian anti-spam measures of Spam Karma. Today I faced more "Karma" pains from Referrer Karma, yet another seriously annoying plugin from same source.
Overview This Plugin provides automatic real-time machine translation of your WordPress Blog (written in English Language) in eight additional languages - Spanish, French, German, Portuguese, Italian, Japanese, Korean and Chinese (Simplified). The translated pages can be bookmarked. Update: This plugin has been superseded by Angsuman's Translator Plugin Pro, which not only contains all the great features of this plugin but lot's more. All the defects and enhancement requests of this plugin has been done in the pro version, it offers significantly improved performance by caching, provides better translation for asian languages like Chinese & Japanese and more. Please get translator pro version here.
Without much ado, I present the script. It handles http and https URL's and should work across platforms and configurations (like using htaccess for clean url's etc.). To understand more about the issues involved read - Understanding $_SERVER[’PHP_SELF’], $PHP_SELF, $_SERVER[’REQUEST_URI’] and $_SERVER[’SCRIPT_NAME’] in PHP and when to use what
The above PHP variables have slight differences which are often ignored, often leading to problems in large scale deployments or product solutions. I have attempted to debug them for you. $_SERVER['SCRIPT_NAME'] This contains the current script's path. If you access https://blog.taragana.com/ or https://blog.taragana.com/index.php the $_SERVER['SCRIPT_NAME'] will be same - /index.php. It is irrespective of the actual URI ($_SERVER['REQUEST_URI']) used to access the site. As it returns the actual script name, it fails provide additional path information that may be present. So if the $_SERVER['REQUEST_URI'] is /index.php/big/directory/ then too the $_SERVER['SCRIPT_NAME'] will be same - /index.php.
Older News
S M T W T F S
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31 1 2 3 4
Copyright© 2010 The Gaea Times