There is such a function
& lt ;?
$ Message_Query = MySQL_Query ("Select U.ID, p. *, u.userName, U.Family, U.avatar
From Messages P, Users u
Where Case.
WHEN P.Group_Hash = '$ Hash'
Then p.from_id = u.id
End.
OR (
p.from_id = '$ ID'
)
Order by p.timemsg ASC ") OR DIE (MYSQL_ERROR ());
While ($ RUN_MESSAGE = MYSQL_FETCH_ARRAY ($ Message_Query)) {
$ FROM_ID = $ Run_Message ['from_id'];
$ Message = $ Run_Message ['Message'];
$ User2 = $ RUN_POST ['from_id_to'];
$ Timemsg = $ Run_Message ['Timemsg'];
$ FROM_USERNAME = $ Run_Message ['UserName'];
$ From_Family = $ Run_Message ['Family'];
$ FROM_AVATAR = $ Run_Message ['avatar'];
$ from_id = $ Run_Message ['id'];
Function XtimeAgo ($ Oldtime, $ Newtime, $ TimeType) {
$ TimeCalc = StrTotime ($ NewTime) - StrTotime ($ oldtime);
if ($ TIMETYPE == "X") {
If ($ TimeCalc = 60) {
$ TIMETYPE = "M";
}
if ($ TimeCalc = (60 * 60)) {
$ TIMETYPE = "H";
}
if ($ TimeCalc = (60 * 60 * 24)) {
$ TIMETYPE = "D";
}
}
if ($ TIMETYPE == "S") {
$ TimeCalc. = "Seconds Ago";
}
if ($ TIMETYPE == "M") {
$ TimeCalc = Round ($ TimeCalc / 60). "Minutes Ago";
}
if ($ TIMETYPE == "H") {
$ TimeCalc = Round ($ TimeCalc / 60/60). "Hours Ago";
}
if ($ TIMETYPE == "D") {
$ TimeCalc = Round ($ TimeCalc / 60 / 60/2 24). "Days Ago";
}
Return $ TimeCalc;
}
? & gt;
But why does it give an error please tell me what is the problem?
Answer 1, Authority 100%
The function with such a name has already been announced in the script. You have not forgotten the old realization?