Blame | Letzte Änderung | Log anzeigen | RSS feed
<?include("/web/apache/mediaran.de/connect.php");include("core_data.php");include("load_options.php");/* SETTINGS */// Benachrichten bei Fehler:$SETTINGS["ERROR_MSG_TO"] = "willmann@weban.de";// FTP SERVER LOGIN DATEN$SETTINGS["FTP_SERVER"] = array("SERVER" => "s87594393.einsundeinsshop.de","USER" => "u35337859","PASSWORD" => "alco17");/* ENDE SETTINGS */function get_clear_path($heritage){array_shift($heritage);return $heritage;}function output_artikel($row){global $output;unset($row[ID]);$row[beschreibung]=preg_replace("/[\r\n;]/", "", $row[beschreibung]);$output[]=preg_replace("/[\r\n]/", "", implode(";",$row));}function getFeatures($optionen,$bitmaske){$buffer=array();foreach(array_keys($optionen) as $option){if (((1 << $option) & $bitmaske) == 0) {continue;}$buffer[]=$optionen[$option];}if (count($buffer) > 0){return "selection: ".implode($buffer," | ");}else{return "";}}function ausgabe($subdir,$heritage){global $__Features;global $__Feature_ID_from_Name;global $__Feature_to_Ware;$artikel=array_pop($subdir);$subdirs=array_pop($subdir);$heritage[]=$subdir[Name];foreach($artikel as $current_row){$current_row[category]=implode("|",get_clear_path($heritage));foreach(array_keys($__Features) as $elem){$current_row[$elem]=getFeatures($__Features[$elem],$__Feature_to_Ware[$current_row[ID]][$__Feature_ID_from_Name[$elem]]);}output_artikel($current_row);}foreach($subdirs as $current_subdir){ausgabe($current_subdir,$heritage);}}$output=array();$__Felder=array("category","bezeichnung","kurzbezeichnung","bild","beschreibung","artikelnr","mwst","preis","detailbeschreibung","detailbild","templatefile_smalllist","templatefile_detail","is_invisible","gewicht","startseite");$__Felder=array_merge($__Felder,array_keys($__Features));$output[]='"fieldlist: ""'.implode('";"',$__Felder).'"';//echo "lade Daten\n";ausgabe(core_data(),array());// $output in eine temporäre Datei speichern$fp = tmpfile();fwrite($fp, implode("\n",$output));rewind($fp);// FTP VERBINDUNG AUFBAUEN$conn_id = ftp_connect($SETTINGS["FTP_SERVER"]["SERVER"]);$login_result = ftp_login($conn_id,$SETTINGS["FTP_SERVER"]["USER"],$SETTINGS["FTP_SERVER"]["PASSWORD"]);if (($conn_id) && ($login_result)){//echo "Verbindung hergestellt!\n";}else{($SETTINGS["ERROR_MSG_TO"],"Mediaran Datenupload: Ftp-Verbindung konnte nicht hergestellt werden!",$SETTINGS["FTP_SERVER"]["SERVER"]."\n".$SETTINGS["FTP_SERVER"]["USER"]."\n".$SETTINGS["FTP_SERVER"]["PASSWORD"]);die;}if (ftp_fput ($conn_id, "gateway24.de.txt", $fp, FTP_BINARY)){//echo "Upload vollständig.\n";}else{($SETTINGS["ERROR_MSG_TO"],"Mediaran Datenupload: Ftp-Datenupload konnte nicht hergestellt werden!","");//echo "Fehler!\n";exit;}// FTP-Verbindung beendenftp_close($conn_id);// temporäre Datei löschenfclose($fp);?>