rejetto forum

a Guide

Guest · 4 · 3489

0 Members and 1 Guest are viewing this topic.

GeeS

  • Guest
Maverick wrote:
Quote
Is there a list somewhere that shows all of the valid template symbols?

Here is my list (updated up to version 34):

Template help (HFS 2.0 Beta 34) Under construction!

HFS builds HTML pages dynamically from the template hfs.tpl in the hfs.exe folder. If it does not exist, the default template inside hfs.exe will be used.
A template is divided in sections. Each section describes a part of the final HTML page which will be served. The template should provide all sections for correct working of the generated HTML. A section usually contains HTML code. Since the final HTML page is built dynamically, symbols have to be used to get valid output. Symbols are surrounded by %percent% characters and define the corresponding sections. A section is labelled using [square brackets]. Symbols will be translated with right values at run-time. Some symbols return a string for the current variable, while others only get activated if a certain condition is met. Besides symbols, also some defined command line operators can call sections to generate HTML for output.  
In the main section, which is unlabeled, and in all other sections, symbols and command line operators can be used to control the HTML output. Some symbols are limited to a specific section. Some symbols will produce the HTML from the corresponding sections, while others just return the corresponding actual string or value.
The best way to build a template is to edit an existing template.


Symbols list - by section

Symbols available in all sections:

%style%   inserts HTML from [style]

%login-link%   inserts HTML from [login-link] if no user is logged in, void otherwise
%loggedin%   inserts HTML from [loggedin] if a user is logged in, void otherwise

%user%   returns the name of the authenticated user, void if no user is logged in
%version%   returns the HFS version number
%timestamp%   returns the value for the date and time of the server (format is defined by OS settings)
%uptime%   returns the value for how long HFS has been running without quitting
%connections%   returns the value for the number of connections to HFS
%speed-out%   returns the value for the current outbound throughput
%speed-in%   returns the value for the current inbound throughput
%total-out%   returns the value for the total amount of bytes sent
%total-in%   returns the value for total amount the of bytes received


Symbols available in the main section:
%up%   inserts HTML from [up] if the current folder is not the root, void otherwise
%upload-link%   inserts HTML from [upload-link] if upload is activated in the current folder, void otherwise

%host%   returns the Host http header field, as sent by the browser
%number%   returns the value for the number of items in the current folder
%number-folders%   returns the value for the number of folders in the current folder
%number-files%   returns the value for the number of files in the current folder
%total-size%   returns the smart value for the amount of space occupied by items in the current folder
%total-kbytes%   “ as %total-size% but expressed in kilobytes
%total-bytes%   “ as %total-size% but expressed in bytes
%build-time%   returns the value for how long it took to generate the page
   
%files%   inserts HTML from [files] if at least one item is present in the current folder,
   inserts HTML from [nofiles] otherwise


Symbols available in [files]
%list%   the full list of items in the current folder, got by gluing
   each item after the pertinent section ([folder], [file] or
   [link]) was inserted.

Symbols available in [file] [folder] [link]
%new%   inserts HTML from [new] if the file is marked as new, void otherwise
%comment%   inserts HTML from [comment] if a comment is available for the item, void otherwise

%item-url%   returns the value for the path to get the item
%item-name%   returns the value for the label of the item
%item-added%   returns the value for date and time when the item was added to the VFS
   (Format is defined by OS settings)

Symbols available in [file] [folder]
%item-dl-count%   returns the value for the download counter (virtual folders totalize inner counters)
%item-modified%   returns the value for the modification time as reported by file or folder
   (The format is defined by OS settings)

Symbols available in [file]
%item-size%   returns the value for the amount of space occupied by the item
%item-size-b%   as %item-size% but expressed in bytes
%item-size-kb%   as %item-size% but expressed in kilobytes

Symbols available in [upload] [upload+progress] [upload-results] and main section
%diskfree%      returns the value for the total amount of available space in the drive containing the current folder (makes sense only for real folders)
%folder%   returns the value for the path to the current folder
%encoded-folder%   returns the value for the encoded path to the current folder
%parent-folder%   returns the value for the encoded path to the parent folder
%folder-comment%      inserts HTML from [folder-comment] if a comment is available for the current folder, void otherwise

Symbols available in [error-page]
%content%      inserts HTML from [ban], [deny], [not found], [unauthorized] or [overload],
   depending on the error

