From 7ad712ec504147f19120a38eef1464578b6451a3 Mon Sep 17 00:00:00 2001 From: Rudolf Hangl Date: Thu, 9 Apr 2009 13:59:56 +0000 Subject: [PATCH] --- system/abgabe2opus.php | 1169 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 1162 insertions(+), 7 deletions(-) diff --git a/system/abgabe2opus.php b/system/abgabe2opus.php index a551725e7..c231916f6 100644 --- a/system/abgabe2opus.php +++ b/system/abgabe2opus.php @@ -38,12 +38,22 @@ require_once('../include/mail.class.php'); die('Es konnte keine Verbindung zum Server aufgebaut werden.'); // zugriff auf mssql-datenbank - if (!$conn_ext=mysql_connect (OPUS_SERVER, OPUS_USER, OPUS_PASSWD)) + if (!$conn_ext=mysql_pconnect (OPUS_SERVER, OPUS_USER, OPUS_PASSWD)) die('Fehler beim Verbindungsaufbau!'); mysql_select_db(OPUS_DB, $conn_ext); - +/* + $sock = $opus->connect(); + if ($sock < 0 || $opus->select_db() < 0) + { + print (""); + echo ("Error: $ERRMSG\n"); + print (" \n"); + } +*/ $datum_obj = new datum(); +//$jahr=''; +//$source_opus=''; $fehler=''; $error=false; $begutachter1=''; @@ -56,8 +66,1116 @@ $typ=''; $bereich=1; $stg=''; $row_opus=0; -$opus_url=OPUS_PATH_PAA; //http://cis.technikum-wien.at/opus/htdocs/volltexte/ 2008/10/ -$url_paa='http://dav.technikum-wien.at/ruhan/PaUpload/'; +$opus_url=OPUS_PATH_PAA; +$url_paa=PAABGABE_PATH; +function formatDatum($datum, $format='Y-m-d H:i:s') +{ + if(trim($datum)=='') + return ''; + + $ts=''; + $error=false; + + //2008-12-31 + if(ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})",$datum, $regs)) + $ts = mktime(0,0,0,$regs[2],$regs[3],$regs[1]); + + //2008-12-31 12:30 + if(ereg("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2})",$datum, $regs)) + $ts = mktime($regs[4],$regs[5],0,$regs[2],$regs[3],$regs[1]); + + //2008-12-31 12:30:15 + if(ereg("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})",$datum, $regs)) + $ts = mktime($regs[4],$regs[5],$regs[6],$regs[2],$regs[3],$regs[1]); + + //1.12.2008 + if(ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})",$datum, $regs)) + $ts = mktime(0,0,0,$regs[2],$regs[1],$regs[3]); + + //1.12.2008 12:30 + if(ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4}) ([0-9]{2}):([0-9]{2})",$datum, $regs)) + $ts = mktime($regs[4],$regs[5],0,$regs[2],$regs[1],$regs[3]); + + //1.12.2008 12:30:15 + if(ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4}) ([0-9]{2}):([0-9]{2}):([0-9]{2})",$datum, $regs)) + $ts = mktime($regs[4],$regs[5],$regs[6],$regs[2],$regs[1],$regs[3]); + + if($ts=='') + { + $ts = strtotime($datum); + if(!$ts || $ts==-1) + { + //wenn strtotime fehlschlaegt liefert diese -1 zurueck, ab php5.1.0 jedoch false + $error = true; + } + } + + if($ts!='' && !$error) + return date($format, $ts); + + return false; +} +function indexdatei($source_opus, $fd) +{ + require '../opus/lib/opus.class.php'; + $opus = new OPUS('../opus/lib/opus.conf'); + $php = $opus->value("php"); + $db = $opus->value("db"); + $opustable = $opus->value("opus_table"); + $url = $opus->value("url"); + $mod_checksum = $opus->value("mod_checksum"); + $projekt = $opus->value("projekt"); + $url_anzeigen = $opus->value("url_anzeigen"); + $urn_anzeigen = $opus->value("urn_anzeigen"); + $lic_active = $opus->value("license_active"); + $doku_pfad = $opus->value("doku_pfad"); + $statistik = $opus->value("statistik"); + $awstats_url = $opus->value("awstats_url"); + $awstats_config = $opus->value("awstats_config"); + $empfehlen = $opus->value("empfehlen"); + $mehrsprachig = $opus->value("mehrsprachig"); + $google_scholar = $opus->value("google_scholar"); + $url_google_scholar = $opus->value("url_google_scholar"); + # BD, 16.9.05: steht nun in frontdoor.conf + # $titel = $opus->value("titel_frontdoor"); + # $ueberschrift = $opus->value("ueberschrift_frontdoor"); + // Anfang Collections + $coll_anzeigen = $opus->value("coll_anzeigen"); + // Ende Collections + $opustable_autor = $opustable . "_autor"; + $opustable_inst = $opustable . "_inst"; + $opustable_diss = $opustable . "_diss"; + $opustable_subject_type = $opustable . "_subject_type"; + $opustable_sr = $opustable . "_schriftenreihe"; + // Anfang Collections + $opustable_coll = $opustable . "_coll"; + // Ende Collections + // Social-Bookmarking-Schnittstellen + $connotea_export = $opus->value("connotea_export"); + $delicious_export = $opus->value("delicious_export"); + $social_bookmarking = 0; + if ($connotea_export == 1 || $delicious_export == 1) + { + $social_bookmarking = 1; + } + /*if ($_REQUEST["show_connotea"]) + { + $_SESSION["show_connotea"] = true; + }*/ + // Ende Social-Bookmarking-Schnittstellen + include ("../opus/lib/stringValidation.php"); + //$source_opus = $_REQUEST['source_opus']; + if (!_is_valid($source_opus, 1, 10, "[0-9]+")) + { + die("Fehler in Parameter source_opus"); + } + # A.Maile 10.2.05: Sprache einlesen aus opus.conf, falls nicht gesetzt + if (!$la) + { + $la = $opus->value("la"); + } + # O. Marahrens: Automatisch alle Texte aus der Textdatei holen + $texte = new OPUS("../opus/texte/$la/frontdoor.conf"); + foreach($texte->getValues() as $k => $v) { + $$k = $v; + } + + $res = $opus->query("SELECT * FROM $opustable WHERE source_opus = $source_opus "); + $num_res = $opus->num_rows($res); + if ($num_res > 0) + { + $mrow = $opus->fetch_row($res); + $title_orig = $mrow[0]; + $title = htmlspecialchars($mrow[0]); + $creator_corporate = $mrow[1]; + $subject_swd = htmlspecialchars($mrow[2]); + $description = $mrow[3]; + # Abstract fuer die Metadaten html-codieren + $description_meta = htmlspecialchars($mrow[3]); + $publisher_university = $mrow[4]; + $contributors_name = $mrow[5]; + $contributors_corporate = $mrow[6]; + $date_year = $mrow[7]; + $date_creation = $mrow[8]; + $date_modified_old = $mrow[9]; + $type = $mrow[10]; + $source_opus = $mrow[11]; + $source_title = htmlspecialchars($mrow[12]); + $source_swb = $mrow[13]; + $language = $mrow[14]; + $verification = $mrow[15]; + $subject_uncontrolled_german = htmlspecialchars($mrow[16]); + $subject_uncontrolled_english = htmlspecialchars($mrow[17]); + $title_en = $mrow[18]; + $description2 = $mrow[19]; + # Abstract fuer die Metadaten html-codieren + $description2_meta = htmlspecialchars($mrow[19]); + $subject_type = $mrow[20]; + $date_valid = $mrow[21]; + $description_lang = $mrow[22]; + $description2_lang = $mrow[23]; + $sachgruppe_ddc = $mrow[24]; + $urn = $mrow[25]; + $bereich_id = $mrow[26]; + if ($lic_active >= 2) + { + $lic = $mrow[27]; + } + $isbn = $mrow[28]; + $bem_extern = $mrow[30]; + //******************************************************************************************************************************** + //Änderung TW + $issn = $mrow[32]; + $ac_nr = $mrow[33]; + $studiengang = $mrow[34]; + $seitenanzahl = $mrow[35]; + $datum = $mrow[36]; + $gutachter1 = $mrow[37]; + $gutachter2 = $mrow[38]; + //******************************************************************************************************************************** + $opus->free_result($res); + /***** Schriftenreihe Start *****/ + $sr_id = ""; + $sr_band = ""; + $res = $opus->query("SELECT * FROM $opustable_sr WHERE source_opus = $source_opus "); + $num_res = $opus->num_rows($res); + if ($num_res > 0) + { + $mrow = $opus->fetch_row($res); + $sr_id = $mrow[1]; + $sr_band = $mrow[2]; + $res = $opus->query("select name from schriftenreihen where sr_id = '$sr_id' "); + $mrow = $opus->fetch_row($res); + $sr_name = $mrow[0]; + $opus->free_result($res); + } + /***** Schriftenreihe Stop *****/ + /* Bei Dissertation (type 8) und Habilitation (type 24) zusaetzlich */ + /* Tag der muendlichen Pruefung (bzw. des Kollquiums) und Hauptberichter anzeigen */ + if ($type == "8" || $type == "24") + { + $res = $opus->query("SELECT date_accepted, advisor, publisher_faculty, title_de FROM $opustable_diss WHERE source_opus = $source_opus"); + $anz = $opus->num_rows($res); + if ($anz > 0) + { + $mrow = $opus->fetch_row($res); + $date_accepted = $mrow[0]; + $advisor = htmlspecialchars($mrow[1]); + $faculty_nr = $mrow[2]; + $title_de = $mrow[3]; + } + $opus->free_result($res); + $res = $opus->query("SELECT fakultaet from faculty_$la where nr = '$faculty_nr'"); + $mrow = $opus->fetch_row($res); + $publisher_faculty = $mrow[0]; + $opus->free_result($res); + } + $jahr = date("Y", $date_creation); + $res = $opus->query("SELECT name FROM institute_$la i, $opustable_inst oi WHERE i.nr=oi.inst_nr and oi.source_opus = '$source_opus'"); + $instnum = $opus->num_rows($res); + $i = 0; + while ($i < $instnum) + { + $i++; + $mrow = $opus->fetch_row($res); + $inst[$i] = $mrow[0]; + } + $opus->free_result($res); + // Anfang Collections + if ($coll_anzeigen == "true") + { + $res = $opus->query("SELECT c.coll_id FROM collections as c, $opustable_coll as oc WHERE c.coll_id = oc.coll_id and oc.source_opus = '$source_opus'"); + $collnum = $opus->num_rows($res); + $i = 0; + while ($i < $collnum) + { + $i++; + $mrow = $opus->fetch_row($res); + $coll[$i] = $mrow[0]; + } + $opus->free_result($res); + } + // Ende Collections + $res = $opus->query("SELECT sprache FROM language_$la WHERE code='$language'"); + $mrow = $opus->fetch_row($res); + $sprache = ucfirst($mrow[0]); + $opus->free_result($res); + $res = $opus->query("SELECT sprache FROM language_$la WHERE code='$description_lang'"); + $mrow = $opus->fetch_row($res); + $sprache_description = ucfirst($mrow[0]); + $opus->free_result($res); + if ($description2_lang != "") + { + $res = $opus->query("SELECT sprache FROM language_$la WHERE code='$description2_lang'"); + $mrow = $opus->fetch_row($res); + $sprache_description2 = ucfirst($mrow[0]); + $opus->free_result($res); + } + $res = $opus->query("SELECT dokumentart FROM resource_type_$la WHERE typeid='$type'"); + $mrow = $opus->fetch_row($res); + $dokumentart = $mrow[0]; + $opus->free_result($res); + # Start Lizenzvertrag + # Link auf Lizenz ausgeben, falls Lizenz-Modul aktiv und Feld lic belegt. + # Falls Lizenz-Modul aktiv, aber Feld lic nicht belegt (alte OPUS-Bestaende) + # dann Link auf urheberrecht.php ausgeben. + if ($lic_active >= 2) + { + $res = $opus->query("SELECT longname, link, logo, desc_text, desc_html FROM license_$la WHERE shortname='$lic'"); + $licnum = $opus->num_rows($res); + if ($licnum == 1) + { + $mrow = $opus->fetch_row($res); + $licname = $mrow[0]; + $liclink = $mrow[1]; + $liclogo = $mrow[2]; + $licdesc = $mrow[3]; + $licdesc_html = $mrow[4]; + $liclink_head = "$lizenz

