on = 'playstation'; var $deviceNintendoDs = 'nitro'; var $deviceNintendo = 'nintendo'; var $deviceWii = 'wii'; var $deviceXbox = 'xbox'; var $deviceArchos = 'archos'; var $engineOpera = 'opera'; //Popular browser var $engineNetfront = 'netfront'; //Common embedded OS browser var $engineUpBrowser = 'up.browser'; //common on some phones var $engineOpenWeb = 'openweb'; //Transcoding by OpenWave server var $deviceMidp = 'midp'; //a mobile Java technology var $uplink = 'up.link'; var $engineTelecaQ = 'teleca q'; //a modern feature phone browser var $devicePda = 'pda'; //some devices report themselves as PDAs var $mini = 'mini'; //Some mobile browsers put 'mini' in their names. var $mobile = 'mobile'; //Some mobile browsers put 'mobile' in their user agent strings. var $mobi = 'mobi'; //Some mobile browsers put 'mobi' in their user agent strings. //Use Maemo, Tablet, and Linux to test for Nokia's Internet Tablets. var $maemo = 'maemo'; var $linux = 'linux'; var $qtembedded = 'qt embedded'; //for Sony Mylo and others var $mylocom2 = 'com2'; //for Sony Mylo also //In some UserAgents, the only clue is the manufacturer. var $manuSonyEricsson = "sonyericsson"; var $manuericsson = "ericsson"; var $manuSamsung1 = "sec-sgh"; var $manuSony = "sony"; var $manuHtc = "htc"; //Popular Android and WinMo manufacturer //In some UserAgents, the only clue is the operator. var $svcDocomo = "docomo"; var $svcKddi = "kddi"; var $svcVodafone = "vodafone"; //Disambiguation strings. var $disUpdate = "update"; //pda vs. update //************************** //The constructor. Allows the latest PHP (5.0+) to locate a constructor object and initialize the object. function __construct() { $this->uagent_info(); } //************************** //The object initializer. Initializes several default variables. function uagent_info() { $this->useragent = isset($_SERVER['HTTP_USER_AGENT'])?strtolower($_SERVER['HTTP_USER_AGENT']):''; $this->httpaccept = isset($_SERVER['HTTP_ACCEPT'])?strtolower($_SERVER['HTTP_ACCEPT']):''; //Let's initialize some values to save cycles later. $this->InitDeviceScan(); } //************************** // Initialize Key Stored Values. function InitDeviceScan() { global $isIphone, $isAndroidPhone, $isTierTablet, $isTierIphone; //We'll use these 4 variables to speed other processing. They're super common. $this->isIphone = $this->DetectIphoneOrIpod(); $this->isAndroidPhone = $this->DetectAndroidPhone(); $this->isTierIphone = $this->DetectTierIphone(); $this->isTierTablet = $this->DetectTierTablet(); //Optional: Comment these out if you don't need them. global $isTierRichCss, $isTierGenericMobile; $this->isTierRichCss = $this->DetectTierRichCss(); $this->isTierGenericMobile = $this->DetectTierOtherPhones(); } //************************** //Returns the contents of the User Agent value, in lower case. function Get_Uagent() { return $this->useragent; } //************************** //Returns the contents of the HTTP Accept value, in lower case. function Get_HttpAccept() { return $this->httpaccept; } //************************** // Detects if the current device is an iPhone. function DetectIphone() { if (stripos($this->useragent, $this->deviceIphone) > -1) { //The iPad and iPod Touch say they're an iPhone. So let's disambiguate. if ($this->DetectIpad() == $this->true || $this->DetectIpod() == $this->true) return $this->false; //Yay! It's an iPhone! else return $this->true; } else return $this->false; } //************************** // Detects if the current device is an iPod Touch. function DetectIpod() { if (stripos($this->useragent, $this->deviceIpod) > -1) return $this->true; else return $this->false; } //************************** // Detects if the current device is an iPad tablet. function DetectIpad() { if (stripos($this->useragent, $this->deviceIpad) > -1 && $this->DetectWebkit() == $this->true) return $this->true; else return $this->false; } //************************** // Detects if the current device is an iPhone or iPod Touch. function DetectIphoneOrIpod() { //We repeat the searches here because some iPods may report themselves as an iPhone, which would be okay. if (stripos($this->useragent, $this->deviceIphone) > -1 || stripos($this->useragent, $this->deviceIpod) > -1) return $this->true; else return $this->false; } //************************** // Detects *any* iOS device: iPhone, iPod Touch, iPad. function DetectIos() { if (($this->DetectIphoneOrIpod() == $this->true) || ($this->DetectIpad() == $this->true)) return $this->true; else return $this->false; } //************************** // Detects *any* Android OS-based device: phone, tablet, and multi-media player. // Also detects Google TV. function DetectAndroid() { if ((stripos($this->useragent, $this->deviceAndroid) > -1) || ($this->DetectGoogleTV() == $this->true)) return $this->true; //Special check for the HTC Flyer 7" tablet if ((stripos($this->useragent, $this->deviceHtcFlyer) > -1)) return $this->true; else return $this->false; } //************************** // Detects if the current device is a (small-ish) Android OS-based device // used for calling and/or multi-media (like a Samsung Galaxy Player). // Google says these devices will have 'Android' AND 'mobile' in user agent. // Ignores tablets (Honeycomb and later). function DetectAndroidPhone() { if (($this->DetectAndroid() == $this->true) && (stripos($this->useragent, $this->mobile) > -1)) return $this->true; //Special check for Android phones with Opera Mobile. They should report here. if (($this->DetectOperaAndroidPhone() == $this->true)) return $this->true; //Special check for the HTC Flyer 7" tablet. It should report here. if ((stripos($this->useragent, $this->deviceHtcFlyer) > -1)) return $this->true; else return $this->false; } //************************** // Detects if the current device is a (self-reported) Android tablet. // Google says these devices will have 'Android' and NOT 'mobile' in their user agent. function DetectAndroidTablet() { //First, let's make sure we're on an Android device. if ($this->DetectAndroid() == $this->false) return $this->false; //Special check for Opera Android Phones. They should NOT report here. if ($this->DetectOperaMobile() == $this->true) return $this->false; //Special check for the HTC Flyer 7" tablet. It should NOT report here. if ((stripos($this->useragent, $this->deviceHtcFlyer) > -1)) return $this->false; //Otherwise, if it's Android and does NOT have 'mobile' in it, Google says it's a tablet. if (stripos($this->useragent, $this->mobile) > -1) return $this->false; else return $this->true; } //************************** // Detects if the current device is an Android OS-based device and // the browser is based on WebKit. function DetectAndroidWebKit() { if (($this->DetectAndroid() == $this->true) && ($this->DetectWebkit() == $this->true)) return $this->true; else return $this->false; } //************************** // Detects if the current device is a GoogleTV. function DetectGoogleTV() { if (stripos($this->useragent, $this->deviceGoogleTV) > -1) return $this->true; else return $this- if (($this->isIphone == $this->true) || ($this->isAndroidPhone == $this->true) || ($this->isTierIphone == $this->true) || ($this->DetectS60OssBrowser() == $this->true) || ($this->DetectSymbianOS() == $this->true) || ($this->DetectWindowsMobile() == $this->true) || ($this->DetectWindowsPhone7() == $this->true) || ($this->DetectBlackBerry() == $this->true) || ($this->DetectPalmWebOS() == $this->true) || ($this->DetectPalmOS() == $this->true) || ($this->DetectGarminNuvifone() == $this->true)) return $this->true; else return $this->false; } //************************** // Detects whether the device is a Brew-powered device. function DetectBrewDevice() { if (stripos($this->useragent, $this->deviceBrew) > -1) return $this->true; else return $this->false; } //************************** // Detects the Danger Hiptop device. function DetectDangerHiptop() { if (stripos($this->useragent, $this->deviceDanger) > -1 || stripos($this->useragent, $this->deviceHiptop) > -1) return $this->true; else return $this->false; } //************************** // Detects if the current browser is Opera Mobile or Mini. function DetectOperaMobile() { if (stripos($this->useragent, $this->engineOpera) > -1) { if ((stripos($this->useragent, $this->mini) > -1) || (stripos($this->useragent, $this->mobi) > -1)) return $this->true; else return $this->false; } else return $this->false; } //************************** // Detects if the current browser is Opera Mobile // running on an Android phone. function DetectOperaAndroidPhone() { if ((stripos($this->useragent, $this->engineOpera) > -1) && (stripos($this->useragent, $this->deviceAndroid) > -1) && (stripos($this->useragent, $this->mobi) > -1)) return $this->true; else return $this->false; } //************************** // Detects if the current browser is Opera Mobile // running on an Android tablet. function DetectOperaAndroidTablet() { if ((stripos($this->useragent, $this->engineOpera) > -1) && (stripos($this->useragent, $this->deviceAndroid) > -1) && (stripos($this->useragent, $this->deviceTablet) > -1)) return $this->true; else return $this->false; } //************************** // Detects whether the device supports WAP or WML. function DetectWapWml() { if (stripos($this->httpaccept, $this->vndwap) > -1 || stripos($this->httpaccept, $this->wml) > -1) return $this->true; else return $this->false; } //************************** // Detects if the current device is an Amazon Kindle (eInk devices only). // Note: For the Kindle Fire, use the normal Android methods. function DetectKindle() { if (stripos($this->useragent, $this->deviceKindle) > -1 && $this->DetectAndroid() == $this->false) return $this->true; else return $this->false; } //************************** // Detects if the current Amazon device is using the Silk Browser. // Note: Typically used by the the Kindle Fire. function DetectAmazonSilk() { if (stripos($this->useragent, $this->engineSilk) > -1) return $this->true; else return $this->false; } //************************** // The quick way to detect for a mobile device. // Will probably detect most recent/current mid-tier Feature Phones // as well as smartphone-class devices. Excludes Apple iPads and other modern tablets. function DetectMobileQuick() { //Let's exclude tablets if ($this->isTierTablet == $this->true) return $this->false; //Most mobile browsing is done on smartphones if ($this->DetectSmartphone() == $this->true) return $this->true; if (($this->DetectWapWml() == $this->true) || ($this->DetectBrewDevice() == $this->true) || ($this->DetectOperaMobile() == $this->true)) return $this->true; if ((stripos($this->useragent, $this->engineNetfront) > -1) || (stripos($this->useragent, $this->engineUpBrowser) > -1) || (stripos($this->useragent, $this->engineOpenWeb) > -1)) return $this->true; if (($this->DetectDangerHiptop() == $this->true) || ($this->DetectMidpCapable() == $this->true) || ($this->DetectMaemoTablet() == $this->true) || ($this->DetectArchos() == $this->true)) return $this->true; if ((stripos($this->useragent, $this->devicePda) > -1) && !(stripos($this->useragent, $this->disUpdate) > -1)) return $this->true; if (stripos($this->useragent, $this->mobile) > -1) return $this->true; //We also look for Kindle devices if ($this->DetectKindle() == $this->true || $this->DetectAmazonSilk() == $this->true) return $this->true; else return $this->false; } //************************** // Detects if the current device is a Sony Playstation. function DetectSonyPlaystation() { if (stripos($this->useragent, $this->devicePlaystation) > -1) return $this->true; else return $this->false; } //************************** // Detects if the current device is a Nintendo game device. function DetectNintendo() { if (stripos($this->useragent, $this->deviceNintendo) > -1 || stripos($this->useragent, $this->deviceWii) > -1 || stripos($this->useragent, $this->deviceNintendoDs) > -1) return $this->true; else return $this->false; } //************************** // Detects if the current device is a Microsoft Xbox. function DetectXbox() { if (stripos($this->useragent, $this->deviceXbox) > -1) return $this->true; else return $this->false; } //************************** // Detects if the current device is an Internet-capable game console. function DetectGameConsole() { if ($this->DetectSonyPlaystation() == $this->true) return $this->true; else if ($this->DetectNintendo() == $this->true) return $this->true; else if ($this->DetectXbox() == $this->true) return $this->true; else return $this->false; } //************************** // Detects if the current device supports MIDP, a mobile Java technology. function DetectMidpCapable() { if (stripos($this->useragent, $this->deviceMidp) > -1 || stripos($this->httpaccept, $this->deviceMidp) > -1) return $this->true; else return $this->false; } //************************** // Detects if the current device is on one of the Maemo-based Nokia Internet Tablets. function DetectMaemoTablet() { if (stripos($this->useragent, $this->maemo) > -1) return $this->true; //For Nokia N810, must be Linux + Tablet, or else it could be something else. if ((stripos($this->useragent, $this->linux) > -1) && (stripos($this->useragent, $this->deviceTablet) > -1) && ($this->DetectWebOSTablet() == $this->false) && ($this->DetectAndroid() == $this->false)) return $this->true; else return $this->false; } //************************** // Detects if the current device is an Archos media player/Internet tablet. function DetectArchos() { if (stripos($this->useragent, $this->deviceArchos) > -1) return $this->true; else return $this->false; } //************************** // Detects if the current browser is a Sony Mylo device. function DetectSonyMylo() { if (stripos($this->useragent, $this->manuSony) > -1) { if ((stripos($this->useragent, $this->qtembedded) > -1) || (stripos($this->useragent, $this->mylocom2) > -1)) { return $this->true; } else return $this->false; } else return $this->false; } //************************** // The longer and more thorough way to detect for a mobile device. // Will probably detect most feature phones, // smartphone-class devices, Internet Tablets, // Internet-enabled game consoles, etc. // This ought to catch a lot of the more obscure and older devices, also -- // but no promises on thoroughness! function DetectMobileLong() { if ($this->DetectMobileQuick() == $this->true) return $this->true; if ($this->DetectGameConsole() == $this->true) return $this->true; if ($this->DetectSonyMylo() == $this->true) return $this->true; //Detect older phones from certain manufacturers and operators. if (stripos($this->useragent, $this->uplink) > -1) return $this->true; if (stripos($this->useragent, $this->manuSonyEricsson) > -1) return $this->true; if (stripos($this->useragent, $this->manuericsson) > -1) return $this->true; if (stripos($this->useragent, $this->manuSamsung1) > -1) return $this->true; if (stripos($this->useragent, $this->svcDocomo) > -1) return $this->true; if (stripos($this->useragent, $this->svcKddi) > -1) return $this->true; if (stripos($this->useragent, $this->svcVodafone) > -1) return $this->true; else return $this->false; } //***************************** // For Mobile Web Site Design //***************************** //************************** // The quick way to detect for a tier of devices. // This method detects for the new generation of // HTML 5 capable, larger screen tablets. // Includes iPad, Android (e.g., Xoom), BB Playbook, WebOS, etc. function DetectTierTablet() { if (($this->DetectIpad() == $this->true) || ($this->DetectAndroidTablet() == $this->true) || ($this->DetectBlackBerryTablet() == $this->true) || ($this->DetectWebOSTablet() == $this->true)) return $this->true; else return $this->false; } //************************** // The quick way to detect for a tier of devices. // This method detects for devices which can // display iPhone-optimized web content. // Includes iPhone, iPod Touch, Android, Windows Phone 7, WebOS, etc. function DetectTierIphone() { if (($this->isIphone == $this->true) || ($this->isAndroidPhone == $this->true)) return $this->true; if (($this->DetectBlackBerryWebKit() == $this->true) && ($this->DetectBlackBerryTouch() == $this->true)) return $this->true; if ($this->DetectWindowsPhone7() == $this->true) return $this->true; if ($this->DetectPalmWebOS() == $this->true) return $this->true; if ($this->DetectGarminNuvifone() == $this->true) return $this->true; else return $this->false; } //************************** // The quick way to detect for a tier of devices. // This method detects for devices which are likely to be capable // of viewing CSS content optimized for the iPhone, // but may not necessarily support JavaScript. // Excludes all iPhone Tier devices. function DetectTierRichCss() { if ($this->DetectMobileQuick() == $this->true) { //Exclude iPhone Tier and e-Ink Kindle devices if (($this->DetectTierIphone() == $this->true) || ($this->DetectKindle() == $this->true)) return $this->false; //The following devices are explicitly ok. if ($this->DetectWebkit() == $this->true) //Any WebKit return $this->true; if ($this->DetectS60OssBrowser() == $this->true) return $this->true; //Note: 'High' BlackBerry devices ONLY if ($this->DetectBlackBerryHigh() == $this->true) return $this->true; //Older Windows 'Mobile' isn't good enough for iPhone Tier. if ($this->DetectWindowsMobile() == $this->true) return $this->true; if (stripos($this->useragent, $this->engineTelecaQ) > -1) return $this->true; //default else return $this->false; } else return $this->false; } //************************** // The quick way to detect for a tier of devices. // This method detects for all other types of phones, // but excludes the iPhone and RichCSS Tier devices. function DetectTierOtherPhones() { //Exclude devices in the other 2 categories if (($this->DetectMobileLong() == $this->true) && ($this->DetectTierIphone() == $this->false) && ($this->DetectTierRichCss() == $this->false)) return $this->true; else return $this->false; } //Was informed by a MobileESP user that it's a best practice // to omit the closing ?> marks here. They can sometimes // cause errors with HTML headers. } $this->UTILS = new cs_utils(); $this->UTILS->_PATH = C_PATH.'/'.cs_utils; $this->UTILS->PATH = C_PATH.'/'.cs_utils; $this->UTILS->_DIR = C_DIR.'/'.cs_utils; $this->UTILS->DIR = C_DIR.'/'.cs_utils; ?>','_','x' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'','' ); $string=str_replace($zamien_co, $zamien_na, strtolower(strip_tags($string))); // $string = preg_replace('~[^\\pL0-9_]+~u', '_', $string); // substitutes anything but letters, numbers and '_' with separator // $string = iconv("utf-8", "us-ascii//TRANSLIT", trim($string, "_")); // TRANSLIT does the whole job // $string = preg_replace('~[^-a-z0-9_]+~', '', strtolower($string)); // keep only letters, numbers, '_' and separator $string = preg_replace('/(_){2,}/', '_', $string); return $string; } function modNAMEnoslash($string) { $string=trim($string); $zamien_co=array('ą','±','ć','ę','ł','ń','ó','ś','¶','ż','Ľ','ź','ˇ','Ć','Ę','Ł','Ń','Ó','Ś','¦','Ż','Ź','Ą','"',"'",'¬',':','(',')','{','}','[',']',' ',',','\\','*','®','?','@','=','+','!','^','$','%','&','~',':',';'); $zamien_na=array('a','a','c','e','l','n','o','s','s','z','z','z','a','c','e','l','n','o','s','_','z','z','a','' ,'' ,'_','' ,'' ,'' ,'' ,'' ,'_','_','-','_','x' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ); $string=str_replace($zamien_co, $zamien_na, strtolower(strip_tags($string))); // $string = preg_replace('~[^\\pL0-9_]+~u', '_', $string); // substitutes anything but letters, numbers and '_' with separator // $string = iconv("utf-8", "us-ascii//TRANSLIT", trim($string, "_")); // TRANSLIT does the whole job // $string = preg_replace('~[^-a-z0-9_]+~', '', strtolower($string)); // keep only letters, numbers, '_' and separator //$string = preg_replace('/(_){2,}/', '_', $string); return $string; } function string_filter_in($string) { $part1='&oa'; $part2='cute;'; $string=str_replace($part1.$part2,'ó',$string); $string=str_replace('

 

