decode($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 "
";
} else {
echo "
";
}
}
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}