- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
//Функция возвращает номер месяца по названию
function month_to_num ($month) {
if (mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("январь"),"UTF-8") || mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("января"),"UTF-8")) {$num = 1;}
if (mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("февраль"),"UTF-8") || mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("февраля"),"UTF-8")) {$num = 2;}
if (mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("март"),"UTF-8") || mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("марта"),"UTF-8")) {$num = 3;}
if (mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("апрель"),"UTF-8") || mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("апреля"),"UTF-8")) {$num = 4;}
if (mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("май"),"UTF-8") || mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("мая"),"UTF-8")) {$num = 5;}
if (mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("июнь"),"UTF-8") || mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("июня"),"UTF-8")) {$num = 6;}
if (mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("июль"),"UTF-8") || mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("июля"),"UTF-8")) {$num = 7;}
if (mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("август"),"UTF-8") || mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("августа"),"UTF-8")) {$num = 8;}
if (mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("сентябрь"),"UTF-8") || mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("сентября"),"UTF-8")) {$num = 9;}
if (mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("октябрь"),"UTF-8") || mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("октября"),"UTF-8")) {$num = 10;}
if (mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("ноябрь"),"UTF-8") || mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("ноября"),"UTF-8")) {$num = 11;}
if (mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("декабрь"),"UTF-8") || mb_strtolower($month,"UTF-8") == mb_strtolower($this->t("декабря"),"UTF-8")) {$num = 12;}
return $month;
}
Lure Of Chaos 01.09.2011 09:38 # +1
foGa 01.09.2011 10:34 # +2
guest 02.09.2011 13:00 # 0
Int 01.09.2011 18:52 # 0
roman-kashitsyn 01.09.2011 18:57 # +5
...
Lure Of Chaos 02.09.2011 10:32 # +1
roman-kashitsyn 02.09.2011 10:35 # 0
Vasiliy 02.09.2011 12:13 # +1
guest 02.09.2011 12:47 # +1
function t($text) {
$result = mysql_query("SELECT title, title_en, title_kz FROM setup_messages WHERE kod='".md5($text)."'");
if (!mysql_num_rows($result)) {
mysql_query("INSERT INTO setup_messages SET kod='".md5($text)."', tit='".$text."', title='".$text."'");
$result = mysql_query("SELECT title, title_en, title_kz FROM setup_messages WHERE kod='".md5($text)."'");
}
$data = mysql_fetch_object($result);
if ($_SESSION["site_language"] == "ru") {$lang = 'title';}
if ($_SESSION["site_language"] == "en") {$lang = 'title_en';}
if ($_SESSION["site_language"] == "kz") {$lang = 'title_kz';}
if (!$lang) {$lang = 'title';}
$output = $data->$lang;
if (!$output) {$output = $data->title;}
return $output;
}
roman-kashitsyn 02.09.2011 12:58 # +1
Int 06.09.2011 20:29 # 0