source: t29-www/en/news.php @ 664

Last change on this file since 664 was 649, checked in by sven, 10 years ago

RSS-Feed-Probebetrieb ausgeweitet: Internationalisiert, fuer englische Version gibts jetzt auch einen RSS-Feed.

Insbesondere ist in auf englischen Newsseite jetzt testweise ein alternatives Format zum Deutschen geschaltet, auf welches das Deutsche dann auch umgeschaltet werden soll. Es bedarf weniger Pflege und generiert gleichzeitig die Newsseite, das Newsmenü und den abonnierbaren News-Feed. Wenn sich das Format bewährt, kann die deutsche Newsseite darauf auch umgestellt werden.

Ferner wurden die RSS-Feeds auf den News-Seiten textuell erwähnt. Testweise werden auch im englischen Menü wieder Vorschaubilder (Thumbnails) bei den Neuigkeiten eingeblendet, die allerdings derzeit nur auf max 64x64px verkleinerte Einblendungen der entsprechenden News-Bilder sind. Hierfür fehlt noch eine sinnvollere Methode.

  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1<?php
2        $seiten_id = 'news';
3        $version = '$Id: news.php 649 2014-08-28 13:40:34Z sven $';
4        $titel = "What's new?";
5        $menu_version = 2;
6
7        $neues_menu = <<< MENU
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
45
46MENU;
47// ende der menue-Eintraege
48
49        if(!require("../lib/news.php")) return;
50?>
51
52<h2>What's new?</h2>
53
54    <p>This is a news feed for the recent changes on our homepage. The latest
55       posts are on top.</p>
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
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');
74
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//}
91
92
93//       print_newsfeed();
94?>
95</ul>
96
97
98
Note: See TracBrowser for help on using the repository browser.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License