Warning: image_info() => first argument must be a file.

'; return false; } // Defines the keys we want instead of 0, 1, 2, 3, 'bits', 'channels', and 'mime'. $redefine_keys = array( 'width', 'height', 'type', 'attr', 'bits', 'channels', 'mime', ); // If $out is supplied, but is not a valid key, nullify it. if (!is_null($out) && !in_array($out, $redefine_keys)) $out = null; // Assign usefull values for the third index. $types = array( 1 => 'GIF', 2 => 'JPG', 3 => 'PNG', 4 => 'SWF', 5 => 'PSD', 6 => 'BMP', 7 => 'TIFF(intel byte order)', 8 => 'TIFF(motorola byte order)', 9 => 'JPC', 10 => 'JP2', 11 => 'JPX', 12 => 'JB2', 13 => 'SWC', 14 => 'IFF', 15 => 'WBMP', 16 => 'XBM' ); $temp = array(); $data = array(); // Get the image info using getimagesize(). // If $temp fails to populate, warn the user and return false. if (!$temp = getimagesize($file)) { echo '

Warning: image_info() => first argument must be an image.

'; return false; } } function getCollections( $pfad , &$files){ $files[] = Array( "COLLECTION", $pfad ); $exist = XML_DB_eXist::getInstance('soap'); $exist->setWSDL('http://localhost:8080/exist/services/Query?wsdl'); $exist->connect('admin', ''); $collections = $exist->getCollections( $pfad ); if(is_array($collections->resources->elements)) for($k=0;$kresources->elements);$k++) $files[]= Array( "FILE", $pfad."/".$collections->resources->elements[$k]); else if($collections->resources->elements != null && strlen($collections->resources->elements) > 0) $files[]= Array( "FILE", $pfad."/".$collections->resources->elements ); if(is_array($collections->collections->elements)) for($k=0;$kcollections->elements);$k++) getCollections( $pfad."/".$collections->collections->elements[$k], $files); else if($collections->collections->elements != null && strlen($collections->collections->elements )> 0 ) getCollections( $pfad."/".$collections->collections->elements, $files); } function comphp( $function, $array= null ){ $root = NULL; $url = NULL; if( isset( $array ) && is_array( $array ) ) { foreach( $array as $name => $value ) { eval ("\$$name = \$value;"); } } $code = loadfile( $function); $pos = strripos($code, "?>"); $code = substr( $code, 0, $pos-1) ; $pos = stripos($code, "", "", $code ); return eval( $code ); } function KeyName($myArray,$pos) { // $pos--; /* uncomment the above line if you */ /* prefer position to start from 1 */ if ( ($pos < 0) || ( $pos >= count($myArray) ) ) return "NULL"; // set this any way you like reset($myArray); for($i = 0;$i < $pos; $i++) next($myArray); return key($myArray); } function get_iso_8601_date($int_date) { //$int_date: current date in UNIX timestamp $date_mod = date('Y-m-d\TH:i:s', $int_date); $pre_timezone = date('O', $int_date); $time_zone = substr($pre_timezone, 0, 3).":".substr($pre_timezone, 3, 2); $date_mod .= $time_zone; return $date_mod; } function get_subdirectories($dir) { $dirs = Array(); if (is_dir($dir)){ $dir_contents = scandir($dir); foreach ($dir_contents as $item) { if (is_dir($dir."/".$item) && $item != '.' && $item != '..') { $dirs[]= $dir."/".$item ; } } } return $dirs; } function remove_directory($dir) { if (is_dir($dir)){ $dir_contents = scandir($dir); foreach ($dir_contents as $item) { if (is_dir($dir."/".$item) && $item != '.' && $item != '..') { remove_directory($dir."/".$item.'/'); }elseif (file_exists($dir."/".$item) && $item != '.' && $item != '..') { unlink($dir."/".$item); } } rmdir($dir); } } function dir_exists($dir_name = false, $path = './') { if(!$dir_name) return false; if(is_dir($path.$dir_name)) return true; $tree = glob($path.'*', GLOB_ONLYDIR); if($tree && count($tree)>0) { foreach($tree as $dir) if(dir_exists($dir_name, $dir.'/')) return true; } return false; } //creates directory tree recursively function makeDirs($strPath, $mode = 0777) { return is_dir($strPath) or ( makeDirs(dirname($strPath), $mode) and mkdir($strPath, $mode) ); } function iso_8601totime($tstamp) { // converts ISODATE to unix date // 1984-09-01T14:21:31Z sscanf($tstamp,"%u-%u-%uT%u:%u:%uZ",$year,$month,$day, $hour,$min,$sec); $newtstamp=mktime($hour,$min,$sec,$month,$day,$year); return $newtstamp; } function date8601_dif( $date8601 ){ //calculate the difference between two dates in days. $regDate=iso_8601totime( $date8601 );; //will come from DB $curDate=mktime(); //current UNIX timestamp. $diff= $curDate - $regDate; //date diff in seconds //$diff = $diff / 86400; //date diff in days return $diff; //will be used to check member subscription } function cutString3( $str, $len ){ $str = trim( strip_tags( $str )); if( strlen($str) > $len ){ $cutter = substr( $str, 0, ($len-4) ); $pos = strrpos ( $cutter, " " ); if($pos) $cutter = substr( $str, 0, $pos ); return $cutter." ..."; } else return $str; } function filemtime_r($path) { global $allowedExtensions; if (!file_exists($path)) return 0; $extension = end(explode(".", $path)); if (is_file($path) && in_array($extension, $allowedExtensions)) return filemtime($path); $ret = 0; foreach (glob($path."/*") as $fn) { if (filemtime_r($fn) > $ret) $ret = filemtime_r($fn); // This will return a timestamp, you will have to use date(). } return $ret; } function get_links( $pos, $length, $max, $link, $indexlength){ $pos = intval(( $pos / $length ))+1; $buffer =""; $posa = 1; $liste = ""; //$indexlength = $indexlength -1; for($i=1;$i< ($max/$length)+1 ;$i++ ){ $mark =""; if($i == $pos) $mark = "class=\"marked\""; if( (($max/$length)+1) > $indexlength ){ if(!( $i<($pos-$indexlength) || $i > ($pos+$indexlength) )) $liste .="
  • ".($posa+$i-1)."
  • "; } else $liste .="
  • ".($posa+$i-1)."
  • "; } $buffer .= ""; return $buffer; } if (PHP_VERSION >= 5) { // Emulate the old xslt library functions function xslt_create() { $xsl = new XsltProcessor(); $xsl->registerPHPFunctions(); return $xsl; } function xslt_process($xsltproc, $xml_arg, $xsl_arg, $xslcontainer = null, $args = null, $params = null) { // Start with preparing the arguments $xml_arg = str_replace('arg:', '', $xml_arg); $xsl_arg = str_replace('arg:', '', $xsl_arg); // Create instances of the DomDocument class $xml = new DomDocument; $xsl = new DomDocument; // Load the xml document and the xsl template $xml->loadXML($args[$xml_arg]); $xsl->loadXML($args[$xsl_arg]); // Load the xsl template $xsltproc->importStyleSheet($xsl); // Set parameters when defined if ($params) { foreach ($params as $param => $value) { $xsltproc->setParameter("", $param, $value); } } // Start the transformation $processed = $xsltproc->transformToXML($xml); // Put the result in a file when specified if ($xslcontainer) { return @file_put_contents($xslcontainer, $processed); } else { return $processed; } } function xslt_free($xsltproc) { unset($xsltproc); } } function _strtr( $data, $arr ){ foreach($arr as $key=>$value)$data= str_replace($key,$value,$data); return $data; } function echoBrowser($string, $bufferSize = 8192) { $splitString = str_split($string, $bufferSize); foreach($splitString as $chunk) echo $chunk; } function includeFile( $bufferS ) { if (preg_match_all("/{syf:include:(.*?)}/", $bufferS, $matchesA)) { $matchesA = array_unique($matchesA[1]); foreach ($matchesA as $value) { $needleS = '{syf:include:'.$value.'}'; $bufferS = str_replace($needleS,file_get_contents('var/www/'.$value),$bufferS); } $matchesA = array(); } if (preg_match_all("/{syf:incCredits:(.*?)}/", $bufferS, $matchesA)) { $matchesA = array_unique($matchesA[1]); foreach ($matchesA as $value) { $needleS = '{syf:incCredits:'.$value.'}'; $creditsListS = file_get_contents('var/www/'.$value); $creditsListS = str_replace('class="sliderImage"','',$creditsListS); $creditsListS = str_replace('alt="Landscape picture"','alt="Landscape picture" height="100"',$creditsListS); if ( strpos($creditsListS, '','',$creditsListS); $creditsListS = str_replace('
    ','alt="Location map" height="100" />
    ',$creditsListS); $creditsListS = '
    '.$creditsListS.'
    '; $bufferS = str_replace($needleS,$creditsListS,$bufferS); } $matchesA = array(); } if (preg_match_all("/{syf:incInfo:(.*?)}/", $bufferS, $matchesA)) { $matchesA = array_unique($matchesA[1]); foreach ($matchesA as $value) { $needleS = '{syf:incInfo:'.$value.'}'; $bufferS = str_replace_last( $needleS, file_get_contents('var/www/'.$value), $bufferS ); $bufferS = str_replace( $needleS, '', $bufferS ); } $matchesA = array(); } if (preg_match_all("/{syf:incPHP:(.*?)}/", $bufferS, $matchesA)) { $matchesA = array_unique($matchesA[1]); foreach ($matchesA as $value) { $needleS = '{syf:incPHP:'.$value.'}'; $bufferS = str_replace($needleS,'',$bufferS); } } $pos = strpos( $_SERVER['REQUEST_URI'], '?' ); if( $pos === FALSE ) { $requestUrlS = $_SERVER['REQUEST_URI']; } else { $requestUrlS = strstr( $_SERVER['REQUEST_URI'], '?' ); } $urlS = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; $fileNameS = 'var/img/qrcode/'.str_replace( array( '/', '.' ), array( '_ridir_', '_' ), ltrim( $GLOBALS['directory'], '/' ).'.png' ); if ( !file_exists( $fileNameS ) ) { $bufferS = str_replace( '{syf:incQR}', '', $bufferS); QRcode::png( $urlS, $fileNameS, 'M', 4 , 1 ); } else { $bufferS = str_replace( '{syf:incQR}', 'QR Code of the request', $bufferS); } return $bufferS; } function loadfile( $url, $lang = NULL ){ $buffer = false; if( file_exists( $url ) ){ $file = file( $url ); $buffer = implode( "", $file); } if( isset( $lang ) ) { $lang = langSwitch( $lang ); $buffer = str_replace( '[{lang}]', $lang, $buffer ); } return $buffer; } function flagshow($root, $lang, $buffer) { global $WEBBOXX; $lang = langSwitch( $lang ); if (preg_match_all("/(.*?)<\/span>/", $buffer, $aMatches)) { $aMatches = array_unique($aMatches[1]); foreach($aMatches as $key => $value) { if( isset( $value ) && strlen( $value )<3) { $buffer = str_replace( ''.$value.'','{language:'.$value.'}',$buffer ); } } } return $buffer; } function langSwitch( $lang ) { switch ($lang) { case 'ad': $lang = 'ca'; break; case 'al': $lang = 'sq'; break; case 'at': $lang = 'de'; break; case 'be': $lang = 'nl'; break; case 'ch': $lang = 'de'; break; case 'cy': $lang = 'gr'; break; case 'sm': $lang = 'it'; break; case 'uk': $lang = 'en'; break; } return $lang; } function str_replace_last( $search, $replace, $subject ) { if ( !$search || !$replace || !$subject ) { return false; } $index = strrpos( $subject, $search ); if ( $index === false ) { return $subject; } // Grab everything before occurence $pre = substr( $subject, 0, $index ); // Grab everything after occurence $post = substr( $subject, $index ); // Do the string replacement $post = str_replace( $search, $replace, $post ); // Recombine and return result return $pre . $post; } function translation($lang,$buffer) { global $WEBBOXX; $lang = langSwitch( $lang ); if (preg_match_all("/{language:(.*?)}/", $buffer, $aMatches)) { $aMatches = array_unique($aMatches[1]); $aMatches = array_flip($aMatches); $aTrans = $WEBBOXX['translation']; $aTrans = array_intersect_key($aTrans,$aMatches); reset($aTrans); foreach ($aTrans as $key => $value) { $aTransText = $value; $strTransAlt = '{language:'.$key.'}'; $strTransNeu = $aTransText[$lang]; if ($strTransNeu == "") { $strTransNeu = $aTransText['en'].' (engl.)'; } $buffer = str_replace($strTransAlt,$strTransNeu,$buffer); } unset($aTrans); } return $buffer; } function meta_initXML($buffer,$tdirectory,$filename,$filter) { global $WEBBOXX; global $GLOB_GROUPS; global $GLOB_CONFIG; if ($filter == "addxml") { $buffer = str_replace( '[{start_date}]',date("j.n.Y").'-'.date("H:i:s"), $buffer); $buffer = str_replace( '[{last_date}]',date("j.n.Y").'-'.date("H:i:s"), $buffer); $buffer = str_replace( '[{uidnumber}]',$GLOB_GROUPS[$_SESSION['GROUP']]['uidnumber'], $buffer); $buffer = str_replace( '[{home_id}]',$WEBBOXX['url'].'/'.$GLOB_CONFIG['trunk']['directory'].$tdirectory.'/pages/'.time().'.xml', $buffer); $buffer = str_replace( '[{atom_id}]',time().$GLOB_GROUPS[$_SESSION['GROUP']]['uidnumber'], $buffer); $tdirectory = $tdirectory.'/pages'; } if ($filter == "copyxml") { $buffer = str_replace( '[{start_date}]',date("j.n.Y").'-'.date("H:i:s"), $buffer); $buffer = str_replace( '[{last_date}]',date("j.n.Y").'-'.date("H:i:s"), $buffer); $buffer = str_replace( '[{uidnumber}]',$GLOB_GROUPS[$_SESSION['GROUP']]['uidnumber'], $buffer); $buffer = str_replace( '[{home_id}]',$WEBBOXX['url'].'/'.$GLOB_CONFIG['trunk']['directory'].$tdirectory.'/pages/'.time().'.xml', $buffer); $buffer = str_replace( '[{atom_id}]',time().$GLOB_GROUPS[$_SESSION['GROUP']]['uidnumber'], $buffer); } $handle = fopen( "meta/".str_replace("/","_ridir_",$GLOB_CONFIG['trunk']['directory'].$tdirectory.'/'.$filename.'.xml'), "w"); $template = loadfile("meta/template/page.template"); $template = str_replace( '[{date}]',date("j.n.Y").'-'.date("H:i:s"), $template); $template = str_replace( '[{timestamp}]',date("j.n.Y").'-'.date("H:i:s"), $template); $template = str_replace( '[{uidnumber}]',$GLOB_GROUPS[$_SESSION['GROUP']]['uidnumber'], $template); $template = str_replace( '[{action}]','add', $template); fwrite($handle,$template); fclose($handle); return $buffer; } function meta_writeXML($buffer,$directory,$filter) { global $GLOB_GROUPS; global $GLOB_CONFIG; if ($filter=="savexml") { $start = strpos( $buffer, ''); $end = strpos( $buffer, '')+13; $length = $end - $start; $tmp = substr($buffer,$start,$length); $buffer = str_replace( $tmp, '', $buffer ); $start = strpos( $buffer, ''); $end = strpos( $buffer, '')+13; $length = $end - $start; $tmp = substr($buffer,$start,$length); $buffer = str_replace( $tmp, '', $buffer ); } if (is_file("meta/".str_replace("/","_ridir_",$GLOB_CONFIG['trunk']['directory'].$directory))) { $aFile = file("meta/".str_replace("/","_ridir_",$GLOB_CONFIG['trunk']['directory'].$directory)); reset($aFile); foreach ($aFile as $key => $value) { $end = strpos( $value, ''); if($end >= 0) { $start = strpos( $value, ''); $length = $end - $start; $tmp = substr($value,$start,$length); $aFile[$key] = str_replace( $tmp, '', $value ); } } $j = count($aFile);$i = $j-1; array_pad($aFile,$j,0); $i = $j-1; $aFile[$j] = $aFile[$i]; $j = $i;$i = $j-1; $aFile[$j] = $aFile[$i]; $aFile[$i] = utf8_encode("\t\t").''.utf8_encode("\r\n"); $template = implode( "",$aFile); $handle = fopen( "meta/".str_replace("/","_ridir_",$GLOB_CONFIG['trunk']['directory'].$directory), "w"); fwrite($handle,$template); fclose($handle); } if (!is_file("meta/".str_replace("/","_ridir_",$GLOB_CONFIG['trunk']['directory'].$directory))) { $handle = fopen( "meta/".str_replace("/","_ridir_",$GLOB_CONFIG['trunk']['directory'].$directory), "w"); $template = loadfile("meta/template/page.template"); $template = str_replace( '[{date}]',date("j.n.Y").'-'.date("H:i:s"), $template); $template = str_replace( '[{timestamp}]',date("j.n.Y").'-'.date("H:i:s"), $template); $template = str_replace( '[{uidnumber}]',$GLOB_GROUPS[$_SESSION['GROUP']]['uidnumber'], $template); $template = str_replace( '[{action}]',$filter, $template); fwrite($handle,$template); fclose($handle); } return $buffer; } function metaBuilder($atype, $lang) { global $WEBBOXX; if (!is_array($atype)) { $atype = array($atype); } foreach ($atype as $key => $value) { $buffer = NULL; if($value == "{container:css}") { $buffer = ''; } if($value == "{container:favicon}") { $buffer = ''; } if($value == "{container:title}") { $buffer = $WEBBOXX[ "title" ]; } if($value == "{container:language}") { $buffer = $lang; } if($value == "{container:headline}") { $buffer = $WEBBOXX[ "headline" ]; } if($value == "{container:meta}") { $buffer = ''; } if($value == "{container:meta_dc}") { $aMeta_dc = $WEBBOXX[ "meta_dc" ]; if ($aMeta_dc[ "siteboxx_switch" ] != 'n') { $buffer = ' '; foreach ($aMeta_dc as $key => $value) { if (!empty($value)) { if ($value!='y') {$buffer = $buffer.' '; } } } } else { if (!empty($aMeta_dc[ "title" ])) {$buffer = $buffer.' '; } if (!empty($aMeta_dc[ "creator" ])) {$buffer = $buffer.' '; } if (!empty($aMeta_dc[ "publisher" ])) {$buffer = $buffer.' '; } if (!empty($aMeta_dc[ "rights" ])) {$buffer = $buffer.' '; } } } if($value == "{container:relations}") { $aRel = $WEBBOXX[ "rel" ]; if ($aRel[ "siteboxx_switch" ] != 'n') { foreach ($aRel as $key => $value) { if (!empty($value[ "href" ])) { if ($value!='y') {$buffer = $buffer.' '; } } } } } if($value == "{container:generator}") { $buffer = ''; } } return $buffer; } class xslt{ function xslt(){ } function transform($xml, $xslt){ $r = $this->_transform($xml, $xslt); return $r; } function _transform($xml, $xslt){ return false; } } class xslt_php extends xslt{ function _transform($xml, $xslt){ $buffer = ""; $arguments = array( '/_xml' => $xml, '/_xsl' => $xslt ); $xsltproc = xslt_create(); $buffer = xslt_process( $xsltproc, 'arg:/_xml', 'arg:/_xsl', null, $arguments ); xslt_free($xsltproc); return $buffer; } } /*****************************************************************************************/ function globGetAuth($name, $pass){ global $WEBBOXX; global $GLOB_GROUPS; $return = Array(); if($WEBBOXX[ "usermanagement" ] == "ldap") { $ldap = new userdb(null, $WEBBOXX[ "ldap_ip" ],$WEBBOXX[ "ldap_dn" ] , $WEBBOXX[ "ldap_port" ] ); $uid = $ldap->isUser($name, $pass); if( isset( $uid ) ){ $return['GROUP'] = $uid; $return['CACHE'] = null; } } else { foreach( $GLOB_GROUPS as $name => $value ){ if( $value['login']==$_POST["user"] && $value['pass']==$_POST["pass"] ){ $return['GROUP'] = $name; $return['CACHE'] = serialize($GLOB_GROUPS); } } } return $return; } function globGetGroups( $auth = Array() ){ global $WEBBOXX; $auth['GROUPS'] = Array(); if($WEBBOXX[ "usermanagement" ] == "ldap") { $ldap = new userdb(null, $WEBBOXX[ "ldap_ip" ],$WEBBOXX[ "ldap_dn" ] , $WEBBOXX[ "ldap_port" ] ); $tmp = array_merge( $ldap->groupsByMemberUid($WEBBOXX[ "ldap_account" ],$auth['GROUP']), $ldap->groupsByMemberUid('global',$auth['GROUP'])); $auth['GROUPS'][$auth['GROUP']] = Array( 'title' => $ldap->attributeByUid( "initials", $auth['GROUP'] ).' '.$ldap->attributeByUid( "givenname",$auth['GROUP'] ).' '.$ldap->attributeByUid( "sn", $auth['GROUP']), 'super' => Array(), 'directories' => Array(), 'files' => Array() ); $buf = ''; $right = Array();; for($i=0;$i=0;$k--){ $x = explode ( "=",$p[$k] ); if($x[0] == 'ou'){ $buf .= '/'.$x[1].''; } if($x[0] == 'cn'){ $right[$x[1]] = true; } } $x = explode ( "=",$p[sizeof($p)-1]); if(strlen($buf)>0 ) $auth['GROUPS'][$auth['GROUP']][$x[1]][$buf] = $right; else { if(strlen($x[1])>0) $auth['GROUPS'][$auth['GROUP']][$x[1]] = $right; } } } else if($WEBBOXX[ "usermanagement" ] == "relay") { $auth['GROUPS'] = unserialize($auth["cache"] ); } else $auth['GROUPS'] = unserialize($auth["cache"] ); return $auth; } function globChkRight( $auth = Array(), $uri = '', $right='' ){ $return = false; $tdirectory = "";$directory_true = ''; $expl = explode("?",$uri);$expl = explode("/",$expl[0]); for($k=3; $k $value ) if($name ==$right) $return = true; if(!$return){ if(is_array($auth['GROUPS'][$auth['GROUP'] ]['directories'])) if(is_array($auth['GROUPS'][$auth['GROUP'] ]['directories'][$tdirectory])) foreach($auth['GROUPS'][$auth['GROUP'] ]['directories'][$tdirectory] as $name => $value ) if($name ==$right) $return = true; } if(!$return){ if(is_array($auth['GROUPS'][$auth['GROUP'] ]['files'])) if(is_array($auth['GROUPS'][$auth['GROUP'] ]['files'][$directory_true])) foreach( $auth['GROUPS'][$auth['GROUP'] ]['files'][$directory_true] as $name => $value ) if($name ==$right) $return = true; } return $return; } ?>