## ## PictureInTable.wc ## ## This is a simple test page and documentation for the ## PictureInTable.lc file. ## #localcode PictureInTable.lc
Here is what I have so far. It is (somewhat sparely) documented in the comments. The following are defined sub PictureInTable # () Insert a photo into a table. sub PictureInline # () Insert a photo inline. sub TextInTable # () Insert text into a table. sub LinkInTable # () Insert a link into a table. sub LinkInline # () Insert a link inline. sub AnchorInline # () Insert an anchor. I'm offering these to the contributed library.
PictureInTable generates HTML to include a thumbnail picture into a table entry. The thumbnail is the handle to a URL pointer to the full size picture.
TextInTable is a companion function to include text into a table entry. TextInTable is pretty trivial, but is included so that text and picture table entries are handled equivalently.
If a source picture exists for the picture to be included, the included picture will be created if one of two conditions is met: the source is newer, or the included doesn't exist.
The source picture must exist in a subdirectory of "PicSrcLink" relative to where the included picture exists. It is intended that "PicSrcLink" be a symlink to the actual source directory. This way the sources can be very large. And a tar of the web site will get only what the viewer wants. In place of the the large directory of source pictures, there will just be the symlinks.
The thumbnail will be created if the included picture is newer or if the thumbnail doesn't exist.
The picture type of the included picture and the thumbnail is defined by the macro "PictureInTableIncludeType". The picture typeof the source picture is defined by the macro "PictureInTableSourceType". The thumbnail size is defined by the macro "PictureInTableThmbSize". Default values are stored in /usr/local/lib/webc/include/PictureInTable.wh
################################################################### ## After the following declarations: ################################################################### ## #localcode PictureInTable.lc ## #callable PictureInTable
################################################################### ## Example: the source code listed here: ################################################################### ##
################################################################### ## Generates the following HTML: ################################################################### ##
##
##
##
## |
##
## ## Mark visited me from New Mexico in April of 1998. This was the first time he actually saw Rex. ## ## |
##
################################################################### ## Requirements: ################################################################### ## The parameter list to PictureInTable MUST be on ONE line. ## Parameters MUST be separated by commas. ## Quotes are recommended around all parameters.
################################################################### ## Input Parameters: ################################################################### ## Two variables are passed to this program to accomplish this: ## $picturename In the example above this is "AB_MY_Rex98". ## $alternate This is "Allen Brown and Mark Yule riding Rex".
################################################################### ## To Do List: ################################################################### ## Several features will be desirable in this program (some day). ## Reformat $commentary. ## Allow $alternate to be optional. ## Show picture size in the HTML document.
################################################################### ## Derived Variables ################################################################### ## source = $picturename ~= s%/%/PicSrcLink/% ~= s%$%.tif% ## included image = $picturename . ".jpg" ## thumbnail = $picturename . "_tn.jpg"