Subversion-Projekte lars-tiefland.php_share

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

<?
        include("/web/apache/mediaran.de/connect.php"); 
        include("/web/apache/mediaran.de/preisagent/transfer/1und1/core_data.php");
        
        function get_clear_path($heritage)
        {
                array_shift($heritage);
                return $heritage;
        }

        function ausgabe($subdir,$heritage)
        {
                global $output;
                
                $artikel=array_pop($subdir);
                $subdirs=array_pop($subdir);

                $heritage[]=$subdir[Name];
                
                foreach($artikel as $current_row)
                {
                        $buffer=get_clear_path($heritage);
                        $current_row[category]=implode("/",$buffer);

                        $buffer=array();
                        
                        $buffer["Produktbezeichnung"]   =       $current_row[bezeichnung];
                        $buffer["Beschreibung"]                 =       "\"".preg_replace("/[\r\n;]/", "", preg_replace("/\"/", "&quot;",$current_row[beschreibung]))."\""; 
                        $buffer["Preis"]                                =       preg_replace("/\./", ",",$current_row[preis]);

                        $buffer["Deeplink"]                             =       "http://s87594393.einsundeinsshop.de/shopdata/go.shopscript?a=".$current_row[ID];
                        $buffer["Bild"]                                 =       "http://s87594393.einsundeinsshop.de/shopdata$current_row[bild]";

                        $buffer["Waehrung"]                             =       "EUR";
                        $buffer["Kategorie"]                    =       $current_row[category];

                        $output[]=$buffer;
                }
                
                foreach($subdirs as $current_subdir)
                {
                        ausgabe($current_subdir,$heritage);
                }
        }

        $output=array();
        ausgabe(core_data(),array());
        // $output ist jetzt gefüllt
        
        foreach($output as $elem)
        {
                echo implode(";",$elem)."\n";
        }
?>