','',$string); if(!is_array($string))$string=addslashes($string);else $string=addslashes(implode($string)); return $string; } function string_filter_in_array() { for($i=0; $istring_filter_in($_POST[func_get_arg($i)]); } } function sfia() { for($i=0; $istring_filter_in($_POST[func_get_arg($i)]); } } function sfi($s,$specialchars=false) { if($specialchars==true) { return htmlspecialchars($this->string_filter_in($s)); } else { return $this->string_filter_in($s); } } function sfo($s,$specialchars=false) { if($specialchars==true) { return htmlspecialchars(stripslashes($s)); } else { return stripslashes($s); } } function sfot($s) { return htmlspecialchars(stripslashes($s)); } function ucfirst_pl($txt) { $txt=ucfirst($txt); $first=substr($txt,0,1); $rest=substr($txt,1,strlen($txt)); $zamien_co=array('ą','ć','ę','ł','ń','ó','ś','ż','ź'); $zamien_na=array('Ą','Ć','Ę','Ł','Ń','Ó','Ź','Ż','Ź'); $first=str_replace($zamien_co,$zamien_na,$first); return $first.$rest; } function lcfirst_pl($txt) { $first=substr($txt,0,1); $first=strtolower($first); $rest=substr($txt,1,strlen($txt)); $zamien_co=array('Ą','Ć','Ę','Ł','Ń','Ó','Ś','Ż','Ź'); $zamien_na=array('ą','ć','ę','ł','ń','ó','ś','ż','ź'); $first=str_replace($zamien_co,$zamien_na,$first); return $first.$rest; } function strtolower_pl($txt) { $zamien_co=array('Ą','Ć','Ę','Ł','Ń','Ó','Ś','Ż','Ź'); $zamien_na=array('ą','ć','ę','ł','ń','ó','ś','ż','ź'); return strtolower(str_replace($zamien_co,$zamien_na,$txt)); } function strtoupper_pl($txt) { $zamien_co=array('ą','ć','ę','ł','ń','ó','ś','ż','ź'); $zamien_na=array('Ą','Ć','Ę','Ł','Ń','Ó','Ś','Ż','Ź'); return strtoupper(str_replace($zamien_co,$zamien_na,$txt)); } function strip_multiple_br($tekst, $strip_end=true) { $tekst=preg_replace('/(<[bB][rR][ \/]{0,}>[\s]{0,}){3,}/', '

