Using config

The config command controls output formatting and the random number variable.

The resutls of config last for the lifetime of the request, and do not affect any other subsequent or concurrent requests.

Items that can be set by config

  • sizefmt The value sets the format used to display the size of a file.
  • timefmt Formats the output of dates.
  • logfmt This lets you control formatting of log files.
  • random This stores a random number in the RANDOM variable.
  • dir_domain Sets the domain used by the dir_list command.
  • dir_port Sets the port number used by the dir_list command.
  • dir_sort Sets the sort field used by the dir_list command.
  • topic_num_to_list_default Sets the default number of messages to display.

 


 

sizefmt

The value sets the format used to display the size of a file. Valid values are bytes for a count in "bytes", or "abbrev" for a count in Kb or Mb as appropriate. The default is in abbreviated format. See also #fsize.

 

Example usage

<!-- #config sizefmt="bytes" -->

 


timefmt

Formats the output of dates. The value is a string to be used by the ANSI C strftime library routine when printing dates. The default format string is "%a, %B %d, %Y %I:%M %p". See also #flastmod, #echo DATE_LOCAL, #echo LAST_MODIFIED.

 

Format string parameters

%a - abbreviated weekday name

%A - full weekday name

%b - abbreviated month name

%B - full month name

%c - date and time in the form Mon Apr 15 13:25:31 1996

%d - day of the month as a number ( 01-31 ).

%H - hour as a number ( 00-23 , uses 24 hour clock )

%I - hour as a number ( 00-12 , uses 12 hour clock ) (uppercase i)

%j - day of the year as a number ( 001-366 )

%m - month as a number ( 01-12 )

%M - minute as a number ( 00-59 )

%p - AM/PM designation for a 12 hour clock

%S - second as a number ( 00-59 )

%U - week number of the year ( with Sunday as the first day of the first week ) as a number ( 00-53 )

%w - weekday as a number ( 0 (Sunday) - 6 ( Saturday ) )

%W - week number of the year ( with Monday as the first day of the first week ) as a number ( 00-53 )

%x - date the form Apr 15 1996

%X - time in the form 1:32:03.

%y - year without the century ( 00-99 )

%Y - year with the century as in 1999.

%Z - current time zone ( if available )

%% - prints %.

 

Example usage

<!-- #config timefmt="%b %d, %Y" -->

 

Creates time and date output like:

Jan 1, 1999

 


logfmt

This lets you control formatting of log file entries created with TeleFinder's scripting. Valid parameters are nosep and tabsep.

The default is tabsep, which produces the standard tab delimited log files.

 

Example

<!-- #config logfmt="nosep" -->

 

Using the nosep option lets you create free form data in a log file; entries are not separated by Tabs, and lines are not terminated with "Returns." The nosep option is useful when creating HTML, or otherwise specifically formatted output in a log file.


 

random

This stores a random number in the RANDOM variable (see the echo command). Valid parameters are numeric lower and upper bounds. The lower bound is zero by default. All random numbers are nonnegative integers.

 

The default value is zero.

 

Examples

<!-- #config random="20" -->

produces a number less than 20

 

<!-- #config random="10" "20" -->

produces a number between 10 and 19


 

dir_domain

The dir_domain can be set so that the dir_list command will produce requests directed to a server other than the one generating the page. This specifically affects output generated by the FILEHREF passed to the dir_list command.

By default, dir_domain is empty, and "dir_list" links will point to the serving computer.

 

Example

<!-- #config dir_domain="bbs.spiderisland.com" -->

 

Produces links specifying "bbs.spiderisland.com"

http://bbs.spiderisland.com/Public%20Files/Macintosh/


 

dir_port

The dir_port can be set so that the dir_list command will produce requests directed to a different TCP-IP than the one receiving the request to generate the page.

This specifically affects output generated by the FILEHREF passed to the dir_list command.

By default, dir_port is empty, and "dir_list" links will point to the same port as the request was received on.

 

Example

<!-- #config dir_port="8080" -->

Causes dir_list to produce links specifying Port 8080 like:

http://www.spiderisland.com:8080/Public%20Files/Macintosh/

 


dir_sort

The dir_sort can be set so that the dir_list command will sort the directory listingby Name, Date, or Size. Name is the default sort field.

 

Example

<!-- #config dir_sort="name" -->

Produces output sorted in ascending order by name.

Sorting by "size" produces output in descending order by file size. Sorting by "date" produces output in descending order by file modified date.

 


topic_num_to_list_default

The topic_num_to_list_default can be set to modify the number of messages displayed by the topic_list_msg command. The default is 10 messages per page.

 

Example

<!-- #config topic_num_to_list_default ="5" -->

Produces five messages listed per page.