free software page


"twocolist"

 

twocolist
see full-sized screenshot of twocolist
screenshot
twocolist ("Two Column List") is a free program, written in php, that will accept any text file as input and display it in two sorted columns across the web page.

 

twocolist overview
the program will display each line ("record") as a separate entry, and will index ("hyperlink") each line based on its first character, in alphabetical format. to better clarify this, an example is in order as follows:

this file will be formatted by twocolist as this. the same list can then be formatted in bold like this.

the actual url used in the last example is:
 http://www.cashen.com/software/twocolist.php?fname=example.fl&format=b

 

version history

version comments
1.0
  • initial release
1.1
04/02/2003
  • added sorting of entries
  • added "stripTags" parameter. if stripTags=T is used, html tags will be removed from the input file. this is useful to improve formatting of html files
  • reordered "format" display to be more effective in formatting output
  • improved indexing logic (used to provide the top table of alphabetic links to the entries)
  • eliminated display of blank records

1.2
04/11/2003

  • added "exclude" and "only" options to allow twocolist to exclude the listing of records that contain strings or chars you specify, or to "only" list those records that match the provided strings/chars
  • fixed some horrid open-html tag bugs (body, html, a href)
  • "stripTags" now works without the "=T" option, and is case-insensitive (e.g., "striptags")
  • fixed potential bug in sorting that would produce a php warning if the displayed records were 0 (no records in the file, or the exclude or only options filtered all records away)
  • "prettied up" the tables a bit
  • September 2005
    • added tar.gz download for UN*X users
    • fixed example problem on this page
    • NO twocolist.php v1.2 code changes
1.4
04/15/2008
  • modified to address the (surprise to me!) mandated change in PHP 4.1 (and later) to deprecate the method I used to pass variables, such as the "fname" parameter. this fix is to address that. this change simply "broke the code" (always a bad platform choice) on platforms that updated the the latest PHP release, as they're apt to do
  • also, added a "recLimit" variable in the code to limit the number of records twocolist will process before displaying the final output. added this to allow you to prevent passing very large files to be processed; this could eat up bandwidth, processing time, etc. this can be set to any limit you choose, or can be turned off if you don't want to limit input

download

the current version of twocolist (v1.4, 04/15/2008) can be downloaded here:

author contact

report any bugs or send comments to Dean Cashen

twocolist installation

after downloading, simply install twocolist.php on your web hosting server in any directory you choose. the webserver must have php installed and working, of course, for twocolist to run. the program can then be invoked in its most simple form as follows:

http://www.yourwebsite/somedir/twcolist.php?fname=file_to_display

See the following syntax/usage details for an explanation of the options available in twocolist.

twocolist syntax

twocolist.php?option&option...:

the "fname" parameter is required, all others are optional
"fname" parameter
the fname is a required parameter and is the name of the file to be formatted by twocolist. (omitting this option displays a usage screen). the filename can be a local reference (e.g., "../pub/mylist.txt") or an absolute url such as "http://www.someurl.com/pub/mylist.txt".

"format" options
any valid (or invalid) html tag, such as:

  • u - underline
  • b - bold
  • i - italicize
  • blockquote - indent the text
  • cite - format as a citation
  • etc. - any tag can be added, there is no type-checking performed.
          please note: some care should be taken, therefore, since certain tags will
         compromise the display output (e.g., "td" will create unwanted table data cells)
  • "link" option

    the link option will add a hyperlink to each displayed record, for those cases where you want to link the output listing to files located somewhere on the net. the specified link will simply be prepended to the listed filename, example: "http://someurl.com/file". if you are hosting files on a server you can then create the file list and have the files listed and linked using twocolist. this is handy if you, for example, house files "pic1.jpg, pic2.jpg..." on a server and want twocolist to generate a linked list to them. (e.g., if you store these files in a directory "pub" on "http://someurl.com" the link will then be "http://someurl.com/pub/pic1.jpg," etc.)

    "exclude & only" options

    the exclude and only options operate similarly. exclude will allow you to exclude the display of any records that contain the passed strings, separated by commas (e.g., "exclude=e,A" will cause twocolist to suppress displaying any text lines that contain either "e" or "A" (case-sensitive). So "Angels.mp3" will not be displayed (both A and e exist in the record), but "Boring song.mp3" would be displayed). Likewise, "only" will only display records that contain the passed strings (e.g., "only=mp3" would only display records that contained the string "mp3"). The two options can be used in conjunction to allow "fine-tuning" of the output display.

    "stripTags" option

    the "stripTags" option will remove html tags from the input file. this is useful when displaying .html files. without this option the file will still be displayed, however any embedded html tags will confuse the display output since the browser will try to process them

    examples:

    twocolist.php?fname=myMp3s.txt&format=b&link=http://somewebpage.com/mymp3s

    the above example will:
    - open and display the filename "myMp3s.txt"
    - display the list in bold font ("format=b")
    - link each file to a directory located at "http://somewebpage.com/mymp3s"

    bugs and limitations

    yes, this program has bugs. I haven't found many yet, but it's version 1.2, and without a lot of testing (by users like you), I can't be sure it won't fail in ways I haven't yet seen. that's where you can help out, let me know when you find something wrong with it, or if you have suggestions for general improvements and features.

    other limitations or areas of improvement:

    free software, conditions and disclaimer

    this program is provided to you as free software. you are allowed to modify it as needed, however I would ask that you leave the footer identifying me (Dean Cashen) as the original author. also, by using the software you understand that this is provided "as is", with no warranty of any kind, and you further agree not to hold me liable in any way related to the use or operation of this program. that should be simple enough, right? you can do what you like with the program, but if it doesn't work as you'd like, or causes you any problems, don't blame me!

    report any bugs or send comments to Dean Cashen
    page count: