array('deutsch','deutsch'), 'en'=>array('englisch','English'), //'fr'=>array('französisch','français'), ); function __construct($langx="") { global $conf; global $conn_id2; //if((($conf["site"]=="bahnbilder.de") && $langx!="de") || (($conf["site"]=="rail-pictures.com") && $langx!="en")) { /* $temp=$conf["cache"]->get("language ".$conf["site"],"file"); if (false&&$temp) { $this->temp=unserialize($temp); } else { */ if(!strstr($conf["site"],"bahnbilder.de")&&!strstr($conf["site"],"rail-pictures.com")) return; if($langx=="de") return; $result=$conf["cache"]->mysql_query("select md,value,language from ".$this->db."lang where domain='".$conf["site"]."' and language='".$langx."' and count>0"); while($zeile=mysql_fetch_assoc($result)) { $this->temp[$zeile["md"]][$zeile["language"]]=utf8_decode_extra($zeile["value"]); } /* $conf["cache"]->insert("language ".$conf["site"],serialize($this->temp),3600,"file"); } */ //} //if($_SERVER["REMOTE_ADDR"]=="79.228.23.207") echo "xxx"; list($this->active)=mysql_fetch_row($conf["cache"]->mysql_query("select count(*) from ".$this->db."lang where domain='".$conf["site"]."'")); /* $conf["path_bahnbilder"]="/srv/www/vhosts/bahnbilder.de/httpdocs/bahnbilder.de"; require_once($conf["path_bahnbilder"]."/inc/class.googletranslate.php"); $this->google=new Google_Translate_API; */ } function text($site,$val,$subst=array(),$lang="") { global $conf; global $user; if ($lang=="") $lang=$this->lang; if(strlen($lang)>10) die();//mail("thomas@bahnbilder.de","hack",print_r($_GET,1).print_r($_SERVER,1)); $forceTranslateLink=false; //if($user["id"]==104) $forceTranslateLink=true; $md=hexdec(substr(md5($val),0,12)); if(rand(0,10000)==5) $conf["cache"]->mysql_query("update bahnbilder.lang set count=count+1 where md='".$md."'"); if (!$this->active) return $this->substitute($site,$val,$subst,$md); if ($conf["site"]=="bahnbilder.de" && $lang==$conf['language']) { if (!$forceTranslateLink) return $this->substitute($site,$val,$subst,$md); } if (strpos($conf["site"],"startbilder.de")) return $this->substitute($site,$val,$subst,$md); //if (($conf['site']=='rail-pictures.com') && ($site=='kategoriewahl')) //if (!$forceTranslateLink&&$this->temp[$md][$lang]) return $this->substitute($site,$this->temp[$md][$lang],$subst,$md); if ($this->temp[$md][$lang]) return $this->substitute($site,$this->temp[$md][$lang],$subst,$md); $fromuser=false; $result=$conf["cache"]->mysql_query("select value from ".$this->db."lang where md='".$md."' AND site='".$site."' AND language='".$lang."' AND domain='".$conf["site"]."'"); if (mysql_num_rows($result)==0) { $result=$conf["cache"]->mysql_query("select value from ".$this->db."lang_user where md='".$md."' AND site='".$site."' AND language='".$lang."' AND domain='".$conf["site"]."' order by votes desc limit 1"); //if($md==253288615434598) die("select value from ".$this->db."lang_user where md='".$md."' AND site='".$site."' AND language='".$lang."' AND domain='".$conf["site"]."' order by votes desc limit 1"); if (mysql_num_rows($result)) $fromuser=true; } else $forceTranslateLink=false; if (($conf["site"]=="rail-pictures.com")&&(mysql_num_rows($result)==0)) $result=$conf["cache"]->mysql_query("select value from ".$this->db."lang where md='".$md."' AND site='".$site."' AND language='".$lang."' AND domain='bahnbilder.de'"); if ($lang!="de" && mysql_num_rows($result)==0) { if(($conf["site"]=="bahnbilder.de") || ($conf["site"]=="rail-pictures.com")) { //$tr=$this->google->translate($val, 'de',$lang); $tr=false; if ($tr) { mysql_query("insert into ".$this->db."lang (site,md,value,language,domain,google) VALUES ('".$site."','".$md."','".$tr."','".$lang."','".$conf["site"]."','1')"); //echo mysql_error(); //if (mysql_error()) echo("insert into ".$this->db."lang (site,md,value,language,domain,google) VALUES ('".$site."','".$md."','".str_replace("'","\'",$tr)."','en','".$conf["site"]."','1')"); if (!mysql_error()) return $tr; } else { if ($user["id"]==104) mysql_query("insert into ".$this->db."lang (site,md,value,language,domain) VALUES ('".$site."','".$md."','".$val."','de','".$conf["site"]."')"); } } $result=$conf["cache"]->mysql_query("select value from ".$this->db."lang where md='".$md."' AND site='".$site."' AND language='de' AND domain='".$conf["site"]."'",1); if (mysql_num_rows($result)==0) { if (($conf["site"]=="bahnbilder.de")||($conf["site"]=="rail-pictures.com")) { mysql_query("insert into ".$this->db."lang (site,md,value,language,domain) VALUES ('".$site."','".$md."','".mysql_real_escape_string($val)."','de','".$conf["site"]."')"); } return $this->substitute($site,$val,$subst,$md).$this->viewTranslateLink($md,$conf["site"],$site); } else { $zeile=mysql_fetch_row($result); return $this->substitute($site,$zeile[0],$subst,$md).$this->viewTranslateLink($md,$conf["site"],$site); } } else if (mysql_num_rows($result)==0) { if ($conf["site"]=="bahnbilder.de") mysql_query("insert into ".$this->db."lang (site,md,value,language,domain) VALUES ('".$site."','".$md."','".$val."','de','".$conf["site"]."')"); if ($forceTranslateLink) return $this->substitute($site,$val,$subst,$md).$this->viewTranslateLink($md,$conf["site"],$site); else return $this->substitute($site,$val,$subst,$md); } else { $zeile=mysql_fetch_row($result); if ($forceTranslateLink) return $this->substitute($site,$zeile[0],$subst,$md).$this->viewTranslateLink($md,$conf["site"],$site); else return $this->substitute($site,$zeile[0],$subst,$md); } } function viewTranslateLink($md,$domain,$site) { global $user; if (!$user["id"]) return; if ($user["id"]!=104) return; return '*'; } function translateForm($md,$domain,$site) { global $conf; global $user; if (!$user["id"]) return loginform('/?name=translate&md='.$md.'&domain='.$domain.'&site='.$site); if ($_GET["vote"]) { mysql_query("delete from ".$this->db."lang_votes where md='".$md."' AND fotograf_id='".$user["id"]."'"); //die("delete from ".$this->db."lang_votes where md='".$md."' AND fotograf_id='".$user["id"]."'"); mysql_query("insert into ".$this->db."lang_votes (fotograf_id,md,lang_id) values ('".$user["id"]."','".$md."','".$_GET["vote"]."')"); } $result=$conf["cache"]->mysql_query("select * from ".$this->db."lang_votes where md='".$md."'"); while($zeile=mysql_fetch_assoc($result)) { $votes[$zeile["lang_id"]][]=$zeile["fotograf_id"]; } foreach($votes as $vid => $arr) { mysql_query("update ".$this->db."lang_user set votes=".count($arr)." where id='".$vid."'"); } if ($_POST["md"]) $this->submitForm(); $master=new master(); $donts=array('de'); $origin=array();$my=array();$all=array(); // Aus dem bisherigen Übersetzungstool $result=$conf["cache"]->mysql_query("select * from ".$this->db."lang where md='".$md."' AND domain='".$domain."' AND site='".$site."'"); while($zeile=mysql_fetch_assoc($result)) { $origin[$zeile["domain"]][$zeile["language"]]=$zeile; } // Eigene Übersetzungen $result=$conf["cache"]->mysql_query("select * from ".$this->db."lang_user where fotograf_id='".$user["id"]."' AND md='".$md."' AND domain='".$domain."' AND site='".$site."'"); while($zeile=mysql_fetch_assoc($result)) { $donts[]=$zeile["language"]; $zeile["form"]=$this->onlyForm($md,$domain,$site,$zeile["language"],$zeile["value"],$zeile["id"],array(true),$zeile["id"]); $my[$zeile["domain"]][$zeile["language"]]=$zeile; } // Alle Übersetzungen $result=$conf["cache"]->mysql_query("select * from ".$this->db."lang_user where md='".$md."' AND domain='".$domain."' AND site='".$site."' order by votes desc"); while($zeile=mysql_fetch_assoc($result)) { $zeile["fotograf"]=new fotograf($zeile["fotograf_id"]); if ($zeile["fotograf_id"]==$user["id"]) $zeile["form"]=$this->onlyForm($md,$domain,$site,$zeile["language"],$zeile["value"],array(true),$zeile["id"]); foreach ($votes[$zeile["id"]] as $vfotograf) if ($vfotograf==$user["id"]) $vactive=true; else $vactive=false; $zeile["vote"]=$this->onlyVote($md,$zeile["id"],$vactive); $all[$zeile["domain"]][$zeile["language"]][]=$zeile; } $design=array(); foreach($this->langs as $key => $value) { $design["origin"][$key]=$origin[$conf["site"]][$key]; $design["my"][$key]=$my[$conf["site"]][$key]; $design["all"][$key]=$all[$conf["site"]][$key]; } $design["langs"]=$this->langs; $design["newform"]=$this->onlyForm($md,$domain,$site,"","",$donts); return $master->templateIt($design,$conf["path_bahnbilder"]."/templates/translate.tpl.php"); } function submitForm() { global $user; if ($_POST["tid"]) { mysql_query("update ".$this->db."lang_user set value='".mysql_real_escape_string($_POST["v"])."' where fotograf_id='".$user["id"]."' AND language='".$_POST["l"]."' AND md='".$_POST["md"]."' AND domain='".$_POST["domain"]."' AND site='".$_POST["site"]."'"); if(mysql_error()) die(mysql_error()); } else { mysql_query("insert into ".$this->db."lang_user (language,md,domain,site,value,fotograf_id) values ('".$_POST["l"]."','".$_POST["md"]."','".$_POST["domain"]."','".$_POST["site"]."','".mysql_real_escape_string($_POST["v"])."','".$user["id"]."')"); if(mysql_error()) die(mysql_error()); } } function onlyVote($md,$id,$active=false) { $text=jquery(); if ($active) $checked='checked="checked"'; else $checked=''; return $text.' Beste Übersetzung'; } function onlyForm($md,$domain,$site,$l,$v,$donts=array(),$id=0) { $options=array(); foreach($this->langs as $key => $value) { if($l==$key) $selected=' selected="selected"'; else $selected=''; if ((($donts[0]===true)&&$selected)||(count($donts)&&(array_search($key,$donts)===false))) $options[]=''; } if(!count($options)) return; $out.='
'; $out.=''; $out.=''; $out.=''; if ($id) $out.=''; $out.=''; $out.=''; $out.=''; $out.='
'; return $out; } function substitute($site,$val,$subst,$md=false) { foreach ($subst as $marker => $value) { $val=str_replace($marker,$value,$val); } global $user;global $conf; if ($md && ($user['id']==104) && (!strstr($conf['site'],'startbilder'))) { //$val.='Übersetzen'; } return $val; } } ?> mysql_query("select 'a'"); if (strpos($conf["site"],"startbilder.de")) $result=$conf["cache"]->mysql_query("select id,hierarchie1,hierarchie2,hierarchie3 from ".$conf["cat_db"]."bilder_kategorien where startbilder='".$conf["startbilder_betreiber"]["id"]."' order by hierarchie1,hierarchie2,hierarchie3"); else $result=$conf["cache"]->mysql_query("select id,hierarchie1,hierarchie2,hierarchie3 from ".$conf["cat_db"]."bilder_kategorien order by hierarchie1,hierarchie2,hierarchie3"); $conf["cache"]->mysql_query("select 'b'"); while($zeile=mysql_fetch_assoc($result)) { if($zeile["hierarchie1"]&&$zeile["hierarchie2"]&&$zeile["hierarchie3"]) { $md1=md5($zeile["hierarchie1"]); $md2=md5($zeile["hierarchie2"]); $md3=md5($zeile["hierarchie3"]); $this->katcache[$md1][$md2][$md3]=$zeile; $this->katcacheh1[$md1]=array("id"=>$zeile["id"],"hierarchie1"=>$zeile["hierarchie1"]); $this->katcacheh2[$md1][$md2]=array("id"=>$zeile["id"],"hierarchie1"=>$zeile["hierarchie1"],"hierarchie2"=>$zeile["hierarchie2"]); } } $conf["cache"]->mysql_query("select 'c'"); $this->kats=$this->get_subcats(0); $conf["cache"]->mysql_query("select 'd'"); $this->readable_subcats($this->kats); $conf["cache"]->mysql_query("select 'e'"); $this->idzusatz=$idzusatz; } function remove_tabs($list) { $this->remove=$list; } function get_subcats($cat) { global $conf; global $user; // Hierarchie 1 /*if (strpos($conf["site"],"startbilder.de")) $resultkategorie=$conf["cache"]->mysql_query("select id,hierarchie1 from ".$conf["cat_db"]."bilder_kategorien where startbilder='".$conf["startbilder_betreiber"]["id"]."' AND hierarchie1!='' AND hierarchie3 !='' group by hierarchie1 order by hierarchie1"); else $resultkategorie=$conf["cache"]->mysql_query("select id,hierarchie1 from ".$conf["cat_db"]."bilder_kategorien where hierarchie3 !='' AND hierarchie1!='' group by hierarchie1 order by hierarchie1"); while($zeile=mysql_fetch_assoc($resultkategorie)) {*/ foreach ($this->katcacheh1 as $md1 => $zeile) { $temp=array("id"=>$zeile["id"],"name_eng"=>$zeile["hierarchie1"]); /* if (strpos($conf["site"],"startbilder.de")) $resultkategorie2=$conf["cache"]->mysql_query("select id,hierarchie2 from ".$conf["cat_db"]."bilder_kategorien where hierarchie1='".$zeile["hierarchie1"]."' and startbilder='".$conf["startbilder_betreiber"]["id"]."' AND hierarchie3 !='' group by hierarchie2 order by hierarchie2"); else $resultkategorie2=$conf["cache"]->mysql_query("select id,hierarchie2 from ".$conf["cat_db"]."bilder_kategorien where hierarchie1='".$zeile["hierarchie1"]."' and hierarchie3 !='' group by hierarchie2 order by hierarchie2"); while($zeile2=mysql_fetch_assoc($resultkategorie2)) { */ foreach($this->katcacheh2[$md1] as $md2 => $zeile2) { $tempp=array("id"=>$zeile2["id"],"name_eng"=>$zeile2["hierarchie2"]); // Hierarchie 3 /*if (strpos($conf["site"],"startbilder.de")) $resultkategorie3=$conf["cache"]->mysql_query("select id,hierarchie3 from ".$conf["cat_db"]."bilder_kategorien where hierarchie1='".$zeile["hierarchie1"]."' and hierarchie2='".$zeile2["hierarchie2"]."' and startbilder='".$conf["startbilder_betreiber"]["id"]."' AND hierarchie3 !='' group by hierarchie3 order by hierarchie3"); else $resultkategorie3=$conf["cache"]->mysql_query("select id,hierarchie3 from ".$conf["cat_db"]."bilder_kategorien where hierarchie1='".$zeile["hierarchie1"]."' and hierarchie2='".$zeile2["hierarchie2"]."' and hierarchie3 !='' group by hierarchie3 order by hierarchie3"); while($zeile3=mysql_fetch_assoc($resultkategorie3)) { */ foreach($this->katcache[$md1][$md2] as $zeile3) { $tempp["sub"][]=array("id"=>$zeile3["id"],"name_eng"=>$zeile3["hierarchie3"]); } $temp["sub"][]=$tempp; } $out[]=$temp; } return $out; } function readable_subcats($katarr,$tree=array(),$treer=array()) { foreach($katarr as $cat) { $this->readable[$cat["id"]]=array( "name"=>$cat["name_eng"], "tree"=>$tree, "tree_readable"=>$treer ); if (count($cat["sub"])) { $temp=$tree; $temp[]=$cat["id"]; $tempx=$treer; $tempx[]=$cat["name_eng"]; $this->readable_subcats($cat["sub"],$temp,$tempx); } } } function read_cat($id,$trenner=" > ") { $temp=array(); $temp=$this->readable[$id]["tree_readable"]; $temp[]=$this->readable[$id]["name"]; return implode($trenner,$temp); } /* function OLDjquery_catwahl($arr=false,$parent=0,$depth=0,$rand=false,$counter="") { global $user; if ($user['id']==104) return $this->jquery_catwahl104($arr,$parent,$depth,$rand,$counter); if (!$arr) $arr=$this->kats; if (!$rand) $rand=rand(0,1000000); global $conf; if ($counter) $counter="x".$counter; if ($parent!=0) $out.="\n
idzusatz.$depth."\" id=\"kw".$this->idzusatz.$parent."x".$depth."\">"; else { $out.='
'; $out.="
idzusatz."\" class=\"kategoriewahl\">
idzusatz."0\" id=\"kw".$this->idzusatz."0x0\">"; } $outx="";$outf=""; $a=0; $children=array(); foreach($arr as $kat) { if (count($kat["sub"])) { $outx.=$this->jquery_catwahl($kat["sub"],$kat["id"],$depth+1,$rand,$a); $lastcat=""; $ff=" >> "; $a++; $out=str_replace("LASTCAT_REPLACE","",$out); } else { $lastcat="lc"; $lastcat=""; $ff=""; $out=str_replace("LASTCAT_REPLACE","ulc ",$out); $children[]=array($kat["id"],utf8_encode($kat["name_eng"])); } $outf.="idzusatz.$kat["id"]."\">".$kat["name_eng"].""; } if (count($children)) $out.=json_encode(array("p"=>$parent,"c"=>$children)); elseif ($parent!=0) { $out.="
    idzusatz.$depth."\" id=\"dmc".$this->idzusatz.$parent."x".$depth."\">"; $out.=$outf; $out.="
"; } elseif($parent==0) { $out.="
    idzusatz.$depth."\" id=\"dmc".$this->idzusatz.$parent."x".$depth."\">"; $out.=$outf; $out.="
"; } $out.="
"; $out.=$outx; if ($parent==0) { global $user; $out.=''; } if ($parent==0) { $out.="
"; $out.='
    '; $lastcat=unserialize($_SESSION["lastcat"]); if (count($lastcat)) { for($i=0;$imysql_query("select id,hierarchie1,hierarchie2,hierarchie3 from ".$conf["cat_db"]."bilder_kategorien where id='".$lastcat[$i]."' AND startbilder='".$conf["startbilder_betreiber"]["id"]."'"); else $resultx=$conf["cache"]->mysql_query("select id,hierarchie1,hierarchie2,hierarchie3 from ".$conf["cat_db"]."bilder_kategorien where id='".$lastcat[$i]."'"); $zeilex=mysql_fetch_assoc($resultx); if ($zeilex["hierarchie3"]) $out.="
  • ".$zeilex["hierarchie1"]." / ".$zeilex["hierarchie2"]." / ".$zeilex["hierarchie3"]."
  • "; } } $out.='
'; $meinekategorien=new meine_kategoriewahl; global $bild_id; $out.=$meinekategorien->form($_GET['bild_id']?$_GET['bild_id']:$bild_id); $out.='
'; $out.='
'; $out.=''; $out.="idzusatz."\" value=\"\" />"; } return $out; } * */ function jquery_catwahl($arr=false,$parent=0,$depth=0,$rand=false,$counter="") { global $user; if (!$arr) $arr=$this->kats; if (!$rand) $rand=rand(0,1000000); global $conf; if ($counter) $counter="x".$counter; if ($parent!=0) $out.="\n
idzusatz.$depth."\" id=\"kw".$this->idzusatz.$parent."x".$depth."\">"; else { $out.='
'; $out.="
idzusatz."\" class=\"kategoriewahl\">
idzusatz."0\" id=\"kw".$this->idzusatz."0x0\">"; } $outx="";$outf=""; $a=0; $children=array(); foreach($arr as $kat) { if (count($kat["sub"])) { $outx.=$this->jquery_catwahl($kat["sub"],$kat["id"],$depth+1,$rand,$a); $lastcat=""; $ff=" >> "; $a++; $out=str_replace("LASTCAT_REPLACE","",$out); } else { $lastcat="lc"; $lastcat=""; $ff=""; $out=str_replace("LASTCAT_REPLACE","ulc ",$out); $children[]=array($kat["id"],utf8_encode(utf8_decode_extra(utf8_encode($kat["name_eng"])))); } $outf.="idzusatz.$kat["id"]."\">".$kat["name_eng"].""; } if (count($children)) $out.=json_encode(array("p"=>$parent,"c"=>$children)); elseif ($parent!=0) { $out.="
    idzusatz.$depth."\" id=\"dmc".$this->idzusatz.$parent."x".$depth."\">"; $out.=$outf; $out.="
"; } elseif($parent==0) { $out.="
    idzusatz.$depth."\" id=\"dmc".$this->idzusatz.$parent."x".$depth."\">"; $out.=$outf; $out.="
"; } $out.="
"; $out.=$outx; if ($parent==0) { global $user; $out.=''; } if ($parent==0) { $out.="
"; $out.='
    '; $lastcat=unserialize($_SESSION["lastcat"]); if (count($lastcat)) { for($i=0;$imysql_query("select id,hierarchie1,hierarchie2,hierarchie3 from ".$conf["cat_db"]."bilder_kategorien where id='".$lastcat[$i]."' AND startbilder='".$conf["startbilder_betreiber"]["id"]."'"); else $resultx=$conf["cache"]->mysql_query("select id,hierarchie1,hierarchie2,hierarchie3 from ".$conf["cat_db"]."bilder_kategorien where id='".$lastcat[$i]."'"); $zeilex=mysql_fetch_assoc($resultx); if ($zeilex["hierarchie3"]) $out.="
  • ".$zeilex["hierarchie1"]." / ".$zeilex["hierarchie2"]." / ".$zeilex["hierarchie3"]."
  • "; } } $out.='
'; $meinekategorien=new meine_kategoriewahl; global $bild_id; $out.=$meinekategorien->form($_GET['bild_id']?$_GET['bild_id']:$bild_id); $out.='
'; $out.='
'; $out.=''; $out.="idzusatz."\" value=\"\" />"; } return $out; } } ?> mysql_query("select * from meinegalerien where fotograf_id='".$user['id']."'"); while($zeile=mysql_fetch_assoc($result)) $this->kats[$zeile['id']]=$zeile['name']; } } function form($bild_id) { if(!$bild_id) return; global $conf; //if (!count($this->kats)) return false; $out.='
'; $selected=array(); $result=$conf["cache"]->mysql_query("select A.kategorie_id,B.name from meinegalerien_kategoriezuordnung A,meinegalerien B where B.id=A.kategorie_id AND A.bild_id=".$bild_id); $verbal=""; while($zeile=mysql_fetch_assoc($result)) { $selected[]=$zeile['kategorie_id']; $verbal.=$zeile['name'].'
'; } $out.='
    '; foreach($this->kats as $id => $kategorie) { $out.='
  • '.$kategorie.'
  • '; } $out.='
'; $out.=''; $out.=''; $out.=''; $out.='
'.$verbal.'
'; $out.='

persönliche Galerien editieren'; $out.='
'; return $out; } function new_form($bild_id) { if(!$bild_id) return; global $conf; $design=array(); $result=$conf["cache"]->mysql_query("select A.kategorie_id,B.name from meinegalerien_kategoriezuordnung A,meinegalerien B where B.id=A.kategorie_id AND A.bild_id=".$bild_id); while($zeile=mysql_fetch_assoc($result)) { $design["gewaehlte"][$zeile["kategorie_id"]]=$zeile["name"]; } $design["alle"]=$this->kats; return $this->templateIt($design,$conf["path_bahnbilder"].'/templates'.$conf["redesign"].'/meine_kategoriewahl.tpl.php'); } } ?>
Fatal error: Uncaught Error: Class 'lang' not found in /var/www/vhosts/bahnbilder.de/httpdocs/bahnbilder.de/index.php:189 Stack trace: #0 {main} thrown in /var/www/vhosts/bahnbilder.de/httpdocs/bahnbilder.de/index.php on line 189