This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Returns the version of Internet Explorer or a -1 | |
// (indicating the use of another browser). | |
function getIEVer() { | |
var rv = -1; // Return value assumes failure. | |
if (navigator.appName == 'Microsoft Internet Explorer') { | |
var ua = navigator.userAgent; | |
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); | |
if (re.exec(ua) !== null) { | |
rv = parseFloat(RegExp.$1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Change the URL in the format of key/value | |
function UpdateQueryString(key, value, url) { | |
if (!url) url = window.location.href; | |
var re = new RegExp("([/])" + key + "/.*?(/|$)", "gi"); | |
var separator = '/'; | |
if (url.match(re)) { | |
return url.replace(re, '$1' + key + "/" + value + '$2'); | |
} | |
else { | |
return url + separator + key + "/" + value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function formatFileSize($fileSize) { | |
if ($fileSize >= 1073741824) { | |
$fileSize = round($fileSize / 1073741824 * 100) / 100 . " " . self::_translate()->_('ГБ'); | |
} elseif ($fileSize >= 1048576) { | |
$fileSize = round($fileSize / 1048576 * 100) / 100 . " " . self::_translate()->_('МБ'); | |
} elseif ($fileSize >= 1024) { | |
$fileSize = round($fileSize / 1024 * 100) / 100 . " " . self::_translate()->_('КБ'); | |
} else { | |
$fileSize = $fileSize . " " . self::_translate()->_('Б'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function filesizeUrl($url) { | |
return ($data = @file_get_contents( $url )) ? strlen( $data ) : false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function listdir($dir) { | |
$current_dir = opendir( $dir ); | |
while ( $entryname = readdir( $current_dir ) ) { | |
if( is_dir( "$dir/$entryname" ) and ($entryname != "." and $entryname != "..") ) { | |
listdir( "${dir}/${entryname}" ); | |
} elseif( $entryname != "." and $entryname != ".." ) { | |
unlink( "${dir}/${entryname}" ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function totranslit($var, $lower = true, $punkt = true) { | |
$NpjLettersFrom = "абвгдезиклмнопрстуфцыі"; | |
$NpjLettersTo = "abvgdeziklmnoprstufcyi"; | |
$NpjBiLetters = array ("й" => "j", "ё" => "yo", "ж" => "zh", "х" => "x", "ч" => "ch", "ш" => "sh", "щ" => "shh", "э" => "ye", "ю" => "yu", "я" => "ya", "ъ" => "", "ь" => "", "ї" => "yi", "є" => "ye" ); | |
$NpjCaps = "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЬЪЫЭЮЯЇЄІ"; | |
$NpjSmall = "абвгдеёжзийклмнопрстуфхцчшщьъыэюяїєі"; | |
$var = str_replace( ".php", "", $var ); | |
$var = trim( strip_tags( $var ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkHTTPS() { | |
if(!empty($_SERVER['HTTPS'])) { | |
return ($_SERVER['HTTPS'] !== 'off') ? true : false; | |
} | |
else { | |
return ($_SERVER['SERVER_PORT'] == 443) ? true : false; | |
} | |
} | |
function getCurURI(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('DOMContentLoaded', function () { | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
white-space nowrap | |
overflow hidden | |
text-overflow ellipsis | |
display block |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--[if lt IE 9]> | |
<script> | |
var e = ("article,aside,figcaption,figure,footer,header,hgroup,nav,section,time").split(','); | |
for (var i = 0; i < e.length; i++) { | |
document.createElement(e[i]); | |
} | |
</script> | |
<![endif]--> |
OlderNewer