topdisp.cgi

See the other CGIs Japanese Page


Functions
    Display any information on your top page
  • Display update information, event, notice and so on using SSI.
  • Data file edit page
  • Multiple items can be set in a file
  • Data file can be updated on your browser

Installation

  1. Put topdisp.cgi and cgi-lib.pl into a CGI executable directory.
  2. If necessary, download the sample of a data file as topdisp.dat and put it in the directory where you put topdisp.cgi. If you create it from scrach, this step is not necessary.
  3. Modify the Perl path of the first line of the topdisp.cgi to match your server environment.
  4. Modify permission of topdisp.cgi properly.
  5. Open topdisp.cgi on your browser
  6. Enter admin password
  7. If you do not have a data file, click the link to "Create a data file". If you have it, edit it by "edit=on". See sample page below.
  8. Create a parent page as .shtml file which is SSI executable. Put topdisp.cgi into the HTML file. See sample page.
  9. Open the .shtml file. topdisp.cgi will work.
Operation
Invoke from SSI.

 <!--#include virtual="topdisp.cgi?mode=[event|notice|update|admin]" -->

makes it work.
The parameter of mode can be anything as long as it matchs the first column of the data file.

e.g.:mode=event, mode=special
Each line displays with encircled by<li>.

 Format of data file
 type, attribute, contents, date
   Type : Will be set by mode in the CGI parameter.
     event  : event
     notice : notice
     update : update notice
     admin  : admin message
     and so on....
   attribute : vine
     v : Display
     i : Do not display
     n : Do not display any time(Will not be displayed even in full display mode)
     e : End parse(ignored with display=all)
         Use this attribute if you want the CGI to terminate file parse at 'e' is present. The CGI does not parse below the 'e'.

 If you want to put in the data file, Use "&#44;".
 Comment is a #.

 Data file example
 -------------------------------
# notice
notice,v,No Announcement so far.
notice,e

# Updates
update,v,The mail address has been udpated,7/30/04
update,v,Renewal!,7/3/04
update,e
update,i,Updated the address book,6/20/04
update,i,Updated1&#44;2&#44;3 in the mail address,6/18/04
update,i,A new message board has been installed,6/10/04

# Event
event,v,We have a meeting on 15th.,8/1/04
event,n,No events now.

---------------------------------

 Edit mode
 Invoked by topdisp.cgi?edit=on.
 You can simply edit and press "update".
 You can also specify data file name.

 
 Full display mode
 topdisp.cgi?mode=<[event|notice|update|admin]>&display=all
 Display all contents of the specified mode.
 'v' and 'i' in attribute will be ignored. 'n' will not be displayed.
 This mode should be used from usual CGI from a browser.
Sample and Source
    Sample
    topdisp.cgi Sample of data file cgi-lib.pl


Revisoin history
  • 12/29/05 : Fixed & handling for firefox 1.5.
  • 9/4/05 : Deleted jcode.pl
  • 4/24/05 : Modified & processing
  • 12/17/04 : Added processing for &
  • 12/2/04 : Deleted + space conversion
  • 8/28/04 : Added e
  • 8/14/04 : Added data file edit mode
  • 8/8/04 : Initial revision