HFS: Template

From rejetto wiki
Revision as of 17:05, 13 April 2006 by Rawbanana (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Applying templates from a forum

Download templates from the HFS templates forum.

1. Open the "Menu" in HFS

2. Select "Other options" and open "Edit HTML template"

3. Copy your HTML template and paste it over the HFS "HTML template"

Test your new HTML template by pressing the "apply" button and reload your HFS web page on your web browser.


Building your own HTML template

1. Open the "Menu" in HFS

2. Select "Other options" and open "Edit HTML template"

3. Press the "Help" button to list the available symbols to use in your HTML template.


Template help

The template is a model for HFS to build HTML pages. It is divided in sections. Each section describes a part of the final HTML page. The template should provide all sections for correct working. Sections usually contains HTML code. Since the final HTML page is built dinamically you must use symbols to get a useful output. Symbols will be translated with right values at run-time. Symbols are surrounded by %percent% characters. A template is divided in sections. A section is labeled using [square brakets]. There is a main section, unlabeled, used for file showing. In every section you can find symbols. Some symbols are limited to some section. The best way to build a template is to edit an existing template.


Symbols list - by section

Symbols available in all sections: %connections% current number of connections %style% converts to [style] content %timestamp% current time and date of the server %version% HFS version %uptime% how long HFS has been running without quitting %speed-out% current outward throughput %speed-in% current inward throughput %total-out% total amount of bytes sent %total-in% total amount of bytes received %user% name of the authenticated user, void if no user is logged %loggedin% converts to [loggedin] if a user is logged in, void otherwise %login-link% converts to [login-link] if no user is logged in, void otherwise

Symbols available in the main section: %host% the Host http header field, as sent by the browser %upload-link% converts to [upload-link] if upload is available in the current folders, void otherwise %up% convers to [up] if the current folder is not the root, void otherwise %files% converts to [files] if at least an item is present in the current folder, converts to [nofiles] otherwise %number% number of items in the current folder %number-files% number of files in the current folder %number-folders% number of folders in the current folder %total-size% amount of space occupied by items in the current folder %total-bytes% as %total-size% but expressed in bytes %total-kbytes% as %total-size% but expressed in kilobytes %build-time% how long it took to generate the page Symbols available in [files] %list% the full list of items in the current folder, got by gluing each item after the pertinent section ([file] [folder] or [link]) was converted

Symbols available in [file] [folder] [link] %new% converts to [new] if the file is marked as new, void otherwise %item-url% URL to get the item %item-name% label of the item %item-added% when was the item added to the VFS %comment% converts to [comment] if a comment is available for the item, void otherwise

Symbols available in [file] [folder] %item-dl-count% download counter (virtual folders totalize inner counters) %item-modified% modification time as reported by

Symbols available in [file] %item-size% 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% total amount of available space in the drive containing the current folder (makes sense only for real folders) %folder% path to the current folder %encoded-folder% encoded path to the current folder %parent-folder% encoded path to the parent folder %folder-comment% converts to [folder-comment] if a comment is available for the current folder, void otherwise

Symbols available in [error-page] %content% converts to [ban] [deny] [not found] [unauthorized] [overload], depending on the error

Symbols available in [ban] %reason% ban description

Symbols available in [progress] %progress-files% converts to [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] or [progress-upload-file]) was converted

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

Symbols available in [upload] %upload-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] 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% size of the file %speed% avarage speed Symbols available in [upload-failed] %reason% description of error occurred while uploading

________________________________________________________________________________


Sections list

Some of the sections available in template: [up] defines the %up% symbol when there's a parent folder [file] defines a link to a file [folder] defines a link to a folder [link] defines a link to an URL [files] defines the %files% symbol when there's some file [nofiles] defines the %files% symbol when there's no file [comment] defines the %comment% symbol for [file] [folder] and [link] [style] defines the %style% symbol [login-link] defines the %login-link% symbol when no user is logged [loggedin] defines the %loggedin% symbol when the user has logged in [upload-link] defines the %upload-link% symbol when the user has upload rights [up] defines the %up% symbol [folder-comment] defines the %folder-comment% symbol when there's a comment for the current folder [error-page] the frame used for all error pages [overload] defines %content% for the related error-page [unauthorized] " [deny] " [ban] " [not-found] " [max contemporary downloads] " [upload] the upload page [upload-file] form item for a single file [upload-results] the upload results page [newfile] defines the %new% symbol when the item is marked as new