/sm'; $rA[] = ''; $t = preg_replace_callback($sA, 'modPopupIMG', $t); //____link // sublink $sA = array(); $rA = array(); $sA[] = '/
/sm'; $rA[] = '
'; $sA[] = '/clearDIV/sm'; $rA[] = ''; $sA[] = '/popup\((.*?)\)/sm'; $rA[] = 'javascript:popupfile(\'http://'.$_SERVER['HTTP_HOST'].'/popupsite.php?lang='.$lang.'&did=$1\',\'600\',\'600\',\'1\')'; $sA[] = '//sm'; $rA[] = ''; $t = preg_replace($sA, $rA, $t); //___link $sA = array(); $rA = array(); $sA[] = '/site\((.*?)\)/sm'; $rA[] = ''; $t = preg_replace_callback($sA, 'siteLink', $t); return($t); } function siteLink ($t) { global $menu, $cleanURLs, $lang; $res = searchPID($menu,str_replace('pid','',$t[1])); if($cleanURLs){ return $lang.'/'.$res; } else { return 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?lang='.$lang.'&site='.$res; } } function searchPID($mA,$pid) { global $lang; foreach ($mA as $k => $v) { $found=false; $t=t_link(transLang($v['name'])); if($v['id']==trim($pid)){ $found=true; return $t; } if(!$found && sizeof($v['sub'])>0){ $tn = searchPID($v['sub'],$pid); if(strlen($tn)>0){ if($v['function']!='folder'){ return $t.'/'.$tn; } else { return $tn; } } } } if($found) {return $t;} else {return '';} } function modPopupIMG ($t) { global $cleanURLs, $actDid; $src = $t[2]; $desc = preg_replace(array('/(.*?)alt="(.*)"(.*?)/sU'), array('$2'), $t[3]); $fileA = explode('/',$t[2]); $pic = $fileA[sizeof($fileA)-1]; $pic = substr($pic,0,strrpos($pic,'.')).'_POP'.substr($pic,strrpos($pic,'.')); $fileA[sizeof($fileA)-1] = $pic; $file = implode('/',$fileA); if(is_file($file)){ $size=getimagesize($file); //return (''); return (''); } else { return (''); } } //_________________________________________________________________________________________________________ //____________________________________ function getBrowser(){ $browser = 'unknown'; if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla')!==false ) $browser = 'Mozilla'; if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Netscape')!==false ) $browser = 'Netscape'; if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox')!==false ) $browser = 'Firefox'; if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')!==false ) $browser = 'InternetExplorer'; if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Opera')!==false ) $browser = 'Opera'; return $browser; } //____________________________________ function getRemoteIP () { if (isset($_SERVER["HTTP_X_FORWARDED_FOR"]) && strlen($_SERVER["HTTP_X_FORWARDED_FOR"]) > 0) { $f = $_SERVER["HTTP_X_FORWARDED_FOR"]; $reserved = false; if (substr($f, 0, 3) == "10.") { $reserved = true; } if (substr($f, 0, 4) == "172." && substr($f, 4, 2) > 15 && substr($f, 4, 2) < 32) { $reserved = true; } if (substr($f, 0, 8) == "192.168.") { $reserved = true;} if (!$reserved) { $ip = $f; } } if (!isset($ip)) { $ip = $_SERVER["REMOTE_ADDR"]; } return $ip; } //____________________________________uploadsizes function let_to_num($v){ //This function transforms the php.ini notation for numbers (like '2M') to an integer (2*1024*1024 in this case) $l = substr($v, -1); $ret = substr($v, 0, -1); switch(strtoupper($l)){ case 'P':$ret *= 1024; case 'T':$ret *= 1024; case 'G':$ret *= 1024; case 'M':$ret *= 1024; case 'K':$ret *= 1024; break; } return $ret; } $postmax = let_to_num(ini_get('post_max_size')); $uploadmax = let_to_num(ini_get('upload_max_filesize')); $maxuploadsize = min($postmax,$uploadmax); if(isset($_SERVER['CONTENT_LENGTH'])){ $postlength = $_SERVER['CONTENT_LENGTH']; } else { $postlength = 0; } $setResult = ini_set("post_max_size","12M"); $setResult = ini_set("upload_max_filesize","11M"); $setResult = ini_set("max_input_time","120"); $setResult = ini_set("max_execution_time","120"); $setResult = ini_set("memory_limit","32M"); // Browsersprache ermitteln function lang_getfrombrowser ($allowed_languages, $default_language, $lang_variable = null, $strict_mode = true) { if ($lang_variable === null) { $lang_variable = $_SERVER['HTTP_ACCEPT_LANGUAGE']; } if (empty($lang_variable)) { return $default_language; } $accepted_languages = preg_split('/,\s*/', $lang_variable); $current_lang = $default_language; $current_q = 0; foreach ($accepted_languages as $accepted_language) { $res = preg_match ('/^([a-z]{1,8}(?:-[a-z]{1,8})*)'. '(?:;\s*q=(0(?:\.[0-9]{1,3})?|1(?:\.0{1,3})?))?$/i', $accepted_language, $matches); if (!$res) { continue; } $lang_code = explode ('-', $matches[1]); if (isset($matches[2])) { $lang_quality = (float)$matches[2]; } else { $lang_quality = 1.0; } while (count ($lang_code)) { if (in_array (strtolower (join ('-', $lang_code)), $allowed_languages)) { if ($lang_quality > $current_q) { $current_lang = strtolower (join ('-', $lang_code)); $current_q = $lang_quality; break; } } if ($strict_mode) { break; } array_pop ($lang_code); } } return $current_lang; } /*_______________________checkLogin FrontEnd_*/ function getFeUserLogin(){ global $area, $feUserGroups, $feUserLogins, $lang, $admin, $guest, $feuser, $feuserData; if (isset($_SESSION['fepass'])&&strlen($_SESSION['fepass'])>0){ foreach($feUserLogins as $k => $v){ if($_SESSION['feuser']==$v['user'] && $_SESSION['fepass']==$v['pass']){ $feuser = $k; $feuserData = $v; $feuserData['freePid'] = array(); foreach($v['userGroups'] as $ug){ $feuserData['freePid'] = array_unique(array_merge($feuserData['freePid'],$feUserGroups[$ug]['freePid'])); } break; } } } } ?> array( 'id' => '1', 'name' => array( 'de' => 'Grafik', 'en' => '' ), 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ), '1' => array( 'id' => '2', 'name' => array( 'de' => 'Illustration', 'en' => '' ), 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ) ); $objList = array('0' => array( 'id' => '1', 'cat' => array( '0' => '1' ), 'name' => array( 'de' => 'Testeintrag', 'en' => '' ), 'visible' => array( 'de' => '1', 'en' => '1' ), 'type' => array( ) ), '1' => array( 'id' => '2', 'name' => array( 'de' => 'Testeintrag 02', 'en' => '' ), 'visible' => array( 'de' => '1', 'en' => '1' ), 'cat' => array( '0' => '2' ) ) ); ?> array( 'id' => '1', 'name' => array( 'de' => 'Lexikon01', 'en' => '' ), 'descMain' => array( 'de' => '

Beschreibung

', 'en' => '' ) ), '1' => array( 'id' => '2', 'name' => array( 'de' => 'Lexikon02', 'en' => '' ), 'descMain' => array( 'de' => '

Beschreibung

', 'en' => '' ) ) ); ?>0) $menuList .= '
  • |
  • ';*/ $c++; if ($href == $act) { $actID = 'pid'.$mA[$n]['id']; $actLev = $lev; if(isset($mA[$n]['menuPos']) && $menuLev==0){ $actMenuPos = $mA[$n]['menuPos']; } if($lev==sizeof($pidA)-1 && $mA[$n]['function']!='blank') $actFunction = $mA[$n]['function']; //if($found){ $actTitle[] = $name; $actSite = $cleanURLpath; //} if($mA[$n]['function']!='hideMenu' && $mA[$n]['function']!='blank' && $mA[$n]['function']!='folder'){ $menuList .= '
  • '.$name.''; if($lev>0) $secMenu .= '
  • '.$name.''; } if($mA[$n]['function']=='blank'){ $menuList .= '
  • '.$name.''; $menuListKompl[$actMenuPos] .= '
  • '.$name.''; $secMenu .= '
  • '.$name.''; } else if($mA[$n]['function']!='hideMenu'){ $menuListKompl[$actMenuPos] .= '
  • '.$name.''; } $linkline.=' | '.$name.''; if($mA[$n]['sub'] && sizeof($mA[$n]['sub'])>0){ if( $mA[$n]['function']!='folder'){ $lev++; $menuListKompl[$actMenuPos] .= '
      '; $menuList .= '
        '; } $menuLev++; $actSub = $mA[$n]['sub']; newM($mA[$n]['sub'],$p,true); if( $mA[$n]['function']!='folder'){ $menuListKompl[$actMenuPos] .= '
      '; $menuList .= '
    '; $lev--; } $menuLev--; } else { $actSub = array(); } if($mA[$n]['function']!='hideMenu' && $mA[$n]['function']!='folder') { $menuListKompl[$actMenuPos] .= '
  • '; $menuList .= ''; } } else { if(isset($mA[$n]['menuPos']) && $menuLev==0){ $actMenuPos = $mA[$n]['menuPos']; } $act=''; $tmpfound = false; if($found){ if(($actFunction=='firstsite' && $mA[$n]['function']=='blank' && $c==1)){ $c--; } if(($actFunction=='firstsite' && $c==1)){ $act='act'; $actID = 'pid'.$mA[$n]['id']; $actTitle[] = $name; $actSite = $cleanURLpath; $actSub = $mA[$n]['sub']; $tmpfound = true; $actFunction=$mA[$n]['function']; } if($mA[$n]['function']!='hideMenu' && $mA[$n]['function']!='blank' && $mA[$n]['function']!='folder'){ $menuList .= '
  • '.$name.''; if($lev>0) $secMenu .= '
  • '.$name.''; } if($mA[$n]['function']=='blank'){ if($act=="act") { $menuList .= '
  • '; } else { $menuList .= '
  • '; } $menuList .= ''.$name.''; } } /*if($mA[$n]['function']!='hideMenu' && $mA[$n]['function']!='blank'){ if($act=="act") { $menuList .= '
  • '; } else { $menuList .= '
  • '; } $menuList .= ''.$name.''; }*/ if($mA[$n]['function']!='hideMenu' && $mA[$n]['function']!='folder'){ $menuListKompl[$actMenuPos] .= '
  • '.$name.''; } else if($mA[$n]['function']=='blank'){ $menuListKompl[$actMenuPos] .= '
  • '.$name.''; } if($mA[$n]['sub'] && sizeof($mA[$n]['sub'])>0){ if($mA[$n]['function']!='folder'){ $lev++; $menuListKompl[$actMenuPos] .= '
      '; $menuList .= '
        '; } $menuLev++; newM($mA[$n]['sub'],$p,$tmpfound); if($mA[$n]['function']!='folder'){ $menuListKompl[$actMenuPos] .= '
      '; $menuList .= '
    '; $lev--; } $menuLev--; } if($mA[$n]['function']!='hideMenu' && $mA[$n]['function']!='folder'){ $menuListKompl[$actMenuPos] .= '
  • '; if($found) $menuList .= ''; if($found) $secMenu .= ''; } } } if($mA[$n]['function']!='folder' && $mA[$n]['function']!='objectsite'){ $lInd = strrpos($p,'/'); $p=substr($p,0,$lInd); $lInd = strrpos($cleanURLpath,'/'); $cleanURLpath=substr($cleanURLpath,0,$lInd); } } } //_____________________________________________________________objects function genObjectListByCat($catID){ global $catList, $objList, $lang; $result = array(); $allCatA = searchSubCats($catID,$catList,false); foreach($objList as $v){ if(isset($v['visible'][$lang]) && $v['visible'][$lang]){ foreach($allCatA as $posID){ if(in_array($posID,$v['cat'])){ $result[$v['id']] = $v; } } } } return $result; } function searchSubCats($catID,$mA,$found){ global $lang; $result = array(); foreach($mA as $k => $v){ if(isset($v['visible'][$lang]) && $v['visible'][$lang]){ if($v['id']==$catID || $found){ $tmpresult = searchSubCats($catID,$v['sub'],true); if(sizeof($tmpresult)>0) array_splice($result,0,0,$tmpresult); $result[] = $v['id']; } else { $tmpresult = searchSubCats($catID,$v['sub'],false); if(sizeof($tmpresult)>0) array_splice($result,0,0,$tmpresult); } } } return $result; } function modifyMenu(&$mA) { global $lang; for ($n=0; $n $obj['name'], 'id' => $obj['id'], 'function' => 'objectsite', 'visible' => $obj['visible'], 'sub' => array() ); } } else { modifyMenu($mA[$n]['sub']); } } } } function getObjectLink($objID, $mA, $p, $objPath) { global $lang, $transLangs, $cleanURLs, $guest, $admin; $result = ''; for ($n=0; $n0){ $result = getObjectLink($objID, $mA[$n]['sub'],$p,$objPath); if(strlen($result)>0) {return $result;} } } } if($mA[$n]['function']!='folder' && $mA[$n]['function']!='objectsite'){ $lInd = strrpos($p,'/'); $p=substr($p,0,$lInd); $lInd = strrpos($objPath,'/'); $objPath=substr($objPath,0,$lInd); } } } ?> array( 'name' => array( 'de' => 'Hauptmenü' ), 'id' => '31', 'function' => 'folder', 'menuPos' => 'main', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( '0' => array( 'name' => array( 'de' => 'Über uns' ), 'id' => '7', 'function' => 'firstsite', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( '0' => array( 'name' => array( 'de' => 'Arbeitsweise' ), 'id' => '13', 'function' => 'standard', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ), '1' => array( 'name' => array( 'de' => 'Team' ), 'id' => '14', 'function' => 'standard', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ), '2' => array( 'name' => array( 'de' => 'Pferde' ), 'id' => '15', 'function' => 'standard', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( '0' => array( 'name' => array( 'de' => 'Steckbrief Silo' ), 'id' => '16', 'function' => 'standard', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ), '1' => array( 'name' => array( 'de' => 'Steckbrief Kröte' ), 'id' => '17', 'function' => 'standard', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ), '2' => array( 'name' => array( 'de' => 'Steckbrief Canyon' ), 'id' => '18', 'function' => 'standard', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ), '3' => array( 'name' => array( 'de' => 'Steckbrief Louisa' ), 'id' => '19', 'function' => 'standard', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ) ) ) ) ), '1' => array( 'name' => array( 'de' => 'Reiten lernen' ), 'id' => '8', 'function' => 'firstsite', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( '0' => array( 'name' => array( 'de' => 'Reitunterricht' ), 'id' => '20', 'function' => 'standard', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ), '1' => array( 'name' => array( 'de' => 'Polo-Reiten' ), 'id' => '21', 'function' => 'standard', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ) ) ), '2' => array( 'name' => array( 'de' => 'Therapeutisches Reiten' ), 'id' => '9', 'function' => 'standard', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ), '3' => array( 'name' => array( 'de' => 'Burnout' ), 'id' => '10', 'function' => 'standard', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ), '4' => array( 'name' => array( 'de' => 'Coaching' ), 'id' => '11', 'function' => 'firstsite', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( '0' => array( 'name' => array( 'de' => 'Persönlchkeitsentwicklung' ), 'id' => '22', 'function' => 'standard', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ), '1' => array( 'name' => array( 'de' => 'Beratung Pferdehaltung' ), 'id' => '23', 'function' => 'standard', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ) ) ), '5' => array( 'name' => array( 'de' => 'Referenzen' ), 'id' => '12', 'function' => 'standard', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ), '6' => array( 'name' => array( 'de' => 'Kontakt' ), 'id' => '26', 'function' => 'firstsite', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( '0' => array( 'name' => array( 'de' => 'Anschrift' ), 'id' => '28', 'function' => 'standard', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ), '1' => array( 'name' => array( 'de' => 'Mailformular', 'en' => 'Mailform' ), 'id' => '3', 'function' => 'standard', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ), '2' => array( 'name' => array( 'de' => 'Preise' ), 'id' => '27', 'function' => 'hidden', 'visible' => array( 'de' => '0' ), 'sub' => array( ) ), '3' => array( 'name' => array( 'de' => 'Impressum' ), 'id' => '29', 'function' => 'standard', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ) ) ) ) ), '1' => array( 'name' => array( 'de' => 'Aktuelles' ), 'id' => '24', 'function' => 'hideMenu', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ), '2' => array( 'name' => array( 'de' => 'Archiv' ), 'id' => '25', 'function' => 'hideMenu', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ), '3' => array( 'name' => array( 'de' => 'Footermenü' ), 'id' => '30', 'function' => 'folder', 'menuPos' => 'footer', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( '0' => array( 'name' => array( 'de' => 'Sitemap' ), 'id' => '4', 'function' => 'hidden', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ), '1' => array( 'name' => array( 'de' => 'Suche', 'en' => 'Search' ), 'id' => '6', 'function' => 'hideMenu', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ), 'menuPos' => 'main' ), '2' => array( 'name' => array( 'de' => 'Error404', 'en' => 'Error404' ), 'id' => '0', 'function' => 'hidden', 'visible' => array( 'de' => '1', 'en' => '1' ), 'sub' => array( ) ) ) ) ); ?> array( 'freePid' => array( '0' => 'pid20' ), 'name' => 'Partner', 'desc' => 'interne Partner' ) ); $feUserLogins = array('fuid0' => array( 'user' => 'tester', 'name' => 'Hagemeister', 'vorname' => 'Klaus', 'mail' => '', 'phone' => '', 'company' => '', 'adress' => '', 'location' => '', 'state' => '', 'userGroups' => array( '0' => 'ugid0' ), 'pass' => '6dc13510ac2bcf8ac6c2226b2e16e51e', 'valid' => '20430101' ) );