   Template HowTo

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


At first, I have to beg a bit:

Please do not remove the link to my homepage from the templates. You
can move it to whereever you want, change its size and color, or
anything else you don't like about it, but please don't remove it
completely. The few visitors that I get from this link are everything
I get for coding this module, so please be fair.



A template contains the html code for the webpages. Additionally,
there are special tags which get replaced by dynamic data. To create
a new design, just start your favourite html editor (textpad is the
best!), and create the webpages how you like them. When you're done,
just replace every part that contains dynamic data (seen results,
for example) with one of the tags from the list below.

The syntax of the tags is quiet simple: <?tag?> (no, this is
_not_ PHP ^_^) Some tags have parameters, then the syntax is
<?tag param?>.


Here's a list of available tags:

- simple tags

<?module_version?>
  the version of this module (surprise!)

<?server_version?>
  version of the http-server

<?server_port?>
  port on which the server is waiting for incoming connections
  
<?url?>
  the URL of the current webpage

<?template template_name?>
  sends the template specified as parameter
  I use this command for creating modular templates. It's usefull to
  store parts that are used in several places in an extra template
  to keep the template simple.

- tags for color fading
  (used for creating nice looking seen-result tables)

<?init_colorfade start-color end-color [steps]?>
  initiates a color fade from the start-color to the end-color
  The color gets faded in [steps] steps. If [steps] isn't supplied,
  the number of seen-results will be used.
  (this command doesn't create any output)

<?fade_color?>
  lets the color fade one step further
  (this command doesn't create any output)

<?fcolor?>
  outputs the actual color

- language- and skin-lists

<?langlist ...?>
  cycles through the list of languages and outputs the parameters one
  time for each listable language. Parameters may contain html code
  and template-tags.  The language-list is generated by the tcl-command
  "add_webseen_desc lang short-name [description]"
  
<?skinlist ...?>
  same as <?langlist ...?>, but for skins

<?name?>
  outputs the short-name of the language/skin

<?description?>
  outputs the description of the language/skin

<?ifactivelang ...?>
  if the current language in the langlist-cycle is the active language
  (which is used to display the current webpage), then the parameters
  (which may include tags) are displayed. If not, nothing is displayed.

<?ifactiveskin ...?>
  same as <?ifactivelang ...?>, but for skins
  
- tags for seen results

<?ifonchan ...?>
  if the nick who is shown as first result is still on the channel,
  then the parameters are displayed
  (Note: This works only for the _first_ result and does not need
  to be within in the result-cycle)

<?numresults?>
  number of results
  
<?results ...?>
  cycles through the list of results and outputs the parameters for
  each result. Parameter may (and should) include more commands.
  
<?nick?>
  the nickname of the current result

<?host?>
  nick's hostname.
  
<?ago?>
  time that has passed since nick was seen

<?when format?>
  the time when nick was seen
  the format of the time is specified by the parameter. See
  "man strftime" for details on time formats.

<?log?>
  log-entry of nick's last appearance
  (This is not a real log entry, but a string that looks like a log.
  The string is defined in the langfiles.)

- misc tags

<?seenerror?>
  contains the error message if the search failed
  (defined in the langfile)

<?query?>
  the search-string

<?numseens?>
  total number of datasets in the database

<?searchtime?>
  processing-time which was used by the search

<?total_queries?>
  total number of queries which were processed since the last
  restart of the bot

<?total_searchtime?>
  total processing-time used by all queries

<?average_searchtime?>
  average searchtime per query


A complete skin needs at least 5 templates:

- 404
  Error message for invalid URL requests
- error
  Error message if the search resulted in an error
- root
  Template for the server root
- results
  Template for the results-page
- noresults
  Template for the page that is sent if there weren't any results.
  
The last step is to create a config file for your new skin.

Just load every template with the command load_webseen_template:
load_webseen_template <templatename> <templatepath> <skin> <lang>

I suggest to use the variable ${webseen-template-dir} in the
template-path, so that the user can easily choose where to
store the templates.

If you used the tags <?langlist?> or <?skinlist?>, you should
also call the command "add_webseen_desc skin <shortname> <longname>"
or "add_webseen_desc lang <shortname> <longname>" to add your
skin/language to the list.

I hope this HowTo was understandable. If you have still any
questions, take a look at the example skins that came with
this module or send me an email.