From f51c9ed2abe5c68211bb3736be5f70b1fe2c9ec0 Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Fri, 8 Mar 2019 21:20:34 +0100 Subject: további rendrakás --- mayor-orig/www/include/base/str.php | 230 ------------------------------------ 1 file changed, 230 deletions(-) delete mode 100644 mayor-orig/www/include/base/str.php (limited to 'mayor-orig/www/include/base/str.php') diff --git a/mayor-orig/www/include/base/str.php b/mayor-orig/www/include/base/str.php deleted file mode 100644 index 5c5a7c07..00000000 --- a/mayor-orig/www/include/base/str.php +++ /dev/null @@ -1,230 +0,0 @@ - Lat2 --> ékezettelen) -// ------------------------------------------------------------------- - -function ekezettelen($str) { - return strtr(mb_convert_encoding($str, 'ISO-8859-2', 'UTF-8'), '', 'aaeiooouuuAAEIOOOUUU'); -} - -/* -// --------------------------------------------------------------------------- -// -// UTF8 <--> ISO88592 váltás -// -// --------------------------------------------------------------------------- - -function UTF8_to_ISO88592($str) { - - return mb_convert_encoding($str,'ISO-8859-2','UTF-8'); - -} - -function ISO88592_to_UTF8($str) { - - return mb_convert_encoding($str,'UTF-8','ISO-8859-2'); - -} -*/ - -// --------------------------------------------------------------------------- -// -// Két string összehasonlítása a magyar ABC szerint ($a < $b => -1) -// -// --------------------------------------------------------------------------- - -function str_cmp($a,$b) { - - $ABC = Array('a'=>1, - ''=>1, - ''=>1, - 'b'=>3, - 'c'=>4, - 'd'=>5, - 'e'=>6, - ''=>7, - 'f'=>8, - 'g'=>9, - 'h'=>10, - 'i'=>11, - ''=>12, - 'j'=>13, - 'k'=>14, - 'l'=>15, - 'm'=>16, - 'n'=>17, - 'o'=>18, - ''=>18, - ''=>20, - ''=>20, - 'p'=>22, - 'q'=>23, - 'q'=>24, - 'r'=>25, - 's'=>26, - 't'=>27, - 'u'=>28, - ''=>28, - ''=>30, - ''=>30, - 'v'=>32, - 'x'=>33, - 'w'=>34, - 'y'=>35, - 'z'=>36 - ); - - $a = kisbetus(mb_convert_encoding($a,'ISO-8859-2','UTF-8')); - $b = kisbetus(mb_convert_encoding($b,'ISO-8859-2','UTF-8')); - - if ($a==$b) return 0; - - $i=0; - while( $i= 1000) { $roman .= "M"; $number = $number -1000; } - while ($number >= 900) { $roman .= "CM"; $number = $number -900; } - while ($number >= 500) { $roman .= "D"; $number = $number -500; } - while ($number >= 400) { $roman .= "CD"; $number = $number -400; } - while ($number >= 100) { $roman .= "C"; $number = $number -100; } - while ($number >= 90) { $roman .= "XC"; $number = $number -90; } - while ($number >= 50) { $roman .= "L"; $number = $number -50; } - while ($number >= 40) { $roman .= "XL"; $number = $number -40; } - while ($number >= 10) { $roman .= "X"; $number = $number -10; } - while ($number >= 9) { $roman .= "IX"; $number = $number -9; } - while ($number >= 5) { $roman .= "V"; $number = $number -5; } - while ($number >= 4) { $roman .= "IV"; $number = $number -4; } - while ($number >= 1) { $roman .= "I"; $number = $number -1; } - return $roman; - } - - function visszafele($e) {$b='';for($i=0; $i= 0; $i--) $ret |= ord($res[$i]); - return !$ret; - } - } - } - - if ( !function_exists( 'hex2bin' ) ) { - function hex2bin( $str ) { - $sbin = ""; - $len = strlen( $str ); - for ( $i = 0; $i < $len; $i += 2 ) { - $sbin .= pack( "H*", substr( $str, $i, 2 ) ); - } - return $sbin; - } - } - - function makeLinksClickable($text){ - $pattern[] = '/(\S+@\S+\.\S+)/'; - $replace[] = '$1'; - $pattern[] = '!(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;//=]+)!i'; -// $replace[] = '$1 '; - $replace[] = '[LINK]'; - return preg_replace($pattern, $replace, $text); - } - function supertext($txt) { - $r = $txt; - $r = htmlspecialchars($r); - $pattern[]='/@diakId:(\d+)/'; - $pattern[]='/@tanarId:(\d+)/'; - $pattern[]='/@tankorId:(\d+)/'; - //$pattern[]='/@osztalyId:(\d+)/'; - $replacement[]=''; - $replacement[]=''; - $replacement[]='[tankör adatok]'; - //$replacement[]='[osztály adatok]'; - $r = preg_replace($pattern,$replacement,$r); - return $r; - } - - - require_once('include/share/date/names.php'); - function superdate($datetime) { - global $aHetNapjai; - $stamp = strtotime($datetime); - $date = date('Y-m-d',$stamp); - $dow = date('N',$stamp); - $Hi = date('H:i',$stamp); - if ($Hi == '00:00') $Hi = ''; - if ($stamp<=strtotime('-6 day')) { - return date('Y.m.d.', $stamp).' '.$Hi; - } elseif ($date==date('Y-m-d')) { - return 'Ma '.$Hi; - } elseif ($dow>date('N')) { - return 'Múlt hét '.kisbetus($aHetNapjai[$dow-1]).' '.$Hi; - } else { - return $aHetNapjai[$dow-1].' '.$Hi; - } - } - -?> -- cgit v1.2.3