<?php function russian_date() { $translation = array( "am" => "дп", "pm" => "пп", "AM" => "ДП", "PM" => "ПП", "Monday" => "Понедельник", "Mon" => "Пн", "Tuesday" => "Вторник", "Tue" => "Вт", "Wednesday" => "Среда", "Wed" => "Ср", "Thursday" => "Четверг", "Thu" => "Чт", "Friday" => "Пятница", "Fri" => "Пт", "Saturday" => "Суббота", "Sat" => "Сб", "Sunday" => "Воскресенье", "Sun" => "Вс", "January" => "Января", "Jan" => "Янв", "February" => "Февраля", "Feb" => "Фев", "March" => "Марта", "Mar" => "Мар", "April" => "Апреля", "Apr" => "Апр", "May" => "Мая", "May" => "Мая", "June" => "Июня", "Jun" => "Июн", "July" => "Июля", "Jul" => "Июл", "August" => "Августа", "Aug" => "Авг", "September" => "Сентября", "Sep" => "Сен", "October" => "Октября", "Oct" => "Окт", "November" => "Ноября", "Nov" => "Ноя", "December" => "Декабря", "Dec" => "Дек", "st" => "ое", "nd" => "ое", "rd" => "е", "th" => "ое", ); if (func_num_args() > 1) { $timestamp = func_get_arg(1); return strtr(date(func_get_arg(0), $timestamp), $translation); } else { return strtr(date(func_get_arg(0)), $translation); }; } $date = russian_date("l, j F"); $time = date("H:i:s"); $full_date = $date.$time; if ($listeners>$max) { $text = "<?php \n"; $text .= "\$max = \"$listeners\"; \n"; $text .= "\$vizitka = \"$description\";\n"; $text .= "\$vizitka2 = \"$station_conv\";\n"; $text .= "\$igralo = \"$song_conv\";\n"; $text .= "\$date = \"$full_date\";\n"; $text .= "?>"; $fp = fopen("max.php", "w+"); flock($fp, LOCK_EX); fwrite($fp, $text); flock($fp, LOCK_UN); fclose($fp); $max = $listeners; $vizitka = $description; $igralo = $song_conv; $vizitka2 = $station_conv; $date = $full_date; } ?>