Changeset 649 in t29-www
- Timestamp:
- Aug 28, 2014, 3:40:34 PM (10 years ago)
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
de/news.php
r643 r649 6 6 $neues_menu = <<< MENU 7 7 8 - titel: "Robotik-Kurs"9 t ext: "für Kids von 11-13"10 link: "#August_2014"8 - datum: "August 2014" 9 titel: "Robotik-Kurs" 10 untertitel: "für Kids von 11-13" 11 11 12 - titel: "Dechiffriermaschine"13 t ext: "Historischer 5-Bit Decoder"14 link: "#Juli_2014"12 - datum: "Juli 2014" 13 titel: "Dechiffriermaschine" 14 untertitel: "Historischer 5-Bit Decoder" 15 15 16 - titel: "Notizen zum Digitalen"17 t ext: "IBM029 auf Reisen"18 link: "#Juni_2014"16 - datum: "Juni 2014" 17 titel: "Notizen zum Digitalen" 18 untertitel: "IBM029 auf Reisen" 19 19 20 - titel: "Neu: Peripherie der IBM1130"21 t ext: "Lochstreifengeräte"22 link: "#Mai_2014"20 - datum: "Mai 2014" 21 titel: "Neu: Peripherie der IBM1130" 22 untertitel: "Lochstreifengeräte" 23 23 24 - titel: "Neu: IBM 1130 Anlage"25 t ext: "Eine neue Herausforderung"26 link: "#Januar_2014"24 - datum: "Januar 2014" 25 titel: "Neu: IBM 1130 Anlage" 26 untertitel: "Eine neue Herausforderung" 27 27 28 - titel: "Neuzugang: Lochkartendoppler"29 t ext: ""30 link: "#Dezember_2013"28 - datum: Dezember 2013 29 titel: "Neuzugang: Lochkartendoppler" 30 untertitel: "" 31 31 32 - titel: "Gamma 55 jetzt voll funktionsfähig!"33 t ext: ""34 link: "#September_2013"32 - datum: September 2013 33 titel: "Gamma 55 jetzt voll funktionsfähig!" 34 untertitel: "" 35 35 36 36 … … 43 43 44 44 45 <p>Damit alle die öfters unsere Homepage besuchen einen schnellen Einblick in Neuigkeiten und Erweiterungen haben, wurde diese Rubrik eingeführt.</p> 45 <p>Damit alle die öfters unsere Homepage besuchen einen schnellen Einblick in Neuigkeiten und Erweiterungen haben, 46 wurde diese Rubrik eingeführt. Die Neuigkeiten können sie auch <a href="?format=rss" title="technikum29-Neuigkeiten abonnieren">als RSS-Feed abonnieren</a>.</p> 46 47 47 48 <ul class="news-feed news-ng"> -
en/news.php
r599 r649 3 3 $version = '$Id$'; 4 4 $titel = "What's new?"; 5 5 $menu_version = 2; 6 6 7 $neues_menu = <<< MENU 7 8 - titel: "Art: Notes on digital" 9 text: "German art" 10 link: "#June_2014" 11 12 - titel: "Facit papertape device" 13 text: "IBM1130" 14 link: "#May_2014" 15 16 - titel: "IBM 1130" 17 text: "" 18 link: "#January_2014" 19 20 -titel: "IBM 514" 21 text: "Reproducing Punch" 22 link: "#December_2013" 23 24 - titel: "Gamma 55 is up und running" 25 text: "" 26 link: "#September_2013" 27 28 - titel: "Punch-Card-Music" 29 text: "Technique and art" 30 link: "#Mai_2013" 31 32 8 - datum: July 2014 9 titel: "Historic workshop device" 10 text: "<em>A historic 5-bit character decoder</em> from the university. Here it is used as a decryption engine in our experimental workshop." 11 bild: /shared/photos/kommunikationstechnik/telegrafenalphabet.jpg 12 link: /de/kommunikationstechnik/faxtechnik.php#decoder 13 14 - datum: June 2014 15 titel: "Art installation with cards" 16 text: "Our Cardpunch IBM029 were on jorney: For some time, it were part of an art installation in Tübingen (Baden-Wüttemberg, near Stuttgart)." 17 bild: /shared/photos/rechnertechnik/tuebingen.jpg 18 link: http://www.kunst-stoff.fr/tresorraum/wir-die-iborgs/ 19 20 - datum: May 2014 21 titel: "Facit papertape device" 22 untertitel: "IBM1130" 23 text: "Periphery of the 1130: Facit tape devices" 24 bild: /shared/photos/rechnertechnik/facit4000.jpg 25 link: /en/computer/ibm1130.php#1130 26 27 - datum: January 2014 28 titel: "IBM 1130" 29 text: "A new callenge: IBM 1130 Mainframe" 30 bild: /shared/photos/rechnertechnik/ibm-1130.jpg 31 link: /en/computer/ibm1130.php#ibm1130 32 33 - datum: December 2013 34 titel: Reproducing punch 35 untertitel: A new IBM device 36 text: "Recruit: A large IBM reproducing punch from the early days of computing" 37 bild: /shared/photos/rechnertechnik/ibm-514.jpg 38 link: /en/computer/punchcard.php#reproducing 39 40 - datum: September 2013 41 titel: "Gamma 55 is up und running" 42 text: "Success! The BULL GAMMA 55 is up and running! An historical moment." 43 bild: /shared/photos/rechnertechnik/leser617.jpg 44 link: /en/computer/gamma55.php#ge-55 33 45 34 46 MENU; 35 47 // ende der menue-Eintraege 36 48 37 if(!require("../lib/ technikum29.php")) return;49 if(!require("../lib/news.php")) return; 38 50 ?> 39 51 … … 43 55 posts are on top.</p> 44 56 57 <!-- 58 ACHTUNG, Testlauf im ENGLISCHEN: 59 60 Der Inhalt der Neuigkeiten-Datei im englischen ist nun nicht mehr "doppelt-gemoppelt", sondern 61 wird nur noch einmal gewartet, und zwar in dem obigen Auflistungsbereich. Im Bereich hier unten 62 wird der obige Inhalt nur noch in die gewohnte HTML-Formatierung gebracht. 63 64 - Sven, 28. August 2014 65 --> 66 45 67 <ul class="news-feed news-ng"> 68 <?php /* soll funktion werden in news.php */ 69 //function print_newsfeed() { 70 // global $neues_menu, $lib; 71 require $lib.'/spyc.php'; 72 $data = Spyc::YAMLLoad($neues_menu); 73 $fields = array('titel', 'datum', 'text'); 46 74 47 <li><a href="/de/kommunikationstechnik/faxtechnik.php#decoder"> 48 <h3>July 2014</h3> 49 <img src="/shared/photos/kommunikationstechnik/telegrafenalphabet.jpg" width="153" height="144" /> 50 <em>A historic 5-bit character decoder</em> from the university. Here it is used as a decryption engine in our experimental workshop. 51 </a></li> 52 53 <li><a href="http://www.kunst-stoff.fr/tresorraum/wir-die-iborgs/"> 54 <h3>June 2014</h3> 55 <img src="/shared/photos/rechnertechnik/tuebingen.jpg" width="153" height="149" /> 56 Our Cardpunch IBM029 were on jorney: For some time, it were part of an art installation in Tübingen (Baden-Wüttemberg, near Stuttgart). 57 58 </a></li> 75 $news_ul_content = ''; 76 foreach($data as $e) { 77 if(!array_reduce(array_map(function($x) use ($fields,$e){ return isset($e[$x]); }, $fields), 78 function($a,$b){ return $a && $b;}, true)) { 79 print "<li><a href='#'>Fehler in Formatierung!<em>Dieser Menüeintrag ist falsch formatiert</em></a></li>"; 80 $this->log->WARN("<h5>Neuigkeiten-Liste: Fehler in Formatierung</h5><p>Ein Eintrag in der Neuigkeisten-Liste ist falsch formatiert. Ich erwarte zu jedem Menüeintrag die Felder ".implode(", ", $fields).". Eine der Angaben fehlt oder ist fehlerhaft formatiert: <pre>".var_export($e, true)."</pre>"); 81 } else { 82 ?><li><a href="<?php print isset($e['link']) ? $e['link'] : '#'; ?>"> 83 <h3><?php print $e['datum']; ?></h3> 84 <?php print isset($e['bild']) ? "<img src='$e[bild]' alt='$e[titel]'>" : ''; ?> 85 <?php print $e['text']; ?> 86 </a></li> 87 <?php 88 } 89 } 90 //} 59 91 60 92 61 <li><a href="/en/computer/ibm1130.php#1130"> 62 <h3>May 2014</h3> 63 <img src="/shared/photos/rechnertechnik/facit4000.jpg" width="352" height="137" /> 64 Periphery of the 1130: Facit tape devices 65 </a></li> 66 67 <li><a href="/en/computer/ibm1130.php#ibm1130"> 68 <h3>January 2014</h3> 69 <img src="/shared/photos/rechnertechnik/ibm-1130.jpg" alt="IBM 1130" width="225" height="194" /> 70 A new callenge: IBM 1130 Mainframe 71 </a></li> 72 73 <li><a href="/en/computer/punchcard.php#reproducing"> 74 <h3>December 2013</h3> 75 <img src="/shared/photos/rechnertechnik/ibm-514.jpg" alt="IBM 514" width="225" height="195" /> 76 Recruit: A large IBM reproducing punch from the early days of computing 77 </a></li> 78 79 <li><a href="/en/computer/gamma55.php#ge-55"> 80 <h3>September 2013</h3> 81 <img src="/shared/photos/rechnertechnik/leser617.jpg" alt="Lochkartenleser" width="241" height="149" /> 82 Success! The BULL GAMMA 55 is up and running! An historical moment. 83 </a></li> 84 85 </ul> 93 // print_newsfeed(); 94 ?> 95 </ul> 86 96 87 97 -
lib/host.php
r561 r649 49 49 /// This value is computed by setup(). 50 50 public $script_filename; 51 52 /// $slash_filename: Cross-platform $script_filename, always starting with a "/". 53 public $slash_filename; 51 54 52 55 /// $ressources: CSS and JavaScript file paths ("Assets"), as used by the RessourceLoader, … … 229 232 230 233 $this->script_filename = substr(realpath($_SERVER['SCRIPT_FILENAME']), strlen($this->document_root)); # e.g.: "/de/page.php" 234 235 # Bug when DOCUMENT_ROOT ends with trailing slash: make sure $file begins with /: 236 $this->slash_filename = $this->script_filename; 237 if($this->slash_filename{0} != '/') $this->slash_filename = '/'.$this->slash_filename; 231 238 232 239 // Windows realpath() converts Unix Paths ($_SERVER) to Windows Paths (like \en\index.php). -
lib/menu.php
r569 r649 73 73 require_once $this->conf['lib'].'/spyc.php'; 74 74 $data = Spyc::YAMLLoad($this->load_news_data()); 75 $fields = array(' titel', 'text', 'link', /*'bild'*/);75 $fields = array('datum', 'titel',/* 'untertitel', 'bild'*/); 76 76 77 77 $news_ul_content = ''; … … 80 80 function($a,$b){ return $a && $b;}, true)) { 81 81 $li = "<li><a href='#'>Fehler in Formatierung!<em>Dieser Menüeintrag ist falsch formatiert</em></a></li>"; 82 $this->log->WARN("<h5>Neuigkeiten-Menü: Fehler in Formatierung</h5><p>Ein Eintrag im Neuigkeiten-Menü ist falsch formatiert. ");82 $this->log->WARN("<h5>Neuigkeiten-Menü: Fehler in Formatierung</h5><p>Ein Eintrag im Neuigkeiten-Menü ist falsch formatiert. Ich erwarte zu jedem Menüeintrag die Felder ".implode(", ", $fields).". Eine der Angaben fehlt oder ist fehlerhaft formatiert: <pre>".var_export($e, true)."</pre>"); 83 83 } else { 84 $url = ($e['link']{0} == '#' ? $this->conf['lang_path'].'/'.self::news_file : '').$e['link']; 84 // Ehemals konnte die URL per "link: #August_2013" angegeben werden oder "link: /de/irgendwohin". 85 // $url = ($e['link']{0} == '#' ? $this->conf['lang_path'].'/'.self::news_file : '').$e['link']; 86 // Jetzt wird die URL automatisch aus dem Datum gebaut (slugify-artig) 87 $url = $this->conf['lang_path'].'/'.self::news_file.'#'.str_replace(' ', '_', $e['datum']); 85 88 if($host) 86 89 $url = $host->rewrite_link($url); 87 $li = "<li><a href='$url'>$e[titel]<span class='hidden'>: </span><em>$e[text]</em></a></li>"; 90 91 // optionales Feld: Untertitel 92 if(!isset($e['untertitel'])) $e['untertitel'] = ''; 93 94 // weiteres optionales Feld: Bildeinbindung 95 $img = !isset($e['bild']) ? '' : "<img src='$e[bild]' style='max-width:64px; max-height:64px;'>"; 96 $li = "<li><a href='$url'>$img$e[titel]<span class='hidden'>: </span><em>$e[untertitel]</em></a></li>"; 88 97 } 89 98 $news_ul_content .= "\t".$li."\n"; -
lib/messages.php
r585 r649 172 172 'js-interlang-notify-heading' => array("This page is also avaliable in English", "Diese Website gibt es auch auf Deutsch"), 173 173 'js-interlang-notify-text' => array("Do you want to switch to the English version <i>%s</i>?", "Möchtest du die deutschsprachige Seite <i>%s</i> lesen?"), 174 175 // RSS-feed, in /lib/news.php verwendet 176 'rss-title' => array('technikum29 Computer Museum - Was gibt es Neues?','technikum29 Computer Museum - What\'s new?'), 177 'rss-description' => array('Neuste Geräte und Erweiterungen im technikum29-Computermuseum', 'The latest devices and news from the technikum29 computer museum'), 178 'rss-copyright' => array('Heribert Müller und das technikum29-Team', 'Heribert Müller and the technikum29 team'), 179 174 180 ); 175 181 } -
lib/news.php
r644 r649 23 23 $required_fields = array('titel', 'text', 'link', /*'bild'*/); 24 24 25 # Hack, um die Sprache zu bekommen, von technikum29.php kopiert. 26 require "$lib/host.php"; 27 $host = t29Host::detect(); 28 $file = $host->slash_filename; # e.g.: "/de/page.php" 29 if(!isset($lang)) $lang = substr($file, 1, 2); 30 if(!in_array($lang, array('de','en'))) $lang = "de"; # check if language exists 31 32 require $lib.'/messages.php'; 33 $msg = new t29Messages($lang); 34 $p = $msg->get_shorthand_printer(); 35 25 36 # und hostname davor. 26 37 # $this->conf['lang_path'].'/'.self::news_file 27 $news_url = "http://www.technikum29.de/ de/news";38 $news_url = "http://www.technikum29.de/$lang/news"; 28 39 # if($host) $url = $host->rewrite_link($url); 29 40 … … 35 46 <rss 36 47 xmlns:atom="http://www.w3.org/2005/Atom" 37 xml:lang=" de-DE"48 xml:lang="<?php print $lang; ?>" 38 49 version="2.0"> 39 50 <channel> 40 <title> technikum29 Computer Museum - Was gibt es Neues?</title>51 <title><?php $p('rss-title'); ?></title> 41 52 <link>http://www.technikum29.de</link> 42 <description> Neuste Geräte und Erweiterungen im technikum29-Computermuseum</description>43 <language> de-DE</language>44 <copyright>℗ & © 20 33-<?=date('Y'); ?> Heribert Müller und das technikum29-Team</copyright>53 <description><?php $p('rss-description'); ?></description> 54 <language><?php print $lang; ?></language> 55 <copyright>℗ & © 2003-<?=date('Y'); ?> <?php $p('rss-copyright'); ?></copyright> 45 56 <pubDate><?=date('r', $pubdate); ?></pubDate> 46 57 <image> 47 <url>http://www.technikum29.de/shared/img-v6/banner. de.png</url>58 <url>http://www.technikum29.de/shared/img-v6/banner.<?php print $lang; ?>.png</url> 48 59 <title>technikum29 Computermuseum</title> 49 60 <link>http://www.technikum29.de/</link> … … 52 63 <!--<ttl><?=60*12; ?></ttl>--><!-- half a day --> 53 64 54 <atom:link href="http://www.technikum29.de/ de/news.php?format=rss" rel="self" type="application/rss+xml" />65 <atom:link href="http://www.technikum29.de/<?php print $lang; ?>/news.php?format=rss" rel="self" type="application/rss+xml" /> 55 66 56 67 <?php 57 68 foreach($data as $e) { 69 // Kompatibilitaet im August 2014, Uebergangsphase 70 if(!isset($e['text']) && isset($e['untertitel'])) $e['text'] = $e['untertitel']; 71 if(!isset($e['link']) && isset($e['datum'])) $e['link'] = $news_url.'#'.str_replace(' ', '_', $e['datum']); 72 58 73 if(!array_reduce(array_map(function($x) use ($required_fields,$e){ return isset($e[$x]); }, $required_fields), 59 74 function($a,$b){ return $a && $b;}, true)) { … … 61 76 <item> 62 77 <title>Fehlformatierung</title> 63 <description>Leider ist dieser Eintrag nicht richtig formatiert. Schauen Sie sich die News-Seite direkt an.</description> 78 <description><![CDATA[<html><body> 79 <b>Leider ist dieser Eintrag nicht richtig formatiert</b>. Schauen Sie sich die News-Seite direkt an. 80 <p><i>Details:</i></p> 81 Eines der Fehler Felder <?php print implode(", ", $required_fields); ?> fehlt. 82 Details: <pre><?php print var_dump($e); ?></pre> 83 </body></html>]]> 84 </description> 64 85 <link>http://www.technikum29.de/de/news</link> 65 86 </item> … … 69 90 <item> 70 91 <title><?=$e['titel']; ?></title> 71 <description><?=$e['text']; ?></description> 92 <description><?php 93 // if text contains tags like <em>, mark it as HTML 94 if(strpos($e['text'], '<') !== false) { print '<![CDATA[<html><body>'; } 95 print $e['text']; 96 if(strpos($e['text'], '<') !== false) { print '</body></html>]]>'; } ?> 97 </description> 72 98 <author>Heribert Müller</author> 73 99 <?php 74 $link = ($e['link']{0} == '#' ? $news_url : '').$e['link']; 100 if($e['link']{0} == '#') $link = $news_url . $e['link']; 101 else if($e['link']{0} == '/') $link = 'http://www.technikum29.de' . $e['link']; 102 else $link = $e['link']; 75 103 ?> 76 104 <link><?=$link; ?></link> … … 89 117 // rss ausgegeben, jetzt: exit um nicht noch Seite auszugeben. 90 118 exit(); 91 92 119 } else { 120 // bin eingebunden von news-Seite 93 121 require("$lib/technikum29.php"); 122 // wichtig: 94 123 return true; 95 124 } 125 -
lib/technikum29.php
r585 r649 27 27 require "$lib/host.php"; 28 28 $host = $external ? t29Host::create('t29ExternalHost') : t29Host::detect(); 29 30 $file = $host->script_filename; # e.g.: "/de/page.php" 31 # Bug when DOCUMENT_ROOT ends with trailing slash: make sure $file begins with /: 32 if($file{0} != '/') $file = "/$file"; 29 $file = $host->slash_filename; # e.g.: "/de/page.php" 33 30 34 31 // exactly define debugging behaviour -
lib/template.php
r618 r649 255 255 <link rel="copyright" href="<?php print $href($_('footer-legal-file')); ?>" title="<?php $p('footer-legal-link'); ?>"> 256 256 <link rel="search" type="application/opensearchdescription+xml" href="<?php print $href($_('topnav-search-page')); print '?action=opensearch-desc&lang='.$this->conf['lang']; ?>" title="<?php $p('opensearch-desc'); ?>"> 257 <link rel="alternate" type="application/rss+xml" href="/ de/news.php?format=rss" title="Neuigkeiten vom technikum29-Museum" />257 <link rel="alternate" type="application/rss+xml" href="/<?php print $this->conf['lang']; ?>/news.php?format=rss" title="<?php $p('rss-title'); ?>" /> 258 258 <?php 259 259 // print interlanguage links for all languages except the active one -
shared/css-v6/modules/11-header.css
r580 r649 137 137 float: left; 138 138 margin-right: 10px; 139 display: none; /* ausblenden*/139 /*display: none;*/ /* ausblenden */ /* warum ausblenden? */ 140 140 } 141 141
Note: See TracChangeset
for help on using the changeset viewer.