'.$default.'
'; if($name == "") $name = isset($_SESSION["s_$getName"]) ? $_SESSION["s_$getName"] : ""; else $_SESSION["s_$getName"] = $name; return $name; } function is_date($dateString, $dateFormat="d.m.Y") { DateTime::createFromFormat($dateFormat, $dateString); $date_errors = DateTime::getLastErrors(); if ($date_errors['warning_count'] + $date_errors['error_count'] > 0) { return false; } return true; } function is_time($timeString, $seconds=false) { $bits = explode(':', $timeString); $maxBits = $seconds ? 3 : 2; if( count($bits) != $maxBits || !is_numeric($bits[0]) || !is_numeric($bits[1]) || ($seconds && !is_numeric($bits[2])) || $bits[0] > 24 || $bits[1] > 59 || ($bits[0] == 24 && $bits[1] > 0) || ($seconds && $bits[2] > 59)) { return false; } else { return true; } } function convertDateString($string, $fromFormat="d.m.Y", $toFormat="Y-m-d") { $date = DateTime::createFromFormat($fromFormat, $string); return $date->format($toFormat); } function encode_email($mail) { $l = strlen($mail); $ret = ""; for($i=0; $i<$l; $i++) { $ret .= chr(ord($mail{$i})+1); } return $ret; } function img2lightbox(&$html) { $suchmuster = '/]*src=\"(([^\"]+\/)*\d([^\"]+)_lightbox(\.[^\"]+))\"\s+[^>]*>/i'; $ersetzung = ""; return preg_replace($suchmuster, $ersetzung, $html); } function date_mysql2german($date) { $d = explode("-",$date); return sprintf("%02d.%02d.%04d", $d[2], $d[1], $d[0]); } function date_german2mysql($date) { $d = explode(".",$date); return sprintf("%04d-%02d-%02d", $d[2], $d[1], $d[0]); } function shorten($txt, $size) { $txt = stripnl($txt); $nohtml = striphtml($txt); $nohtml = html_entity_decode ($nohtml ,ENT_COMPAT, "UTF-8"); if(mb_strlen($nohtml) <= $size) return $nohtml; else return mb_substr($nohtml,0,$size)."..."; } /** * shorten HTML text. * * Cuts a string to the length of $length and replaces the last characters * with the ending if the text is longer than length. * * @param string $text String to truncate. * @param integer $length Length of returned string, including ellipsis. * @param string $ending Ending to be appended to the trimmed string. * @param boolean $exact If false, $text will not be cut mid-word * @param boolean $considerHtml If true, HTML tags would be handled correctly * @return string Trimmed string. */ function shortenHTML($text, $length = 100, $ending = '...', $exact = true, $considerHtml = false) { if ($considerHtml) { // if the plain text is shorter than the maximum length, return the whole text if (strlen(preg_replace('/<.*?>/', '', $text)) <= $length) { return $text; } // splits all html-tags to scanable lines preg_match_all('/(<.+?>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER); $total_length = strlen($ending); $open_tags = array(); $truncate = ''; foreach ($lines as $line_matchings) { // if there is any html-tag in this line, handle it and add it (uncounted) to the output if (!empty($line_matchings[1])) { // if it's an "empty element" with or without xhtml-conform closing slash (f.e.
) if (preg_match('/^<(\s*.+?\/\s*|\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\s.+?)?)>$/is', $line_matchings[1])) { // do nothing // if tag is a closing tag (f.e. ) } else if (preg_match('/^<\s*\/([^\s]+?)\s*>$/s', $line_matchings[1], $tag_matchings)) { // delete tag from $open_tags list $pos = array_search($tag_matchings[1], $open_tags); if ($pos !== false) { unset($open_tags[$pos]); } // if tag is an opening tag (f.e. ) } else if (preg_match('/^<\s*([^\s>!]+).*?>$/s', $line_matchings[1], $tag_matchings)) { // add tag to the beginning of $open_tags list array_unshift($open_tags, strtolower($tag_matchings[1])); } // add html-tag to $truncate'd text $truncate .= $line_matchings[1]; } // calculate the length of the plain text part of the line; handle entities as one character $content_length = strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $line_matchings[2])); if ($total_length+$content_length> $length) { // the number of characters which are left $left = $length - $total_length; $entities_length = 0; // search for html entities if (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $line_matchings[2], $entities, PREG_OFFSET_CAPTURE)) { // calculate the real length of all entities in the legal range foreach ($entities[0] as $entity) { if ($entity[1]+1-$entities_length <= $left) { $left--; $entities_length += strlen($entity[0]); } else { // no more characters left break; } } } $truncate .= substr($line_matchings[2], 0, $left+$entities_length); // maximum lenght is reached, so get off the loop break; } else { $truncate .= $line_matchings[2]; $total_length += $content_length; } // if the maximum length is reached, get off the loop if($total_length>= $length) { break; } } } else { if (strlen($text) <= $length) { return $text; } else { $truncate = substr($text, 0, $length - strlen($ending)); } } // if the words shouldn't be cut in the middle... if (!$exact) { // ...search the last occurance of a space... $spacepos = strrpos($truncate, ' '); if (isset($spacepos)) { // ...and cut the text in this position $truncate = substr($truncate, 0, $spacepos); } } // add the defined ending to the text $truncate .= $ending; if($considerHtml) { // close all unclosed html-tags foreach ($open_tags as $tag) { $truncate .= ''; } } return $truncate; } function striphtml($html) { $html = preg_replace('~<[^>]+>~s','',$html); return $html; } function stripnl($txt) { return preg_replace("(\r\n|\n|\r)", "", $txt); } function switch_language($language_code) { $expr = "/^\/[^\/]+\//"; return preg_replace($expr, "/".$language_code."/", $_SERVER["REQUEST_URI"]); } function is_email($txt) { $name = '[a-zA-Z0-9]((\.|\-|\_)?[a-zA-Z0-9])*'; $domain = '[a-zA-Z0-9]((\.|\-|\_)?[a-zA-Z0-9])*'; $tld = '[a-zA-Z]{2,8}'; $regEx = '/^('.$name.')@('.$domain.')\.('.$tld.')$/'; return preg_match($regEx, $txt); } // converts a UTF8-string into HTML entities // - $utf8: the UTF8-string to convert // - $encodeTags: booloean. TRUE will convert "<" to "<" // - return: returns the converted HTML-string function utf8htmlentities($utf8, $encodeTags=true) { if(is_numeric($utf8)) return $utf8; $result = ''; for ($i = 0; $i < strlen($utf8); $i++) { $char = $utf8[$i]; $ascii = ord($char); if ($ascii < 128) { // one-byte character $result .= ($encodeTags) ? htmlentities($char) : $char; } else if ($ascii < 192) { // non-utf8 character or not a start byte } else if ($ascii < 224) { // two-byte character $result .= htmlentities(substr($utf8, $i, 2), ENT_QUOTES, 'UTF-8'); $i++; } else if ($ascii < 240) { // three-byte character $ascii1 = ord($utf8[$i+1]); $ascii2 = ord($utf8[$i+2]); $unicode = (15 & $ascii) * 4096 + (63 & $ascii1) * 64 + (63 & $ascii2); $result .= "&#$unicode;"; $i += 2; } else if ($ascii < 248) { // four-byte character $ascii1 = ord($utf8[$i+1]); $ascii2 = ord($utf8[$i+2]); $ascii3 = ord($utf8[$i+3]); $unicode = (15 & $ascii) * 262144 + (63 & $ascii1) * 4096 + (63 & $ascii2) * 64 + (63 & $ascii3); $result .= "&#$unicode;"; $i += 3; } } return $result; } /** * Converts a string to a valid UNIX filename. * @param $string The filename to be converted * @return $string The filename converted */ function convertToFilename($string, $dot_is_valid=false) { $string = mb_strtolower($string); $rep = array( array(" ", "-"), array("ä", "ae"), array("ö", "oe"), array("ü", "ue"), array("Ä", "ae"), array("Ö", "oe"), array("Ü", "ue"), array("ß", "ss") ); foreach($rep as $r) { $string = str_replace ($r[0], $r[1], $string); } // Match any character that is not in our whitelist $pattern = "/[^0-9^a-z^_^\-".($dot_is_valid ? "^\." : "")."]/"; preg_match_all ($pattern, $string, $matches); // Loop through the matches with foreach foreach ($matches[0] as $value) { $string = str_replace($value, "", $string); } $string = str_replace("----", "-", $string); $string = str_replace("---", "-", $string); $string = str_replace("--", "-", $string); // remove - at the beginning and end $string = trim($string, "-"); return $string; } function mb_trim( $string, $chars = "", $chars_array = array() ) { for( $x=0; $xdecode($content); } } if ( !function_exists('json_encode') ){ function json_encode($content){ $json = new Services_JSON; return $json->encode($content); } } function youtubeId($url) { $pattern = '/^.+\?.*v=([^\&]+).*$/'; if (preg_match($pattern, $url, $match)) { return $match[1]; } return false; } function getExtension($file) { $parts = explode(".",$file); $extension = strtolower($parts[count($parts)-1]); return $extension; } // generiert in realtime ein thumbnail auf wunsch gekropt, mit fixer höhe oder fixer breite und gibt den filenamen zurück // wurde bereits ein thumbnail mit den selben parametern generiert gibt es nur den filenamen zurück function realtime_resize($filename, $width, $height, $crop=false) { try { $resized_image_path = UPLOADED_PICS_URL."realtime-resized-images/"; //zerlege $filename in dirname, basename, extension und filename $path_parts = pathinfo($filename); // erstellt das Verzeichnis realtime-resized-images für den Fall das es noch nicht existiert if (!is_dir(WEBROOT_PATH.$resized_image_path)) mkdir(WEBROOT_PATH.$resized_image_path, 0771); // wenn das übergebene File existiert if (file_exists ($filename)) { // neuer filename im Format alterfilname-65487465-640x480-cropped.jpg $newfilename = $resized_image_path.$path_parts['filename'].'-'.filesize($filename).'-'.$width.'x'.$height.($crop?"-cropped":"").".".$path_parts['extension']; // wenn das realtime resized image bereits existiert wird der filname zurückgegeben, sonst wird es neu gecropped und resized if (!file_exists (WEBROOT_PATH.$newfilename)) { $options = array('preserveAlpha' => true, 'preserveTransparency' => true, 'jpegQuality' => 90, 'resizeUp' => true); $thumb = PhpThumbFactory::create($filename, $options); if($width > 0 and $height > 0 and $crop==true) { $thumb->adaptiveResize($width, $height); } else { $thumb->resize($width,$height); } $thumb->save(WEBROOT_PATH.$newfilename); $dimensions = $thumb->getCurrentDimensions(); return array("filename"=>$newfilename, "width" => $dimensions['width'], "height" => $dimensions['height']); } else { $is = getimagesize(WEBROOT_PATH.$newfilename); return array("filename"=>$newfilename, "width" => $is[0], "height" => $is[1]); } } }catch(Exception $ex) { /* todo: display broken image - image */ } return array("filename" => CMS_URL."images/noimage.gif", "width" => $width, "height" => $height); } /* Funktion zu Anzeigen und resizen eines Images $filename - Dateiname mit Pfad $width - Breite des Bildes. Wenn -1 dann wird die Breite aus dem Seitenverhältnis errechnet $height - Höhe des Bildes. Wenn -1 dann wird die Höhe aus dem Seitenverhältnis errechnet $crop - Wenn True, wird das Bild auf die gewünschten Maße gecropt $alt="" $style="" $class="" - optionale Parameter $lightbox - wenn TRUE wird die Shadowbox verwendet */ function display_image ($filename, $width, $height, $crop=false, $alt="", $style="", $class="", $lightbox=false) { $img = realtime_resize($filename, $width, $height, $crop); if ($lightbox == false) { echo "".$alt.""; } else { echo "".$alt.""; } } function removeQueryString($uri) { $parts = explode('?', $uri); return $parts[0]; } $isMobile = NULL; function isMobileBrowser() { global $isMobile; if($isMobile != NULL) return $isMobile; $_SERVER['ALL_HTTP'] = isset($_SERVER['ALL_HTTP']) ? $_SERVER['ALL_HTTP'] : ''; $mobile_browser = '0'; if(preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone)/i', strtolower($_SERVER['HTTP_USER_AGENT']))) $mobile_browser++; if((isset($_SERVER['HTTP_ACCEPT'])) and (strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml') !== false)) $mobile_browser++; if(isset($_SERVER['HTTP_X_WAP_PROFILE'])) $mobile_browser++; if(isset($_SERVER['HTTP_PROFILE'])) $mobile_browser++; $mobile_ua = strtolower(substr($_SERVER['HTTP_USER_AGENT'],0,4)); $mobile_agents = array( 'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac', 'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno', 'ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-', 'maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-', 'newt','noki','oper','palm','pana','pant','phil','play','port','prox', 'qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar', 'sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-', 'tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp', 'wapr','webc','winw','winw','xda','xda-' ); if(in_array($mobile_ua, $mobile_agents)) $mobile_browser++; if(strpos(strtolower($_SERVER['ALL_HTTP']), 'operamini') !== false) $mobile_browser++; if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'ipad') !== false) $mobile_browser++; if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'windows') !== false) $mobile_browser=0; $isMobile = $mobile_browser>0; return $isMobile; } function array2csv($data, $header = array()) { $filepath = tempnam(sys_get_temp_dir(), 'csv'); if ( $fp = fopen($filepath, 'w') ) { $show_header = true; if ( empty($header) ) { $show_header = false; reset($data); $line = current($data); if ( !empty($line) ) { reset($line); $first = current($line); if ( substr($first, 0, 2) == 'ID' && !preg_match('/["\\s,]/', $first) ) { array_shift($data); array_shift($line); if ( empty($line) ) { fwrite($fp, "\"{$first}\"\r\n"); } else { fwrite($fp, "\"{$first}\","); fputcsv($fp, $line,";"); fseek($fp, -1, SEEK_CUR); fwrite($fp, "\r\n"); } } } } else { reset($header); $first = current($header); if ( substr($first, 0, 2) == 'ID' && !preg_match('/["\\s,]/', $first) ) { array_shift($header); if ( empty($header) ) { $show_header = false; fwrite($fp, "\"{$first}\"\r\n"); } else { fwrite($fp, "\"{$first}\","); } } } if ( $show_header ) { fputcsv($fp, $header,";"); fseek($fp, -1, SEEK_CUR); fwrite($fp, "\r\n"); } foreach ( $data as $line ) { fputcsv($fp, $line,";"); fseek($fp, -1, SEEK_CUR); fwrite($fp, "\r\n"); } fclose($fp); } else { return false; } $csvstring = file_get_contents($filepath); unlink($filepath); return $csvstring; } function fileNotFound() { global $twig; header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found"); header("Status: 404 Not Found"); XCMS_Error::setErrorInfo(404, "File not found!"); include WEBROOT_PATH.'error.php'; exit(); } // $length Must be a multiple of 2 !! So 14 will work, 15 won't, 16 will, 17 won't and so on function generatePW($length = 8) { $conso=array("b","c","d","f","g","h","j","k","l","m","n","p","r","s","t","v","w","x","y","z","B","C","D","F","G","H","J","K","L","M","N","P","R","S","T","V","W","X","Y","Z"); $vocal=array("a","e","i","o","u","A","E","I","O","U"); $password=""; srand ((double)microtime()*1000000); $max = $length/2; for($i=1; $i<=$max; $i++) { $password.=$conso[rand(0,count($conso)-1)]; $password.=$vocal[rand(0,count($vocal)-1)]; } return $password; }

Es ist ein Fehler aufgetreten

Bitte wenden Sie sich an ihren Systemadministrator.

Error code: 0
Error message: Call to undefined function mb_trim()
File: /var/www/vhosts/petz-zt.at/httpdocs/includes/classes/XCMS/Table/Standard.php
Line Number: 145

Exception Trace

#0 /var/www/vhosts/petz-zt.at/httpdocs/includes/classes/XCMS/Table/Standard.php(178): XCMS_Table_Standard->getSearchWhere('', Array)
#1 /var/www/vhosts/petz-zt.at/httpdocs/includes/classes/XCMS/Table/Standard.php(197): XCMS_Table_Standard->getAll('*', '', '', '', '')
#2 /var/www/vhosts/petz-zt.at/httpdocs/includes/classes/XCMS/PluginController.php(64): XCMS_Table_Standard->getAllAsArray()
#3 /var/www/vhosts/petz-zt.at/httpdocs/includes/classes/XCMS/PluginController.php(37): XCMS_PluginController::initPluginObjects(true)
#4 /var/www/vhosts/petz-zt.at/httpdocs/includes/php-includes.php(7): XCMS_PluginController::start(true)
#5 /var/www/vhosts/petz-zt.at/httpdocs/index.php(7): require_once('/var/www/vhosts...')
#6 {main}