Ciprian Murariu - 2008-03-21

Logged In: YES
user_id=1363553
Originator: YES

Never mind, I did it myself...

Here is the fix:

1. In respond.php:
Search for this in handlenod function:
elseif (strtoupper($xmlnode["tag"])=="DATE"){

return getfdate();

}
######################### End of search #########################
Replace with:
elseif (strtoupper($xmlnode["tag"])=="DATE"){

// return getfdate(); // Deprecated

$mynode=upperkeysarray($xmlnode["attributes"]);
$date_format=$mynode["FORMAT"];

return getfdate($date_format);

}
################## End of replace - Save file #################

2. In util.php
Search for getfdate function:
function getfdate(){

return date("D M j G:i:s T Y");

}
######################### End of search #########################
Replace with:
function getfdate($date_format){

// Set the US specific date/time format
if (eregi("win", PHP_OS)) {
setlocale(LC_TIME, "eng-usa.UTF-8", "eng-usa");
} else {
setlocale(LC_TIME, "en_US.UTF-8", "enu.UTF-8", "usa.UTF-8", "enu_enu.UTF-8", "English-usa.UTF-8");
}

if ($date_format == "") $date_format = "%A, %d of %B %Y %H:%M:%S (%z)"; // for non-formatted <date/> tags

return strftime($date_format);

}
#################### End of replace - Save file #################

That's all! It just enabled ProgramE for tens of interesting AIMLs like, whatday_eng, whatday_us, onthisday, daystoxmas, seasons aso, files that were useless for PE before.

Notes: The locale thing...
if (eregi("win", PHP_OS)) {
setlocale(LC_TIME, "eng-usa.UTF-8", "eng-usa");
} else {
setlocale(LC_TIME, "en_US.UTF-8", "enu.UTF-8", "usa.UTF-8", "enu_enu.UTF-8", "English-usa.UTF-8");
}
... is to make sure that the data passed from patterns to the interpreter is in English, otherwise month names and day names won't be recognized correctly by bot. Of course, you can ignore the lines above.
I needed this patch with set_locale coz phpMyChat-Plus is utf-8 multilangual, and each language sets its own locale. You should remove the ".UTF-8" if your pages are ISO encoded.

Optionally, if you wish, you change it to Uk like:
// Set the UK specific date/time format
if (eregi("win", PHP_OS)) {
setlocale(LC_ALL, "eng-eng.UTF-8", "eng-eng");
} else {
setlocale(LC_ALL, "en_GB.UTF-8", "en_GB.UTF-8@euro", "eng.UTF-8", "uk.UTF-8", "eng_eng.UTF-8", "English-uk.UTF-8");
}

I hope you'll like this fix and find it useful for your own bot masterpieces :)

All the best!
Ciprian Murariu
(btw... I am the phpMyChat-Plus developer)