You can display the system notices on your web page either by subscribing to it as an RSS feed, subscribing to it as an HTML feed, or by displaying it using an include in your USD template-based web page.
The following categories are available for display.
admissions, business, cas, coding, critical, facultylog, forums, home, labs, law, mail, mailman, massmail, mysql, network, peacestudies, schedules, searches, social-networking, soles, sqlite, usd-sites, virus, web, websupport
labs: The Macintosh lab workstations all bring up the same page on opening a new browser window; notices in this category will be displayed on that page.
Include notices in your template
The easiest way to incude system notices on your USD web page is to use the system notices include. Your page must be a PHP page (all template-based pages are). Add the following three lines where you want the system notices to appear:
<? include('/web/includes/notices.phpi'); $notices = new ITS_notices(); $notices->category('critical'); $notices->display(); ?>
This would display all critical notices. If you want more than one category, you can use $notices->categories() multiple times:
<? include('/web/includes/notices.phpi'); $notices = new ITS_notices(); $notices->category('critical'); $notices->category('web'); $notices->category('network'); $notices->display(); ?>
And that’s it. You may wish to adjust the style sheets, but that’s all you need to do to display system notices on your page.
Age and limit
By default, system notices will be displayed from the past four days, up to a maximum of four notices. If you wish to change this, you can. Use “$notices->age(x)” to display notices from within the last “x” days. Use “$notices->maximum(x)” to limit the number of notices to “x”. For example, to display network notices from the last 30 days, limited to no more than 20 notices:
<? include('/web/includes/notices.phpi'); $notices = new ITS_notices(); $notices->category('network'); $notices->age(30); $notices->maximum(20); $notices->display(); ?>
You can turn off age or maximum limits with “$notices->age()” and “$notices->maximum()”.
If you have a web page on a server other than www.sandiego.edu, you can display system notices using either the HTML or RSS feed. If you have RSS code already available, that’s probably the easiest way to display the notices: just point your RSS feed code towards http://www.sandiego.edu/webdev/notices/rss.php.
If you don’t have an RSS aggregator for your page, but you are programming in PHP or some other language that lets you include other web sites, you can use our HTML feed. This will be much more limited. Include the web page http://www.sandiego.edu/webdev/notices/html.php.
By default, it will include all categories of notices. You can add “?kind=CATEGORY” to limit to one specific category. For example, on the lists.sandiego.edu default page, I include mailman notices with:
<? readfile('http://www.sandiego.edu/webdev/notices/html.php?kind=mailman'); ?>
The HTML feed will display up to four notices within the last six days.
Both the include and the HTML feed provide specific styles for the underlying HTML.
- The entire set of system notices is included in a “div” with the class “warning”.
- Each notice is included in a “div” with the class “warnitem”.
- Each notice’s title is an “h3” with the class “warntitle”.
- Each notice’s main text is inside of a “div” with the class “warntext”.
- Inside the “warntext” is a ‘div” of class “warnposter” and the MySanDiego account of the person who posted the notice.
- Following the list of notices is a paragraph (“p”) of class “moreinfo” that links to the main system notices page.
You can modify any of these styles to change the display of that information, or hide it altogether.