'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e', 'ё' => 'e', 'ж' => 'zh', 'з' => 'z', 'и' => 'i', 'й' => 'y', 'к' => 'k', 'л' => 'l', 'м' => 'm', 'н' => 'n', 'о' => 'o', 'п' => 'p', 'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ц' => 'c', 'ч' => 'ch', 'ш' => 'sh', 'щ' => 'sch', 'ь' => '', 'ы' => 'y', 'ъ' => '', 'э' => 'e', 'ю' => 'yu', 'я' => 'ya', "ї" => "yi", "є" => "ye", 'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D', 'Е' => 'E', 'Ё' => 'E', 'Ж' => 'Zh', 'З' => 'Z', 'И' => 'I', 'Й' => 'Y', 'К' => 'K', 'Л' => 'L', 'М' => 'M', 'Н' => 'N', 'О' => 'O', 'П' => 'P', 'Р' => 'R', 'С' => 'S', 'Т' => 'T', 'У' => 'U', 'Ф' => 'F', 'Х' => 'H', 'Ц' => 'C', 'Ч' => 'Ch', 'Ш' => 'Sh', 'Щ' => 'Sch', 'Ь' => '', 'Ы' => 'Y', 'Ъ' => '', 'Э' => 'E', 'Ю' => 'Yu', 'Я' => 'Ya', "Ї" => "yi", "Є" => "ye",); } $var = trim( strip_tags( $var ) ); $var = preg_replace( "/\s+/ms", "-", $var ); $var = str_replace( "/", "-", $var ); $var = strtr($var, $langtranslit); if( $punkt ) {$var = preg_replace( "/[^a-z0-9\_\-.]+/mi", "", $var );}else{$var = preg_replace( "/[^a-z0-9\_\-]+/mi", "", $var );} $var = preg_replace( '#[\-]+#i', '-', $var ); if( $lower ) {$var = strtolower( $var );} $var = str_ireplace( ".php", "", $var ); $var = str_ireplace( ".php", ".ppp", $var ); if( strlen( $var ) > 50 ) { $var = substr( $var, 0, 50 ); if( ($temp_max = strrpos( $var, '-' )) ) $var = substr( $var, 0, $temp_max ); } return $var; } function langdate($format, $stamp) { global $langdate; return strtr( @date( $format, $stamp ), $langdate ); } function mcdate($format, $stamp) { global $langdate, $config; $today = strtotime(date("Y-m-d.", time()+ ($config['date_adjust']*60))); if ($stamp > $today) return "" . date ("H:i:s", $stamp); elseif ($stamp > ($today - 86400)) return "". date ("H:i:s", $stamp); else return strtr(date($format, $stamp), $langdate); } function msgbox($title, $text) { global $tpl; $tpl_2 = new dle_template( ); $tpl_2->dir = TEMPLATE_DIR; $tpl_2->load_template( 'info.tpl' ); $tpl_2->set( '{error}', $text ); $tpl_2->set( '{title}', $title ); $tpl_2->compile( 'info' ); $tpl_2->clear(); $tpl->result['info'] .= $tpl_2->result['info']; } function ShortRating($id, $rating, $allow = true) { global $config, $lang; if ($rating) $rating = round($rating, 0); else $rating = 0; if ($rating > 0) $rating = "".$rating.""; elseif ($rating == 0) $rating="".$rating.""; else $rating = "".$rating.""; if (!$allow) { $rated = << Не нравится(-) {$rating} Нравится(+) HTML; return $rated; } $rated = ""; $rated .= << Не нравится(-) {$rating} Нравится(+) HTML; $rated .= ""; return $rated; } function CommRating ($id, $commrating, $allow = true){ global $is_logged, $member_id, $config, $lang, $db; if ($commrating) $commrating = round($commrating, 0); else $commrating = 0; switch($commrating) { case ($commrating >= 0): $commrating = '+'.$commrating.''; break; case ($commrating <= 0): $commrating = ''.$commrating.''; break; case($commrating == 0): $commrating = ''.$commrating.''; break; } if (!$allow) { $commrated = << {$commrating} HTML; return $commrated; } $commrated .= << {$commrating} HTML; return $commrated; } function CategoryNewsSelection($categoryid = 0, $parentid = 0, $nocat = TRUE, $sublevelmarker = '', $returnstring = '') { global $cat_info, $user_group, $member_id; $allow_list = explode( ',', $user_group[$member_id['user_group']]['allow_cats'] ); $spec_list = explode( ',', $user_group[$member_id['user_group']]['cat_add'] ); $root_category = array (); if( $parentid == 0 ) {if( $nocat ) $returnstring .= ''; } else {$sublevelmarker .= '   ';} if( count( $cat_info ) ) { foreach ( $cat_info as $cats ) {if( $cats['parentid'] == $parentid ) $root_category[] = $cats['id'];} if( count( $root_category ) ) { foreach ( $root_category as $id ) { if( $allow_list[0] == "all" or in_array( $id, $allow_list ) ) { if( $spec_list[0] == "all" or in_array( $id, $spec_list ) ) $color = "black"; else $color = "red"; $returnstring .= "