Offline Mode
Offline Mode
The HRDIODB code comes with a PHP script to generate "offline" pages. The
offline pages are exact duplicates of the "online" day and week views, but
they're static HTML instead of dynamic PHP. An HTML page is generated for
each UARS day and for each week consisting of UARS days. The day and week
pages are linked just like they are in the online mode, except the links
are to other static pages.
Written by Ziba R. Scott
and Adam D. Gorski
Table of Contents
Generating Offline Pages
To generate the offline pages, the generate_offline.php script
should be run at the command line. The files it generates will be saved
in the directory specified by the $offline_prefix
variable in conf.php. If the directory doesn't
already exist, the script will try to generate it. If it fails to do so,
the directory should be created by hand. To run the script, simply type
in the following:
php generate_offline.php
Page Generation Procedure
The script performs the following operations to generate the
content:
- Contacts the database to get a list of UARS days.
- For each UARS day, calls day.php and redirects the
output to
day_X.html, where X is the UARS day.
- While in the same loop iteration as above, checks to see
if the week for the given UARS day is already created. If it is, it
does nothing. If it isn't, it calls week.php and redirects the
output to
week_Y.html, where Y is the week number
starting at 0.
- Once all the HTML files are generated, the script will create
a very basic
index.html. The page will provide a link
to and try to redirect to the last UARS week page. This is meant to
reproduce the default page redirect for the online version of the code.
- Next, the script will attempt to copy over the CSS files and
the domTT library in order to preserve the look of the pages and the
popup definitions.
The script attempts to print out meaningful error messages and handle
runtime errors gracefully. If it fails to do so, inspecting the code should
lead to resolving the problem.