File: README

package info (click to toggle)
nms-countdown 1.17-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 56 kB
  • ctags: 3
  • sloc: perl: 110; makefile: 34
file content (126 lines) | stat: -rw-r--r-- 5,129 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
COPYRIGHT

Countdown Version 1.00
Copyright 2001 London Perl Mongers, All rights reserved

LICENSE

This script is free software; you are free to redistibute it
and/or modify it under the same terms as Perl itself.

URL

The most up to date version of this script is available from the nms
script archive at  <http://nms-cgi.sourceforge.net/>

SUMMARY

Countdown is a script which allows you to display the amount of time left
to a given date and time.

FILES

In this distribution, you will find four files:

countdown.pl   - The main Perl script
README         - This file. Instructions on how to install and use countdown
countdown.html - A sample HTML document demonstrating how to use countdown
MANIFEST       - List of files

CONFIGURATION

There are a number of variables that you can change in countdown.pl which
alter the way that the program works.

@from_date          - This defines the date that you are counting down to.
                      It should be a list of six items, representing the
                      year, month, date, hour, minute and second of the
                      target date. For example, if you're counting down
                      to 7th September 2002, the value would be
                      (2002,9,7,0,0,0).
                      If you put the value 'XX' in any of the fields then
                      that field will not be included in the output.

$delimiter          - The value that you want to put between the different
                      parts of the output. The default is an HTML <br />
                      tag whihc puts the parts on different lines.

$date_fmt           - The format that the date will be displayed in. This
                      is a string that contains a number of different 'tags'.
                      Each tag consists of a % character followed by a letter.
                      Each tag represents one way of displaying a particular
                      part of the date or time. Here are some common tags:

                      %Y - four digit year (2002)
                      %y - two digit year (02)
                      %m - month of the year (01 to 12)
                      %b - short month name (Jan to Dec)
                      %B - long month name (January to December)
                      %d - day of the month (01 to 31)
                      %a - short day name (Sun to Sat)
                      %A - long day name (Sunday to Saturday)
                      %H - hour in 24 hour clock (00 to 23)
                      %I - hour in 12 hour clock (01 to 12)
                      %p - AM or PM
                      %M - minutes (00 to 59)
                      %S - seconds (00 to 59)

$DEBUGGING          - This should be set to 1 whilst you are installing 
                      and testing the script. Once the script is live you
                      should change it to 0. When set to 1, errors will
                      be output to the browser. This is a security risk and
                      should not be used when the script is live.

$emulate_matts_code - When this variable is set to a true value (e.g. 1)
                      countdown will work in exactly the same way as its
                      counterpart at Matt's Script Archive. If it is set
                      to a false value (e.g. 0) then more advanced features
                      are switched on.

INSTALLATION

Countdown is installed simply by copying the file countdown.pl into your
cgi-bin directory. If you don't know where your cgi-bin directory is, then
please ask your system administrator.

You may need to rename countdown.pl to countdown.cgi. Again, your system
administrator will know if this is the case.

You will probably need to turn on execute permissions to the file. You can
do this by running the command "chmod +x countdown.pl" from your command
line. If you don't have command line access to your web server then there
will probably be an equivalent function in your file transfer program.

Countdown can work in two modes. You can either set it to always return
a countdown from the same date or you can use a different date each time
the script is called. To use the same date, simply set the @from_date
variable in the script (as described above). To use a different date each
time you need to pass a variable into the script as described below.

If you've set the @from_date in the script, then you can simply link to
the script like this:

     <a href="http://your.domain/cgi-bin/countdown.pl">
         Countdown to my birthday
     </a>

If you pass in a value then this will override whatever is in @from_date

     <a href="http://your.domain/cgi-bin/countdown.pl?2002,9,7,0,0,0">
         Countdown to my birthday
     </a>

You can even prompt the user to input their own date with an HTML form:

    <form action="http://your.domain/cgi-bin/countdown.pl">
      <input type="text" name="date"/><br />
      Enter your date in the format yyyy,mm,dd,hh,mm,ss<br />
      <input type="submit" />
    </form>

SUPPORT

For support of this script please email:

  <nms-cgi-support@lists.sourceforge.net>