Commit c1374940 authored by Nico Schallehn's avatar Nico Schallehn

Übersetzung Table zu Tabelle

parent 9debda05
......@@ -51,13 +51,13 @@ class MediaDBViewerAPI{
public function API_GetDataListe($GET_arr, $POST_arr =""){
if(!isset($GET_arr['Table']) OR ($GET_arr['Table'] == "")) {
if(!isset($GET_arr['Tabelle']) OR ($GET_arr['Tabelle'] == "")) {
return $this->error(1004);
}
else{
// Wenn irgenein filter gesetzt ist...
if( (isset($GET_arr['imdbID']) OR isset($GET_arr['3d']) OR isset($GET_arr['GenreID']) OR isset($GET_arr['Genre']) OR
isset($GET_arr['SchauspielerID']) OR isset($GET_arr['Schauspieler']) OR isset($GET_arr['Suche']) ) AND $GET_arr['Table'] == "Filme" ){ // Filterung nur für Tablle Filme!!
isset($GET_arr['SchauspielerID']) OR isset($GET_arr['Schauspieler']) OR isset($GET_arr['Suche']) ) AND $GET_arr['Tabelle'] == "Filme" ){ // Filterung nur für Tablle Filme!!
$first = true;
$Where = "WHERE ";
if(isset($GET_arr['imdbID']) AND is_numeric($GET_arr['imdbID'])){
......@@ -70,9 +70,8 @@ class MediaDBViewerAPI{
$first = false;
}
if(isset($GET_arr['Suche'])){
$Suche = " `name` LIKE '%".$GET_arr['Suche']."%' OR
`md5` LIKE '%".$GET_arr['Suche']."%' OR
`comment` LIKE '%".$GET_arr['Suche']."%'"; //OR `year` = '".$GET_arr['Suche']."' OR `resolution` LIKE '%".$GET_arr['Suche']."%'
$Suche = " `name` LIKE '%".$GET_arr['Suche']."%' OR `md5` LIKE '%".$GET_arr['Suche']."%' OR `comment` LIKE '%".$GET_arr['Suche']."%'";
//OR `year` = '".$GET_arr['Suche']."' OR `resolution` LIKE '%".$GET_arr['Suche']."%'
$Where .= (($first?"":" AND ").$Suche);
$first = false;
}
......@@ -113,6 +112,8 @@ class MediaDBViewerAPI{
$Where .= (strlen($SchauspielerArr["imdbIDs"])>0?($first?"":" AND ").str_replace(",)", ")", 'imdbID in ('.$SchauspielerArr["imdbIDs"].')'): ($first?" 0 ":""));
$first = false;
}
//TODO Hier gemeinsame Auswertunf für die imdbIDs von Genre und schauspieler!!!
}
// Überprüfen ob Schauspieler oder Genre gefordert wird
......@@ -140,7 +141,7 @@ class MediaDBViewerAPI{
$Query= "SELECT ".$Select.
" FROM ".$GET_arr['Table']." "
" FROM ".$GET_arr['Tabelle']." "
.$Where
.$this->iset($GET_arr['Order'], " ", " ORDER BY ", " ")
.$this->iset($GET_arr['Limit'],"", " Limit "," ")
......@@ -164,8 +165,7 @@ class MediaDBViewerAPI{
$tempArray[$val->name] = utf8_encode($entry[$val->name]);
}
}
//TODO Diesen block in den Hauptquery einbauen?!
// Genre oder Schauspielerblock hinzufügen wenn es gewünscht ist
if($ListGenre){
$Query = 'SELECT group_concat(g.gername) AS Genre FROM FilmGenre AS fg JOIN Genre AS g ON fg.genreID = g.genreID WHERE fg.imdbID="'.$entry["imdbID"].'" ORDER BY g.gername';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment