Quite an unusual request I imagine.
Pretty much, I'm planning to set it up so that on the 1st of April, anyone visiting my site will have it all translated to Pig Latin (and if they click a link, they escape it)), and on the 19th of September

, the page gets translated into pirate. I can handle the pirate translation, indeed the only thing I CAN'T do is change all the visible text (and visible text ONLY) by putting it through a function. Here's a pig latin class (from this Martyr2!)
php
<?php
function translate($strTranslate) {
// Split the phrase into words
$pieces = explode(" ", $strTranslate);
// Loop through each word for translation
for ($i = 0; $i < count($pieces); $i++) {
pigLatin($pieces[$i]);
}
}
// Controller function for determining if word starts with vowel, then add "way"
// Otherwise, pass it on for rotation and add "ay"
// Piglatin has variations in rules, this is a common form but not only form.
function pigLatin($word) {
if (isVowel(substr($word,0,1))) {
echo "$word" . "way ";
}
else {
echo moveLetter($word) . "ay ";
}
}
// Recursive function to take off a non vowel letter and put it on the end
// Recall the function until a vowel is encountered and then return the word.
function moveLetter(&$word) {
if (!isVowel(substr($word,0,1))) {
$chLetter = strtolower(substr($word,0,1));
$word = substr($word,1) . $chLetter;
return moveLetter($word);
}
else { return $word; }
}
// Simply checks if letter is a vowel.
// For most pig latin variations, Y is considered a vowel.
function isVowel($chLetter) {
$letters = array("a","e","i","o","u","y");
for ($i = 0; $i < 6; $i++) {
if (strtolower($chLetter) == $letters[$i]) { return true; }
}
return false;
}
translate("This is a test");
So, can anyone help me? I can handle the execution and everything else.
Thanks in advance.
P.S. When is International Talk Like a Ninja Day?