diff --git a/config.inc.php b/config.inc.php index 1f87ada..214a781 100644 --- a/config.inc.php +++ b/config.inc.php @@ -55,6 +55,12 @@ ), array( "name" => "GL-Inet", + "filename" => "-gl-", + "offset_modell" => 3, + "offset_version" => 4 + ), + array( + "name" => "GL-Inet (alt)", "filename" => "gl-inet", "offset_modell" => 8, "offset_version" => -1 diff --git a/ffrouter_parsen.function.php b/ffrouter_parsen.function.php index e108409..22ab452 100644 --- a/ffrouter_parsen.function.php +++ b/ffrouter_parsen.function.php @@ -5,119 +5,119 @@ * @license Licensed under GPLv3 */ if(!is_dir($firmware_download_path)) { - throw new Exception("Firmwareverzeichnis existiert nicht!"); + throw new Exception("Firmwareverzeichnis existiert nicht!"); } $err = 0; for( $i=0; $ihersteller, $router_tmp[$x]['hersteller']) == 0) && (strcasecmp($router[$z]->modell, $router_tmp[$x]['modell']) == 0) && (strcasecmp($router[$z]->version, $router_tmp[$x]['version']) == 0)) { - $entinst = $entwicklung[$i].$installation[$j]; - $entinstlink = $entwicklung[$i].$installation[$j]."link"; - $router[$z]->$entinst = 1; - $router[$z]->$entinstlink = $firmware_download_path.$entwicklung[$i]."/".$installation[$j]."/".$files[$entwicklung[$i]][$installation[$j]][$x]; - $router_neu = 0; - break; - } - } - } - if($router_neu == 1) { - $z = count($router); - $router[$z] = new ffrouter(); - $router[$z]->hersteller = $router_tmp[$x]['hersteller']; - $router[$z]->version = $router_tmp[$x]['version']; - $router[$z]->modell = $router_tmp[$x]['modell']; - $entinst = $entwicklung[$i].$installation[$j]; - $entinstlink = $entwicklung[$i].$installation[$j]."link"; - $router[$z]->$entinst = 1; - $router[$z]->$entinstlink = $firmware_download_path.$entwicklung[$i]."/".$installation[$j]."/".$files[$entwicklung[$i]][$installation[$j]][$x]; - } - } - } - } - $router_tmp = array(); - } + for( $j=0; $jhersteller, $router_tmp[$x]['hersteller']) == 0) && (strcasecmp($router[$z]->modell, $router_tmp[$x]['modell']) == 0) && (strcasecmp($router[$z]->version, $router_tmp[$x]['version']) == 0)) { + $entinst = $entwicklung[$i].$installation[$j]; + $entinstlink = $entwicklung[$i].$installation[$j]."link"; + $router[$z]->$entinst = 1; + $router[$z]->$entinstlink = $firmware_download_path.$entwicklung[$i]."/".$installation[$j]."/".$files[$entwicklung[$i]][$installation[$j]][$x]; + $router_neu = 0; + break; + } + } + } + if($router_neu == 1) { + $z = count($router); + $router[$z] = new ffrouter(); + $router[$z]->hersteller = $router_tmp[$x]['hersteller']; + $router[$z]->version = $router_tmp[$x]['version']; + $router[$z]->modell = $router_tmp[$x]['modell']; + $entinst = $entwicklung[$i].$installation[$j]; + $entinstlink = $entwicklung[$i].$installation[$j]."link"; + $router[$z]->$entinst = 1; + $router[$z]->$entinstlink = $firmware_download_path.$entwicklung[$i]."/".$installation[$j]."/".$files[$entwicklung[$i]][$installation[$j]][$x]; + } + } + } + } + $router_tmp = array(); + } } for( $i=0; $ihersteller))) { - if(is_file(strtolower("router_images/".$router[$i]->hersteller."/".$router[$i]->modell."-".$router[$i]->version.".jpg"))) { - $router[$i]->imagefront = strtolower("router_images/".$router[$i]->hersteller."/".$router[$i]->modell."-".$router[$i]->version.".jpg"); - } else { - $router[$i]->imagefront = "router_images/keinbild.jpg"; - } - if(is_file(strtolower("router_images/".$router[$i]->hersteller."/".$router[$i]->modell."-".$router[$i]->version."_back.jpg"))) { - $router[$i]->imageback = strtolower("router_images/".$router[$i]->hersteller."/".$router[$i]->modell."-".$router[$i]->version."_back.jpg"); - } else { - $router[$i]->imageback = "router_images/keinbild.jpg"; - } - } else { - $router[$i]->imagefront = "router_images/keinbild.jpg"; - $router[$i]->imageback = "router_images/keinbild.jpg"; - } + if(is_dir(strtolower("router_images/".$router[$i]->hersteller))) { + if(is_file(strtolower("router_images/".$router[$i]->hersteller."/".$router[$i]->modell."-".$router[$i]->version.".jpg"))) { + $router[$i]->imagefront = strtolower("router_images/".$router[$i]->hersteller."/".$router[$i]->modell."-".$router[$i]->version.".jpg"); + } else { + $router[$i]->imagefront = "router_images/keinbild.jpg"; + } + if(is_file(strtolower("router_images/".$router[$i]->hersteller."/".$router[$i]->modell."-".$router[$i]->version."_back.jpg"))) { + $router[$i]->imageback = strtolower("router_images/".$router[$i]->hersteller."/".$router[$i]->modell."-".$router[$i]->version."_back.jpg"); + } else { + $router[$i]->imageback = "router_images/keinbild.jpg"; + } + } else { + $router[$i]->imagefront = "router_images/keinbild.jpg"; + $router[$i]->imageback = "router_images/keinbild.jpg"; + } }