Jump to main content
University Computer Centre
Extension Modules for websites
<?php

# Display of "University News" articles from the Press Office
require_once('tu/inc/uni_aktuell.inc');

# max. 8 english articles with label 'Informatik' or 'Schüler',
# plus articles with ID 4567, younger than 60 days
echo uni_aktuell(array('Informatik''Schüler'4567'Englisch!'), 860,
                 array('link' => 'popup''level' => 3));

/*
$html = uni_aktuell(array('label1' [,'label2', ...]), number, max_age [, array(style, ...)]);
  Labels are tags or IDs of articles (all following labels are only available in german)
   tags:
     Departments: Naturwissenschaften, Mathematik, Maschinenbau,
               Elektrotechnik und Informationstechnik, Informatik,
               Wirtschaftswissenschaften, Philosophische Fakultät,
               Human- und Sozialwissenschaften, Universitätsrechenzentrum,
               Universitätsbibliothek, Zentrum für Lehrerbildung, MERGE,
               MAIN, Zentrum für Sport und Gesundheitsförderung
    or
     target groups: Absolventen, Bau, Chemnitz, Corona, Familie, Forschung,
                  Freunde, Historie, International, Kulturhauptstadt,
                  Schüler, Studentenwerk, Studieninteressierte,
                  Studierende, Transfer, Weiterbildung, Wirtschaft

   Multiple labels: array('Mathematik', 'Forschung')
     = Mathematik OR Forschung

   Exclude individual articles with -ID: array('MAIN', -10888)
     = MAIN, but not article 10888

   Retrieve English articles: Use tag 'Englisch!', e.g.
     array('Elektrotechnik und Informationstechnik', 'Englisch!')

   number = maximum number of articles  displayed (default 10)
   max_age = articles that are less than n days old (365 by default)
     = articles with an expiry date are only displayed until this date

   style = How to display?
     array(
       'link' => 'popup'  - article content is displayed in a pop-up,
                            no jump to the press office page
       'level' => 3       - number from 2 to 6, which heading is used for
                            the article titles: h2 to h6
                            (default h2) → must fit into your
                            page structure, so that the headline
                            hierarchy is correct (accessibility)
     )

  Multiple calls possible, e.g:
    require_once('tu/inc/uni_aktuell.inc');
    if ($uni_aktuell = uni_aktuell(array('Maschinenbau'), 4, 14)) {
        echo '<h1>News</h1>' . $uni_aktuell;
    } else {    // None available → 2 default articles
        echo '<h1>News best-of</h1>' . uni_aktuell(array(1234, 1789));
    }
*/
?>

Show output with this program code