', $tekst); if($strip_end==true) $tekst=preg_replace('/(<[bB][rR][ \/]{0,}>[\s]{0,}){1,}$/', '', $tekst); return $tekst; } function strip_multiple_nl($tekst, $strip_end=true) { $tekst=preg_replace('/([\r\n]+\t*[\r\n]*){3,}/', "\n\n", $tekst); return trim($tekst); } function nl2br($txt) { return str_replace('\n',"
",$txt); } function post_filter() { if(count($_POST)>0) foreach($_POST as $key => $value) { if(!@is_array($value) && !strstr($key,'[]')) { $_POST[$key]=$this->sfi(trim($_POST[$key])); } } } function get2field($field, $no_special=false) { $t=trim(urldecode(stripslashes($_GET[$field]))); if($no_special==true) return $t; return htmlspecialchars($t); } function get2string($field) { return $this->get2field($field,true); } function transliterate($txt) { $chars = array( 'a' => 'a', 'ô' => 'o', 'I' => 'd', '?' => 'f', 'ë' => 'e', 'š' => 's', 'o' => 'o', 'ü' => 'ss', 'ă' => 'a', 'ř' => 'r', '?' => 't', 'ň' => 'n', 'a' => 'a', 'k' => 'k', 's' => 's', '?' => 'y', 'n' => 'n', 'ĺ' => 'l', 'h' => 'h', '?' => 'p', 'ó' => 'o', 'ú' => 'u', 'ě' => 'e', 'é' => 'e', 'ç' => 'c', '?' => 'w', 'c' => 'c', 'o' => 'o', '?' => 's', 'o' => 'o', 'g' => 'g', 't' => 't', '?' => 's', 'e' => 'e', 'c' => 'c', 'ś' => 's', 'î' => 'i', 'ű' => 'u', 'ć' => 'c', 'ę' => 'e', 'w' => 'w', '?' => 't', 'u' => 'u', 'i' => 'c', 'ö' => 'o', 'e' => 'e', 'y' => 'y', 'š' => 'a', 'ł' => 'l', 'u' => 'u', 'ů' => 'u', 'ż' => 's', 'g' => 'g', 'l' => 'l', 'f' => 'f', 'ž' => 'z', '?' => 'w', '?' => 'b', 'a' => 'a', 'i' => 'i', 'i' => 'i', '?' => 'd', 'ť' => 't', 'r' => 'r', 'ä' => 'a', 'í' => 'i', 'ŕ' => 'r', 'e' => 'e', 'ü' => 'u', 'o' => 'o', 'e' => 'e', 'n' => 'n', 'ń' => 'n', 'h' => 'h', 'g' => 'g', 'đ' => 'd', 'j' => 'j', 'y' => 'y', 'u' => 'u', 'u' => 'u', 'u' => 'u', 'ţ' => 't', 'ý' => 'y', 'ő' => 'o', 'â' => 'a', 'ž' => 'l', '?' => 'w', 'ż' => 'z', 'i' => 'i', 'a' => 'a', 'g' => 'g', '?' => 'm', 'o' => 'o', 'i' => 'i', 'u' => 'u', 'i' => 'i', 'ź' => 'z', 'á' => 'a', 'u' => 'u', '?' => 'th', '?' => 'dh', 'a' => 'a', 'ľ' => 'u', 'e' => 'e', ); return str_replace(array_keys($chars), array_values($chars), $txt); } function check_spam($content, $words) { $content=strip_tags($content); $zamien_co=array('"',"'",':',';','(',')','.',',','/','\\','*','?','@','=','!','^','$','%','&','_','-','+','|'); $zamien_na=array('' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ); $content=str_replace($zamien_co,$zamien_na,$content); $slowa='|'.str_replace(' ', '|', $words).'|'; $content_slowa = preg_split("/\s/", $content); if(count($content_slowa)>0) foreach($content_slowa as $slowo) { $slowo=trim($slowo); if(empty($slowo)) continue; if(stristr($slowa, '|'.$slowo.'|')) $matched_words[] = $slowo; } if(count($matched_words)==0) return array(); return $matched_words; } function make_urls($txt) { $patterns[0] = '/(http\:\/\/[^\s]+)/'; $patterns[1] = '/([\s])www\.([^\s]+)/'; // $replacements[0] = '$1'; // $replacements[1] = '$1www.$2'; $replacements[0] = '$1'; $replacements[1] = '$1www.$2'; if(@is_array($txt)) { return array( trim(preg_replace($patterns, $replacements, ' '.$txt[0].' ')), trim(preg_replace($patterns, $replacements, ' '.$txt[1].' ')) ); } else { return trim(preg_replace($patterns, $replacements, ' '.$txt.' ')); } } //addons function apply_read_addon($addon, $value) { global $CS; switch($addon) { case 'date': if($value==0) $value='-'; break; case 'to_null': if($value==0) $value=''; break; case 'to_upper': $value=$this->strtoupper_pl($value); break; case 'to_lower': $value=$this->strtolower_pl($value); break; case 'force_empty': $value=''; break; case 'time_ago': $value=$CS->STRING->time_ago($value); break; case 'time_ago_tip': $value='FORM->tip($value==0 ? '':$value).'>'.$CS->STRING->time_ago($value).''; break; case 'day_ago': $value=$CS->STRING->day_ago($value); break; case 'price': $value=str_replace('.',',',$value); break; case 'email': if(!empty($value)) $value=''.$CS->STRING->sfo($value).''; break; case 'link': if(!empty($value)) $value=''.$CS->STRING->sfo($value).''; break; case 'info': $value='FORM->tip($value).'>'.$CS->IMAGE->icon('form/info.gif').''; break; case 'info_link': $value='FORM->tip($value).'>'.$CS->IMAGE->icon('form/info.gif').''; break; } return $value; } function apply_write_addon($addon, $value) { global $CSA; switch($addon) { case 'to_upper': $value=$this->strtoupper_pl($value); break; case 'to_lower': $value=$this->strtolower_pl($value); break; case 'price': $value=str_replace(',','.',$value); break; case 'md5': if(!empty($value)) $value=md5($value); else $skip=1; break; case 'pass_trans': if(!empty($value)) $value=$CSA->LAY->transform_pass($value); else $skip=1; break; } return array('skip'=>$skip, 'value'=>$value); } function punycode($txt, $reverse=false) { require_once($this->_DIR.'/idn2punycode.php'); $IDN=new idn_convert(); return ($reverse==false ? $IDN->encode($txt) : $IDN->decode($txt)); } /** * Change BBCodes to HTML in text * @param string $text * @return string */ function bbcode($text) { require_once($this->_DIR.'/parserBB.php'); $parser = new parserBB(); $text = htmlspecialchars_decode($parser->bb_to_html($text)); return $text; } function crypt($input, $crypt_key=false) { return $this->encrypt($input, $crypt_key); } function encrypt($input, $crypt_key=false) { $use_hash=false; require_once($this->_DIR.'/blowfish/crypt.class.php'); global $CRYPT; global $CONF; $CRYPT =& Crypt_Blowfish::factory('cbc'); if(PEAR::isError($bf)) die($CRYPT->getMessage()); $key = (strlen($crypt_key)>0 ? $crypt_key:( strlen($CONF->SITE_NAME)>0 ? $CONF->SITE_NAME : 'kfx_cms_crypt') ); $CRYPT->setKey($key, 'a1-b2=c3'); return ($use_hash==true ? '##':'').base64_encode(trim($CRYPT->encrypt($input))).($use_hash==true ? '##':''); } function decrypt($input, $crypt_key=false) { require_once($this->_DIR.'/blowfish/crypt.class.php'); global $CRYPT; global $CONF; $CRYPT =& Crypt_Blowfish::factory('cbc'); if(PEAR::isError($bf)) die($CRYPT->getMessage()); $key = (strlen($crypt_key)>0 ? $crypt_key:( strlen($CONF->SITE_NAME)>0 ? $CONF->SITE_NAME : 'kfx_cms_crypt') ); $CRYPT->setKey($key, 'a1-b2=c3'); $use_hash=(substr($input,2)=='##' && substr($input,0,-2)=='##' ? true:false); $decrypted = $CRYPT->decrypt(base64_decode($use_hash==true ? substr(substr($input,2),0,-2):$input)); if(PEAR::isError($decrypted)) die($decrypted->getMessage()); return trim($decrypted); } function hide($t) { return $this->scramble_base64($t); } function scramble_base64($t) { return @base64_encode(str_replace( array('M','9','V','6','N','U','W','R','2'), array('_','%','*','^','!','|','$',',','@'), base64_encode($t) )); } function show($t) { return $this->descramble_base64($t); } function descramble_base64($t) { return @base64_decode(str_replace( array('_','%','*','^','!','|','$',',','@'), array('M','9','V','6','N','U','W','R','2'), base64_decode($t) )); } } $this->STRING = new cs_string(); $this->STRING->_PATH = C_PATH.'/'.cs_string; $this->STRING->PATH = C_PATH.'/'.cs_string; $this->STRING->_DIR = C_DIR.'/'.cs_string; $this->STRING->DIR = C_DIR.'/'.cs_string; ?>
Fatal error: Call to a member function modNAMEnoslash() on a non-object in /classes/route.php on line 17