"; + } + else + { + $liclink_head = "$text1

"; + } + $opus->free_result($res); + } + else + { + $liclink_head = "$text1

"; + } + # Ende Lizenzvertrag + # Zugriff auf Volltexte weltweit/campusweit/weitere Bereiche + # Falls in Altbestaenden (< Opus 3.0) kein Bereich angegeben ist, + # wird bereich_id auf 1 gesetzt = freier Zugriff auf die Dokumente, + # sonst kommt eine Fehlermeldung der Datenbank + if ($bereich_id == "" || $bereich_id == 0) + { + $bereich_id = 1; + } + $res = $opus->query("SELECT bereich, volltext_pfad, volltext_url FROM bereich_$la WHERE bereich_id = $bereich_id"); + $num = $opus->num_rows($res); + if ($num > 0) + { + $mrow = $opus->fetch_row($res); + $bereich = $mrow[0]; + $volltext_pfad = $mrow[1]; + $volltext_url = $mrow[2]; + $opus->free_result($res); + } + # Ende Zugriff auf Volltexte weltweit/campusweit/weitere Bereiche + $autor = $opus->query("SELECT creator_name, reihenfolge FROM $opustable_autor WHERE source_opus = $source_opus order by reihenfolge"); + $anzahl_creator_name = $opus->num_rows($autor); + $i = 0; + while ($i < $anzahl_creator_name) + { + $mrow = $opus->fetch_row($autor); + $creator_name = $mrow[0]; + $creator_name = htmlspecialchars($creator_name); + $search_creator.= " ; " . $creator_name; + $i++; + } + $search_creator = substr($search_creator, 3); + # Titel und Autoren des Dokuments sollen in erscheinen + $titel = "$projekt - $title - $search_creator"; + # Annette Maile, 18.3.05 Design aus lib/design.php einlesen + //require ("../../lib/design.$php"); + //$design = new design; + //$design->head_titel($titel); + # Ausgabe einiger DC-Metadaten + fwrite($fd,"<META NAME=\"DC.Title\" CONTENT=\"$title\">\n"); + fwrite($fd,"<META NAME=\"title\" CONTENT=\"$title\">\n"); + if ($anzahl_creator_name > 0) + { + $opus->data_seek($autor, 0); + $i = 0; + while ($i < $anzahl_creator_name) + { + $mrow = $opus->fetch_row($autor); + $creator_name = $mrow[0]; + $creator_name = htmlspecialchars($creator_name); + fwrite($fd,"<META NAME=\"DC.Creator\" CONTENT=\"$creator_name\">\n"); + $search_creator.= " ; " . $creator_name; + $i++; + } + } + if ($search_creator != "") + { + fwrite($fd,"<META NAME=\"author\" CONTENT=\"$search_creator\">\n"); + } + $subject = $subject_swd; + if ($subject_uncontrolled_german != "") + { + $subject.= " , $subject_uncontrolled_german"; + } + if ($subject_uncontrolled_english != "") + { + $subject.= " , $subject_uncontrolled_english"; + } + fwrite($fd,"<META NAME=\"DC.Subject\" CONTENT=\"$subject\">\n"); + fwrite($fd,"<META NAME=\"keywords\" CONTENT=\"$subject\">\n"); + fwrite($fd,"<META NAME=\"DC.Identifier\" CONTENT=\"$volltext_url/$jahr/$source_opus/\">\n"); + //******************************************************************************************************************************************* + //Änderung TW + if ($urn && $urn_anzeigen) + { + if ($urn != "") + { + fwrite($fd,"<META NAME=\"DC.Identifier\" CONTENT=\"$urn\">\n"); + } + } + //******************************************************************************************************************************************* + fwrite($fd,"<META NAME=\"DC.Description\" CONTENT=\"$description_meta \n$description2_meta\">\n"); + fwrite($fd,"<META NAME=\"description\" CONTENT=\"$description_meta \n$description2_meta\">\n"); + # Ende der DC-Metadaten + //$design->head_ueberschrift($ueberschrift, $la); + # Button fuer Anzeige des Skripts in weiteren Sprachen), + # falls mehrere Sprachen angeboten werden. + if ($mehrsprachig == 1) + { + $design->andere_sprache($la); + } + # Start Ausgabe der Frontdoor + fwrite($fd,"<P><FONT class=\"frontdoor\">$liclink_head \n"); + # fwrite($fd,"Bitte beziehen Sie sich beim Zitieren dieses Dokumentes immer auf folgende<BR>\n"); + # fwrite($fd,"$dokumentart zugaenglich unter:"); + fwrite($fd,"$dokumentart $t_dokumentart_2<BR>\n"); + # Wenn Urn vorhanden und urn_anzeigen auf 1 gesetzt ist, wird die Urn angezeigt. + # Wenn keine Urn vorhanden ist und url_anzeigen auf 2 gesetzt ist, dann Url anzeigen. + # Wenn url_anzeigen auf 1 gesetzt ist, dann immer Url anzeigen. + if ($urn && $urn_anzeigen) + { + fwrite($fd,"URN: <a href=\"http://nbn-resolving.de/$urn\"><B>$urn</B></a><BR>\n"); + } + else + { + if ($url_anzeigen == 2) + { + if (file_exists("$volltext_pfad/$jahr/$source_opus") == 1) + { + fwrite($fd,"URL: <a href=\"$volltext_url/$jahr/$source_opus/\"><B>$volltext_url/$jahr/$source_opus/</B></a><BR>\n"); + } + } + } + if ($url_anzeigen == 1) + { + if (file_exists("$volltext_pfad/$jahr/$source_opus") == 1) + { + fwrite($fd,"URL: <a href=\"$volltext_url/$jahr/$source_opus/\"><B>$volltext_url/$jahr/$source_opus/</B></a><BR>\n"); + } + } + fwrite($fd,"</FONT><HR>"); + fwrite($fd,"<P>\n"); + fwrite($fd,"<B>$t_titel1:</B> $title\n"); + if ($title_en != "") + { + fwrite($fd,"<P><B>$t_titel2:</B> $title_en\n"); + } + /*if ($title_de != "") + { + fwrite($fd,"<P><B>$title_de</B>\n"); + }*/ + fwrite($fd,"<P> \n"); + include ("../opus/lib/font.html"); + $link = "$url/ergebnis.$php?suchart=teil&Lines_Displayed=10&sort=o.date_year+DESC%2C+o.title&suchfeld1=freitext&suchwert1=&opt1=AND&opt2=AND&suchfeld3=date_year&suchwert3=&startindex=0&page=0&dir=2&suche=&suchfeld2=oa.person&suchwert2="; + #$res = $opus->query("SELECT creator_name, reihenfolge from opus_autor where source_opus = $source_opus order by reihenfolge "); + if ($anzahl_creator_name > 0) + { + $opus->data_seek($autor, 0); + $mrow = $opus->fetch_row($autor); + $creator_name = $mrow[0]; + # A. Maile, 6.8.2007: Ersten Autor speichern für Google Scholar + $first_creator = $creator_name; + $person = htmlspecialchars(rawurlencode($creator_name)); + fwrite($fd,"<B>Autor(in): <A HREF=\"$link$person\">$creator_name</A></B>"); + $pod_creator_names = $person; + if ($anzahl_creator_name > 1) + { + $i = 1; + while ($i < $anzahl_creator_name) + { + $i++; + $mrow = $opus->fetch_row($autor); + $creator_name = $mrow[0]; + $person = htmlspecialchars(rawurlencode($creator_name)); + fwrite($fd," ; \n<B>Autor(in): <A HREF=\"$link$person\">$creator_name</A></B>"); + $pod_creator_names.= " ; " . $person; + } + } + } + $opus->free_result($autor); + fwrite($fd,"<P><FONT class=\"fr_font_klein\">"); + if ($contributors_name != "") + { + # fwrite($fd,"<BR>Weitere Beteiligte (Hrsg. etc.): $contributors_name \n"); + fwrite($fd,"$t_weitere_beteiligte $contributors_name <BR> \n"); + } + if ($creator_corporate != "") + { + fwrite($fd,"$creator_corporate <BR> \n"); + } + fwrite($fd,"</B> \n"); + fwrite($fd,"<P>\n"); + fwrite($fd,"<TABLE> \n"); + if ($source_title != "") + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_quelle</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"<B>($date_year)</B> <I>$source_title</I> </TD>\n"); + fwrite($fd,"</TR> \n"); + } + /* Es werden die Formate, die in der Tabelle Format im Feld extension stehen */ + /* in der Frontdoor angezeigt. Es wird geschaut, ob das jeweilige Directory */ + /* exisitiert und die darin enthaltenen Dateien in einer Tabelle ausgegeben */ + $format = $opus->query("select extension from format where name <> 'Originalformat' "); + $num_format = $opus->num_rows($format); + $f = 0; + while ($f < $num_format) + { + $f++; + $mrow = $opus->fetch_row($format); + $ext = $mrow[0]; + if (file_exists("$volltext_pfad/$jahr/$source_opus/$ext") == 1) + { + /* Falls Startfile .*.anzeigen vorhanden, dann nur dieses anzeigen */ + /* hauptsaechlich bei html */ + $handle = opendir("$volltext_pfad/$jahr/$source_opus/$ext"); + while ($file = readdir($handle)) + { + if (preg_match("/\.anzeigen/", $file)) + { + $startfile = $file; + } + } + closedir($handle); + if ($startfile != "") + { + /* fuehrenden Punkt und .anzeigen entfernen = Startfile des html-Dokuments */ + $startfile = str_replace(".anzeigen", "", $startfile); + $startfile = substr($startfile, 1); + fwrite($fd,"<TR>\n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$ext-$t_format:</B> \n</TD>\n"); + fwrite($fd,"\n<TD></TD><TD><TABLE BORDER=0>\n<TR>\n"); + fwrite($fd,"<TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"<A HREF=\"$volltext_url/$jahr/$source_opus/$ext/$startfile\">Dokument1.$ext </A>\n</TD>\n"); + fwrite($fd,"\n</TR>\n</TABLE>\n"); + fwrite($fd,"</TD></TR>\n"); + } + else + { + $i = 1; + $j = 1; + /* Verzeichnis in Array einlesen und sortieren */ + $handle = opendir("$volltext_pfad/$jahr/$source_opus/$ext"); + while ($file = readdir($handle)) + { + if ($file != "." && $file != "..") + { + /* Dateien, die mit .bem_ beginnen sind Bemerkungen zu den Dateien, */ + /* daher werden nur Dateien, die nicht mit .bem_ anfangen in der */ + /* Frontdoor aufgelistet. Gepackte Dateien werden separat aufgelistet */ + if (!preg_match("/^\.bem_/", $file) && !preg_match("/\.zip/i", $file) && !preg_match("/\.gz/i", $file)) { + $dir_array[count($dir_array) ] = $file; + } + } + } + closedir($handle); + $num = count($dir_array); + if ($num > 0) + { + sort($dir_array); + fwrite($fd,"<TR>\n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$ext-$t_format:</B> \n</TD>\n"); + fwrite($fd,"\n<TD></TD><TD class=\"frontdoor\"><TABLE BORDER=0>\n<TR>\n"); + $k = 0; + while ($k < $num) + { + $filename = array_shift($dir_array); + $bem_file = ""; + if (file_exists("$volltext_pfad/$jahr/$source_opus/$ext/.bem_$filename")) + { + $fd = fopen("$volltext_pfad/$jahr/$source_opus/$ext/.bem_$filename", "r"); + $bem_file = fread($fd, filesize("$volltext_pfad/$jahr/$source_opus/$ext/.bem_$filename")); + fclose($fd); + } + $file = "$volltext_pfad/$jahr/$source_opus/$ext/$filename"; + $array = explode(".", $filename); + $last = count($array) -1; + $ext2 = strtolower($array[$last]); + $size = stat($file); + $filesize = $size[7]; + $filesize = $filesize/1024; + if ($filesize < 1) + { + $filesize = number_format($filesize, 1, ",", "."); + } + else + { + $filesize = number_format($filesize, 0, ",", "."); + } + $format2 = $opus->query("select extension from format where extension like '$ext2%' "); + $num_format2 = $opus->num_rows($format2); + if ($num_format2 > 0) + { + if ($i > 3) + { + fwrite($fd,"\n</TR>\n<TR>\n"); + $i = 1; + } + fwrite($fd,"<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<A HREF=\"$volltext_url/$jahr/$source_opus/$ext/$filename\" target=\"new\">Dokument $j.$ext2 ($filesize KB) </A> "); + if ($bem_file != "") + { + fwrite($fd,"($bem_file)"); + } + fwrite($fd,"\n</TD>\n"); + $i++; + $j++; + } + $k++; + } + fwrite($fd,"\n</TR>\n</TABLE>\n"); + fwrite($fd,"</TD></TR>\n"); + } + } + /* gezipptes File mit Endung zip bzw. gz einlesen */ + $g = 0; + while ($g < 2) + { + $g++; + if ($g == 1) + { + $z = "zip"; + } + if ($g == 2) + { + $z = "gz"; + } + $handle = opendir("$volltext_pfad/$jahr/$source_opus/$ext"); + while ($file = readdir($handle)) + { + if (preg_match("/\.$z/i", $file)) + { + if (!preg_match("/^\.bem_/", $file)) + { + $line = "$volltext_pfad/$jahr/$source_opus/$ext/$file"; + $size = stat($line); + $filesize = $size[7]; + $filesize = $filesize/1024; + if ($filesize < 1) + { + $filesize = number_format($filesize, 1);; + } + else + { + $filesize = number_format($filesize); + } + $bem_file = ""; + if (file_exists("$volltext_pfad/$jahr/$source_opus/$ext/.bem_$file")) + { + $fd = fopen("$volltext_pfad/$jahr/$source_opus/$ext/.bem_$file", "r"); + $bem_file = fread($fd, filesize("$volltext_pfad/$jahr/$source_opus/$ext/.bem_$file")); + fclose($fd); + } + fwrite($fd,"<TR>\n<TD class=\"frontdoor\">"); + fwrite($fd,"<B>$ext gepackt:</B> \n</TD>\n"); + fwrite($fd,"\n<TD></TD><TD><TABLE BORDER=0>\n<TR>\n"); + fwrite($fd,"<TD class=\"frontdoor\">"); + fwrite($fd,"<A HREF=\"$volltext_url/$jahr/$source_opus/$ext/$file\">Dokument1.$z ($filesize KB) </A> "); + if ($bem_file != "") + { + fwrite($fd,"($bem_file)"); + } + fwrite($fd,"\n</TD>\n"); + fwrite($fd,"\n</TR>\n</TABLE>\n"); + fwrite($fd,"</TD></TR>\n"); + } + } + } + closedir($handle); + } + } + } + $opus->free_result($format); + fwrite($fd,"</table>"); + fwrite($fd,"<BR> \n"); + + # Checksummen-Ueberpruefung + if ($mod_gpg == 1 || $mod_checksum == 1) + { + fwrite($fd,"<img src= \"$url/Icons/blind.gif\" border=\"0\" width=\"2\" height=\"1\"><A HREF=\"$url/dok_unversehrtheit.php?la=$la&source_opus=$source_opus\" title=\"$unv\"><img src=\"$url/Icons/unversehrt.jpg\" border=\"0\"></a> \n"); + } + + # A. Maile 11.10.05: Link zur Dokumentempfehlung + if ($empfehlen == 1) + { + fwrite($fd,"<img src= \"$url/Icons/blind.gif\" border=\"0\" width=\"2\" height=\"1\"><A HREF=\"$url/mailform.php?la=$la&bereich_id=$bereich_id&jahr=$jahr&source_opus=$source_opus\" title=\"$t_empfehlen\"><img src=\"$url/Icons/hand.jpg\" border=\"0\"></a> \n"); + } + + # A. Maile 11.10.05: Link zur Statistik-Anzeige + if ($statistik == 1) + { + fwrite($fd,"<img src= \"$url/Icons/blind.gif\" border=\"0\" width=\"2\" height=\"1\"><a href=\"$url/statistik.php?source_opus=$source_opus&title=".htmlspecialchars(rawurlencode($title))."&la=$la\" TARGET=_blank title=\"$t_statistik\"><img src=\"$url/Icons/statistik.jpg\" border=\"0\"></A> \n"); + # Fuer Statistik mit awstats folgende Zeile auskommentieren. + #fwrite($fd,"<img src= \"$url/Icons/blind.gif\" border=\"0\" width=\"2\" height=\"1\"><A HREF=\"$awstats_url?urlfilter=/$source_opus/&urlfilterex=&output=urldetail&config=$awstats_config&lang=de \" TARGET=_blank title=\"$t_statistik\"><img src=\"$url/Icons/statistik.jpg\" border=\"0\"></A> $t_statistik \n"); + } + + # O.Marahrens 30.03.07: Social-Bookmarking-Dienste + if ($social_bookmarking == 1) + { + # O.Marahrens 02.02.07: Link zum Connotea-Bookmark + if ($connotea_export == 1) + { + fwrite($fd,"<img src= \"$url/Icons/blind.gif\" border=\"0\" width=\"2\" height=\"1\"><!--<a href=\"" . $_SERVER["REQUEST_URI"] . "&show_connotea=1#connotea_interface\" title=\"$t_connotea_bookmark\">--><a href=\"$url/connotea.php?source_opus=$source_opus\" title=\"$t_connotea_bookmark\" onclick=\"window.open('$url/connotea.php?source_opus=$source_opus','connotea','toolbar=no,width=700,height=400'); return false;\"><img src=\"$url/Icons/connotea_icon.jpg\" border=\"0\" alt=\"$t_connotea_bookmark\" /></a> \n"); + } + # U.Herb: del.icio.us-Bookmarking + if ($delicious_export == 1) + { + fwrite($fd,"<img src= \"$url/Icons/blind.gif\" border=\"0\" width=\"2\" height=\"1\"><A HREF=\"http://del.icio.us/post\" title=\"$t_delicious_bookmark\" + onclick=\"window.open('http://del.icio.us/post?v=4&noui&jump=close&url='+encodeURIComponent(location.href)+ + '&title='+encodeURIComponent(document.title), + 'delicious','toolbar=no,width=700,height=400'); return false;\" alt=\"$t_delicious_bookmark\"><img src=\"$url/Icons/delicious.jpg\" border=\"0\" alt=\"$t_delicious_bookmark\" /></A> \n"); + } + } + # A. Maile 6.8.2007: Link auf Google Scholar mit Suche nach exaktem Titel und Autor + if ($google_scholar == 1) + { + fwrite($fd,"<img src= \"$url/Icons/blind.gif\" border=\"0\" width=\"2\" height=\"1\"><a href=\"$url_google_scholar%22" . rawurlencode(utf8_encode($title_orig)) . "%22&as_sauthors=%22" . rawurlencode(utf8_encode($first_creator)) . "%22\" target=\"new\" title=\"$t_google_scholar\"><img src=\"$url/Icons/google_scholar.jpg\" border=\"0\"></a> \n"); + } + + fwrite($fd,"<img src= \"$url/Icons/blind.gif\" border=\"0\" width=\"2\" height=\"1\">" . + "<a href=\"$url/biblio.php?source_opus=$source_opus&export=" . + "bibtex\" title=\"$t_bibtex\"><img src=\"$url/Icons/bibtex.jpg\" border=\"0\"></a> \n" . + "<img src= \"$url/Icons/blind.gif\" border=\"0\" width=\"2\" height=\"1\">" . + "<a href=\"$url/biblio.php?source_opus=$source_opus&export=ris\" title=\"$t_ris\">" . + "<img src=\"$url/Icons/ris.jpg\" border=\"0\"></a> \n"); + + fwrite($fd,"<hr> \n"); + fwrite($fd,"<table>"); + + if ($lic_active >= 1) + { + $pod_active = $opus->value("pod_active"); + if ($pod_active > 0 && $bereich_id == 1) { // check, ob lic pod erlaubt und Volltext frei zugaenglich + $res = $opus->query("SELECT pod_allowed FROM license_$la WHERE shortname='$lic'"); + $podnum = $opus->num_rows($res); + if ($podnum == 1) + { + $mrow = $opus->fetch_row($res); + if ($mrow[0] == 1) + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\">"); + fwrite($fd,"<B>$pod_linkname_1</B> </TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\">\n<table border=\"0\"><tr><td class=\"frontdoor\">\n"); + $pod_info = $opus->value("pod_info"); + $tmp_url = "$volltext_url/$jahr/$source_opus/"; + $podlink = $pod_info . "?urn=" . urlencode($urn) . "&docurl=" . urlencode($tmp_url) . "&lic=" . $lic . "&aut=" . $pod_creator_names . "&tit=" . htmlspecialchars(rawurlencode($title)) . "&bereich_id=" . $bereich_id . "&la=" . $la; + $pod_uselogos = $opus->value("pod_uselogos"); + $pod_partner_logo = $opus->value("pod_partner_logo"); + if (($pod_uselogos) AND (strlen($pod_partner_logo) > 0)) + { + $podlogo_width = $opus->value("pod_logo_width"); + $podlogo_height = $opus->value("pod_logo_height"); + $podlogo_wh = ""; + if ($podlogo_width) + { + $podlogo_wh.= " width=\"" . $podlogo_width . "\""; + } + if ($podlogo_height) + { + $podlogo_wh.= " height=\"" . $podlogo_height . "\""; + } + fwrite($fd,"<a href=\"$podlink\" target=\"_blank\">\n"); + fwrite($fd,"<img src=\"" . $pod_partner_logo . "\" alt=\"POD-Logo\" border=\"0\"" . $podlogo_wh . ">"); + fwrite($fd,"</a> \n"); + } + fwrite($fd,"<a href=\"$podlink\" target=\"_blank\">"); + fwrite($fd,"$pod_linkname_2 </a> \n</td>\n</tr>\n</table>\n</TD>\n"); + fwrite($fd,"</TR> \n"); + } + } + $opus->free_result($res); + } + } + + # Zugriff auf Volltexte weltweit/campusweit/weitere Bereiche + # Wenn Zugriffsbeschraenkung besteht ($bereich_id > 1) + # dann diese anzeigen. + if ($bereich_id > 1) + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + # fwrite($fd,"<B>Zugriffsbeschränkung:</B></TD> \n"); + fwrite($fd,"<B>$text3:</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$bereich </TD>\n"); + fwrite($fd,"</TR> \n"); + } + # Ende Zugriff auf Volltexte weltweit/campusweit/weitere Bereiche + if ($subject_swd != "") + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\" width=\"130\">"); + fwrite($fd,"<B>$schlagwoerter_swd</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$subject_swd </TD>\n"); + fwrite($fd,"</TR> \n"); + } + if ($subject_uncontrolled_german != "") + { + fwrite($fd,"<TR>\n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$schlagwoerter_frei</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$subject_uncontrolled_german </TD>\n"); + fwrite($fd,"</TR> \n"); + } + if ($subject_uncontrolled_english != "") + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$schlagwoerter_engl</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$subject_uncontrolled_english </TD>\n"); + fwrite($fd,"</TR> \n"); + } + if ($subject_type != "") + { + $opustable_subject_type = $opustable . "_" . $subject_type; + $res = $opus->query("SELECT class from $opustable_subject_type where source_opus = $source_opus"); + $num = $opus->num_rows($res); + if ($num > 0) + { + $mrow = $opus->fetch_row($res); + $class = $mrow[0]; + $i = 1; + while ($i < $num) + { + $i++; + $mrow = $opus->fetch_row($res); + $class = "$class , $mrow[0]"; + } + $opus->free_result($res); + $res = $opus->query("SELECT name from klassifikation_$la where table_name = '$subject_type' "); + $mrow = $opus->fetch_row($res); + $class_name = $mrow[0]; + $opus->free_result($res); + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$class_name:</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$class </TD>\n"); + fwrite($fd,"</TR> \n"); + } + } + //Anfang Collections + if ($coll_anzeigen == "true") + { + $i = 0; + while ($i < $collnum) + { + $i++; + // Wir finden den coll_name der Collection heraus + $res_coll = $opus->query("SELECT coll_name FROM collections WHERE coll_id = $coll[$i];"); + $mrow_coll = $opus->fetch_row($res_coll); + $coll_name = $mrow_coll[0]; + // Wir finden den Namen und die ganze Hierarchie nach oben heraus + $query_eltern = "SELECT a.coll_name, (a.rgt - a.lft ) AS height + FROM collections AS a, collections AS b + WHERE b.lft BETWEEN a.lft AND a.rgt + AND b.coll_id = '$coll[$i]' + ORDER BY height DESC;"; + $res_eltern = $opus->query($query_eltern); + $num_eltern = $opus->num_rows($res_eltern); + fwrite($fd,"<tr> \n<td class=\"frontdoor\" valign=\"top\">"); + if ($collnum > 1) + { + fwrite($fd,"<b>$t_collection $i:</b></td> \n"); + } + else + { + fwrite($fd,"<b>$t_collection:</b></td>\n"); + } + fwrite($fd,"<td></td><td class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"<a href=\"$url/abfrage_collections.php?coll_id=$coll[$i]&la=$la\" target=\"new\">"); + $m = 0; + while ($m < $num_eltern) + { + $mrow_eltern = $opus->fetch_row($res_eltern); + $coll_name_eltern = $mrow_eltern[0]; + if ($coll_name_eltern != $coll_name) + { + fwrite($fd,"$coll_name_eltern / "); + } + else + { + fwrite($fd,"$coll_name_eltern"); + } + $m++; + } + fwrite($fd,"</a></td> \n"); + fwrite($fd,"</tr> \n"); + } + } + // Ende Collections + $i = 0; + while ($i < $instnum) + { + $i++; + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + if ($instnum > 1) + { + fwrite($fd,"<B>$t_institut $i:</B></TD> \n"); + } + else + { + fwrite($fd,"<B>$t_institut:</B></TD> \n"); + } + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$inst[$i]</TD>\n"); + fwrite($fd,"</TR> \n"); + } + if ($publisher_faculty != "") + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_fakultaet</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$publisher_faculty </TD>\n"); + fwrite($fd,"</TR> \n"); + } + //*************************************************************************************************************************************** + //Änderung TW + //Studiengang, Seitenanzahl, Datum, AC-Nummer und Begutachter eingefügt + if ($studiengang != "" && $studiengang>0) + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + $res = $opus->query("SELECT * FROM studiengang WHERE stg_nr ='$studiengang'"); + $rrr = 'name_'.$la; + $mrow = $opus->fetch_object($res); + $name = $mrow->$rrr; + $typ = $mrow->typ; + fwrite($fd,"<B>$t_studiengang</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$studiengang, $typ $name </TD>\n"); + fwrite($fd,"</TR> \n"); + } + if ($ac_nr != "") + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_acnr</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$ac_nr </TD>\n"); + fwrite($fd,"</TR> \n"); + } + if ($seitenanzahl != "") + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_sanz</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$seitenanzahl </TD>\n"); + fwrite($fd,"</TR> \n"); + } + if ($datum != "" && $datum!=NULL) + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_datum</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + $datum=formatDatum($datum, 'd.m.Y'); + fwrite($fd,$datum."</TD>\n"); + fwrite($fd,"</TR> \n"); + } + if ($gutachter1 != "") + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_gutachter1</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$gutachter1 </TD>\n"); + fwrite($fd,"</TR> \n"); + } + if ($gutachter2 != "") + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_gutachter2</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$gutachter2 </TD>\n"); + fwrite($fd,"</TR> \n"); + } + if ($studiensemester != 0 && $studiensemester != '') + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_studiensemester</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$studiensemester</TD>\n"); + fwrite($fd,"</TR> \n"); + } + //**************************************************************************************************************************************** + if ($sachgruppe_ddc != "" && $sachgruppe_ddc != "no") + { + $res = $opus->query("SELECT sachgruppe FROM sachgruppe_ddc_$la where nr = '$sachgruppe_ddc'"); + $num = $opus->num_rows($res); + if ($num > 0) + { + $mrow = $opus->fetch_row($res); + $sachgruppe_ddc = $mrow[0]; + } + $opus->free_result($res); + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$ddc_sachgruppe</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$sachgruppe_ddc</TD>\n"); + fwrite($fd,"</TR> \n"); + } + if ($contributors_corporate != "") + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$sonstige_institution</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$contributors_corporate </TD>\n"); + fwrite($fd,"</TR> \n"); + } + + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_dokumentart</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$dokumentart </TD>\n"); + fwrite($fd,"</TR> \n"); + /***** Schriftenreihe Start *****/ + if ($sr_id != "" && $sr_band != "") + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_schriftenreihe</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"<a href=\"$url/schriftenreihen_ebene2.php?sr_id=$sr_id&la=$la\" target=\"new\">$sr_name</a> </TD>\n"); + fwrite($fd,"</TR> \n"); + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_bandnr</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$sr_band </TD>\n"); + fwrite($fd,"</TR> \n"); + } + /***** Schriftenreihe Stop *****/ + if ($advisor != "") + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_hauptberichter</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$advisor </TD>\n"); + fwrite($fd,"</TR> \n"); + } + if ($isbn != "") + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_isbn</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$isbn </TD>\n"); + fwrite($fd,"</TR> \n"); + } + if ($issn != "") + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_issn</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$issn </TD>\n"); + fwrite($fd,"</TR> \n"); + } + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_sprache</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$sprache </TD>\n"); + fwrite($fd,"</TR> \n"); + if ($date_accepted != "") + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_pruefung_muendlich</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + $date_accepted_format = strftime("%d.%m.%Y", $date_accepted); + fwrite($fd,"$date_accepted_format </TD>\n"); + fwrite($fd,"</TR> \n"); + } + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_erstellungsjahr</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$date_year </TD>\n"); + fwrite($fd,"</TR> \n"); + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_publikationsdatum</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + $date_creation_format = strftime("%d.%m.%Y", $date_creation); + fwrite($fd,"$date_creation_format </TD>\n"); + fwrite($fd,"</TR> \n"); + if ($date_valid != 0) + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + #fwrite($fd,"<B>Gültig bis:</B></TD> \n"); + fwrite($fd,"<B>$text6</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + $date_valid_format = strftime("%d.%m.%Y", $date_valid); + fwrite($fd,"$date_valid_format </TD>\n"); + fwrite($fd,"</TR> \n"); + } + if ($bem_extern != "") + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$t_bemerkung</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,"$bem_extern </TD>\n"); + fwrite($fd,"</TR> \n"); + } + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$text4 $sprache_description:</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,nl2br($description)); + fwrite($fd,"</TD>\n"); + fwrite($fd,"</TR> \n"); + if ($description2 != "") + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$text4 $sprache_description2:</B></TD> \n"); + fwrite($fd,"<TD></TD><TD class=\"frontdoor\" valign=\"bottom\">"); + fwrite($fd,nl2br($description2)); + fwrite($fd,"</TD>\n"); + fwrite($fd,"</TR> \n"); + } + # Start Lizenzvertrag + if ($lic_active >= 2) + { + if ($licname != "") + { + fwrite($fd,"<TR> \n<TD class=\"frontdoor\" valign=\"top\">"); + fwrite($fd,"<B>$lizenz:</B></TD> \n"); + fwrite($fd,"<TD></TD>\n<TD class=\"frontdoor\" valign=\"bottom\">"); + if (strlen(trim($licdesc_html)) > 0) + { + fwrite($fd,"\n" . $licdesc_html . "\n"); + } + $lic_uselogos = $opus->value("license_uselogos"); + if (($lic_uselogos) AND (strlen($liclogo) > 0)) + { + $liclogo_width = $opus->value("license_logo_width"); + $liclogo_height = $opus->value("license_logo_height"); + $liclogo_wh = ""; + if ($liclogo_width) + { + $liclogo_wh.= " width=\"" . $liclogo_width . "\""; + } + if ($liclogo_height) + { + $liclogo_wh.= " height=\"" . $liclogo_height . "\""; + } + fwrite($fd,"<a href=\"$liclink?la=$la\" target=\"_blank\">\n"); + fwrite($fd,"<img src=\"" . $liclogo . "\" alt=\"Lizenz-Logo\" border=\"0\"" . $liclogo_wh . ">"); + fwrite($fd,"</a> \n"); + } + fwrite($fd,"<a href=\"$liclink?la=$la\" target=\"_blank\">\n"); + fwrite($fd,"$licname</a> \n</td>\n"); + fwrite($fd,"</tr> \n"); + } + } + fwrite($fd,"</TABLE> \n"); + } + else + { + #fwrite($fd,"IDN $source_opus nicht vorhanden."); + fwrite($fd,"$text7 $source_opus $text8 "); + } + //$opus->close($sock); +} + //**************************************************************************************************** //Einlesen Projektarbeiten @@ -74,6 +1192,9 @@ if($erg=pg_query($conn, $qry)) { while($row=pg_fetch_object($erg)) { + $opus_url=OPUS_PATH_PAA; + $url_paa=PAABGABE_PATH; + $row->sprache=strtolower(substr($row->sprache,0,3)); //echo "--->".$row->projektarbeit_id.", ".$row->projekttyp_kurzbz.", ".$row->student_uid; //**************************************************************************************************** //weitere benötigte Daten @@ -303,7 +1424,7 @@ if($erg=pg_query($conn, $qry)) $qry_cre="INSERT INTO opus_autor (source_opus, creator_name, reihenfolge) VALUES ('".$row_opus."', '".$verfasser."', '1')"; $qry_inst="INSERT INTO opus_inst (source_opus, inst_nr) VALUES ('".$row_opus."', '".$institut."')"; - $opus_url.=$datum_obj->formatDatum($row->abgabedatum,'Y')."/".$row_opus."/pdf/"; + $qry="START TRANSACTION"; @@ -344,9 +1465,23 @@ if($erg=pg_query($conn, $qry)) { if($row_file=pg_fetch_object($result_file)) { - copy($url_paa.$row_file->paabgabe_id.'_'.$row->student_uid.'.pdf',$opus_url."".$row_file->paabgabe_id.'_'.$row->student_uid.'.pdf'); + if(!is_dir($opus_url.$datum_obj->formatDatum($row->abgabedatum,'Y'))) + { + mkdir($opus_url.$datum_obj->formatDatum($row->abgabedatum,'Y'), 0775); + } + if(!is_dir($opus_url.$datum_obj->formatDatum($row->abgabedatum,'Y')."/".$row_opus)) + { + mkdir($opus_url.$datum_obj->formatDatum($row->abgabedatum,'Y')."/".$row_opus, 0775); + } + $opus_url=$opus_url.$datum_obj->formatDatum($row->abgabedatum,'Y')."/".$row_opus; + if(!is_dir($opus_url."/pdf/")) + { + mkdir($opus_url."/pdf/", 0775); + } + //echo "<br>Quelle: ".$url_paa.$row_file->paabgabe_id.'_'.$row->student_uid.'.pdf'." -> ".$opus_url."".$row_file->paabgabe_id.'_'.$row->student_uid.'.pdf'; + copy($url_paa.$row_file->paabgabe_id.'_'.$row->student_uid.'.pdf',$opus_url."/pdf/".$row_file->paabgabe_id.'_'.$row->student_uid.'.pdf'); //Überprüfen, ob Datei wirklich kopiert wurde - if(is_file($opus_url.$row_file->paabgabe_id.'_'.$row->student_uid.'.pdf')) + if(is_file($opus_url."/pdf/".$row_file->paabgabe_id.'_'.$row->student_uid.'.pdf')) { //COMMIT durchführen if(!$result=mysql_query('COMMIT',$conn_ext)) @@ -354,6 +1489,26 @@ if($erg=pg_query($conn, $qry)) mysql_query('ROLLBACK',$conn_ext); echo "Commit nicht ausgef&um;hrt! <br>".$row_opus."/".$verfasser."<br>".mysql_errno($conn_ext) . ": " . mysql_error($conn_ext); } + else + { + if (file_exists("$opus_url")) + { + $fd = fopen($opus_url."/index.html", 'w'); + if ($fd == 0) + { + echo ("Error: $ERRMSG <BR>\n"); + exit; + } + else + { + indexdatei($row_opus, $fd); + fclose($fd); + #print ("Indexdatei zu Dokument $source_opus wurde in die Datei <a href=\"$volltext_url/$jahr/$source_opus/index.html\">index.html</a> geschrieben.<P> \n"); + } + } else { + print ($opus_url."/pdf/ nicht vorhanden.<BR> \n"); + } + } } else {