Symbols available in [ban]
%reason%   returns value for the ban description from the hfs.ini

Symbols available in [progress]
%progress-files%   inserts HTML from [progress-nofiles] if no file is transferred with the current client,
   otherwise the list of transferring files got by gluing each file after the pertinent section
   ([progress-download-file] and/or [progress-upload-file]) is inserted

Symbols available in [progress-download-file] [progress-upload-file] related to the transferring file
%perc%   returns the value for the percentage done
%filename%   returns the value for the name of the file
%done-bytes%   returns the value for the transferred bytes
%done%   “ as %done-bytes% but using dynamic measure unit
%total-bytes%   returns the value for the number of bytes of the complete job
%total%   “ as %total-bytes% but using dynamic measure unit
%speed-kb%   returns the value for the throughput

Symbols available in [upload]
%uploaded-files%   input boxes for files to be uploaded got by gluing [upload-file] for each file

Symbols available in [upload-file]
%idx%   ordinal index of the input box

Symbols available in [upload-results]
%uploaded-files%   list of uploaded files got by gluing [upload-success] and/or [upload-failed] for each file

Symbols available in [upload-success] [upload-failed]
%item-name%   name of the file

Symbols available in [upload-success]
%item-size%   returns the value for the size of the file
%speed%   returns the value for the average speed

Symbols available in [upload-failed]
%reason%   returns the value for the error occurred while uploading


Command Line Operators List

~login   calls for the login screen
~files.lst    inserts HTML from filelist.tpl if exists in hfs.exe folder; otherwise
   produces ASCII file list of the requested folder
~img    shows server graphic
~progress   calls HTML from [progress] section

~upload    calls HTML from [upload] section for the requested folder
~upload-no-progress   calls HTML from [upload-no-progress] section for requested folder
~upload+progress   calls HTML from [upload+progress] section for requested folder


Sections list

Sections available in the template:

[style]   inserts HTML for the %style% symbol
[login-link]   inserts HTML for the %login-link% symbol when no user is logged
[loggedin]   inserts HTML for the  %loggedin% symbol when the user has logged in
[up]   inserts HTML for the %up% symbol when there's a parent folder
[link]   inserts HTML for the a link to an URL
[folder]   inserts HTML for the link to a folder
[file]   inserts HTML for the link to a file
[files]   inserts HTML for the %files% symbol when the current folder is not empty
[nofiles]   inserts HTML for the %files% symbol when the current folder is empty
[comment]   inserts HTML for the %comment% symbol for [file] [folder] and [link]
   if available in the VFS
[folder-comment]   inserts HTML for the %folder-comment% symbol if available in the VFS
[newfile]   inserts HTML for the %new% symbol if the item is marked as new


[upload-link]   inserts HTML for the %upload-link% symbol when the user has upload rights
[upload]   inserts HTML for the ~upload command
[upload-file]   inserts HTML for the upload form
[upload-results]   inserts HTML for the upload results page after upload has finished
[upload-success]   inserts HTML for the successfully uploaded files
[upload-failed]   inserts HTML for the unsuccessfully uploaded files


[progress]   inserts HTML for the  %progress% symbol
[progress-download-file]    inserts HTML for ongoing download
[progress-upload-file]   inserts HTML for ongoing upload
[progress-nofiles]   inserts HTML when no file transfer is ongoing
[upload-no-progress]   inserts HTML for the ~upload-no-progress command
[upload+progress]   inserts HTML for the ~upload+progress command


[error-page]   inserts HTML in case of an error
[overload]   inserts HTML for the %content% symbol
[unauthorized]   "
[deny]   "
[ban]   "
[max contemp downloads]   "
[not-found]   "

________________________________________________________
Source: Mr. Anon @ www.rejetto.com ; Revision and Update: ~GeeS~


Hope this helps.
GeeS


Offline maverick

  • Tireless poster
  • ****
    • Posts: 1052
  • Computer Solutions
    • View Profile
Good job GeeS.

Here's a couple of new additions (v2.0 beta 36 or 37)
Number of Addresses - %number-addresses%
Number of Addresses Downloading - %number-addresses-downloading%

With those two additions, that should bring the list up to-date to the latest v2.0 beta 37 - Feb 2006.

maverick
maverick


Offline ~GeeS~

  • Tireless poster
  • ****
    • Posts: 270
  • "The web was made for sharing..."
    • View Profile

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13307
    • View Profile