rejetto forum

Template Help and Information - Wiki Links

0 Members and 1 Guest are viewing this topic.

Offline Mr. Anon

  • Tireless poster
  • ****
    • Posts: 270
    • View Profile
HFS Template, Sections, Symbols & Variable Help

NEED MORE HELP? LOOK AMONG THESE LINKS BELOW

 - The template is the model HFS uses to build HTML pages.
 - It's divided into sections, and each section describes a part of the final HTML page.
 - This template must provide all sections in order to work properly.
 - Each section usually contains HTML code.
 - The final HTML page is built dynamically, so you must use symbols to achieve useful output. These symbols are replaced by the real values at run-time.
 - Symbols are surrounded by %percent% characters.
 - A section is labeled using [square brackets].
 - The main section is unlabeled. It is the starting point for every page that shows files.
 - Every section normally includes symbols, some of which are only meaningful in certain sections.
 - The best way to build a template is to edit an existing template.
 - The template editor includes an Undo command, and you can always "Restore default" template if you encounter problems.
 - The template editor also includes a word-wrap feature to ease editing on lower resolutions.


Quote from: Mars
HFS: Template.
http://www.rejetto.com/wiki/index.php?title=HFS:_Template

HFS: Address Operators.
http://www.rejetto.com/wiki/index.php?title=HFS:_Address_operators

HFS: Template Symbols.
http://www.rejetto.com/wiki/index.php?title=HFS:_Template_symbols

HFS: Template Macros.
http://www.rejetto.com/wiki/index.php?title=HFS:_Template_macros  (Full List)

HFS: Event scripts.
http://www.rejetto.com/wiki/index.php?title=HFS:_Event_scripts (by Topic)

HFS: Folder Archives.
http://www.rejetto.com/wiki/index.php?title=HFS:_Folder_Archives

HFS: Hidden Things.
http://www.rejetto.com/wiki/index.php?title=HFS:_Hidden_things

HFS: Comment Files.
http://www.rejetto.com/wiki/index.php?title=HFS:_Comment_files

HFS: Template Gallery.
http://rejetto.com/wiki/index.php?title=Gallery


Symbols list - by section.

Symbols available in all sections:
%connections%   current number of connections.
%sequential%
%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 in.
%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.
%ip%   inserts the client IP address on the page.


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%   converts to [up] if the current folder is not the root,   void otherwise.
%files%   converts to [files] if at least one 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.
%number-links%   number of links 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, achieved 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-full-url%
%item-name%   label of the item.
%item-type%   Return value if item is folder, file or link
%item-folder%   path to the item, not in URL format.
%item-relative-folder%  path to the item (use it with recursive mode), not in URL format.
%item-added%    when the item was added to the VFS.
%item-added-dt%    when the item was added to the VFS as a numeric value .
%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 the file system.

%item-modified-dt%   modification time as reported by the file system as a numeric value.[/color]

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%   error that occurred.

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 achieved 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.
%filename-js%
%done%
%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.
%time-left%
%speed-kb%   throughput.
%item-user%
%item-ip%
%item-port%




Symbols available in [upload]
%upload-files%   input boxes for files to be uploaded achieved 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 achieved by gluing [upload-success] or [upload-failed] for each file.

Symbols available in [upload-success] [upload-failed]
%item-name%   name of the file.
%item-url%   address of the file.
%item-size%
%item-resource%
%idx%   ordinal index of the input box.

Symbols available in [upload-success]
%item-size%     size of the file.
%speed%         average 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.
[link]   defines a link to a URL.
[file]      defines a link to a file.
[file.<EXT>]   used in place of [file] when the file has the specified extension.
[folder]   defines a link to a folder.
[files]       defines the %files% symbol when there's at least one file.
[nofiles]   defines the %files% symbol when there's no file.
[comment]   defines the %comment% symbol for [file] [folder] and [link].
[folder-comment]         defines the %folder-comment% symbol when there's a comment for the current folder.
[style]        defines the %style% symbol.
[login-link]   defines the %login-link% symbol when no user is logged in.
[loggedin]   defines the %loggedin% symbol when the user has logged in.
[upload-link]      defines the %upload-link% symbol when the user has upload rights.
[error-page]     the frame used for all error pages.
[overload]   defines %content% for the related error-page.
[unauthorized]       defines %content% for the related error-page.
[protected]       defines %protected% for unauthorized-acces.
[deny]       defines %content% for the related error-page.
[ban]      defines %content% for the related error-page.
[not-found]   defines %content% for the related error-page.
[max contemporary downloads]        defines %content% for the related error-page.
[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.
[sort by]   Force sorting list, must contain only one letter preceded of ! to reverse the sort 
   n (NAME), e (EXTENSION), s (SIZE), t (TIME), d (HITS), c (COMMENTS)
[special:xxx] special sections where xxx can take some values
 - [special:strings]  ....
 - [special:alias]  ...
 - [special:import]   the content of the section is run once a new template is loaded
 - [special:begin]   Sometimes you need to be sure something gets done before every page is built and sent to the browser. In such case, you can put all your macros in the section


Section aliasing:

You can specify 2 or more sections in brackets, and the same content will be assigned to all of them.

The syntax is [A = B = C = D] where A, B, C, etc, are sections.
sections are also cumulative, by prefixing the name with the sign +  [+A]   [+B]   [+A=+B]

This is very useful when you are specifying the content for [file.EXT] sections, like images.
[file.jpg = file.bmp = file.png = file.gif]







Address Line and Linking Information

In some cases requires %encoded-folder% before the operator.

It is possible to make links to sort the file list accordingly:
?sort=n      sort the file list by the file name.
?sort=s      sort by the file size.
?sort=t      sort by the date modified.
?sort=d      sort by the amount of ‘hits’ or ‘downloads’.


Address line operators list:
Address line operators can be used in HTML e.g. href="/~login" and in the address command line of the browser e.g. www.yoursite.com/~login.

~nodefault      doesn't serve default file in a folder, but folder with files.
~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 the HTML from section [progress].
~upload      calls HTML from section [upload] for the requested folder.
~upload-no-progress   calls HTML from section [upload-no-progress] for requested folder.
~upload+progress   calls HTML from section [upload+progress] for the requested folder.


To access the icon images:
/~img_folder        shows a default folder image.
/~img_file      will load the according icon for the file type.
/~img_link    shows the image for a link.

It is also possible specify what icons to use…
/~img#      where ‘#’ is the number of the icon in the icon list of HFS.

A link to load everything in the HFS on one page:
/?recursive   

CAUTION: use very carefully. If the HFS has a lot of objects this can use a lot of CPU and RAM with the risk of crashing your PC. Measures have been taken by template builders to reduce CPU load. USE AT YOUR OWN RISK.

Link to graph and customising graph colors and size:

You can customize graph colors inside the template. The graph address is ~img_graph, but you can append to the name several options separated by an x.

For example, ~img_graph190x40x10x111x222x333333x444x555 to exclude an item simply do not put it in e.g, ~img_graph190x40xx111
The full list of options, in order is: width, height, refresh rate, background color, grid color, out bandwidth color, in bandwidth color, text color.

You can specify as many options as you want, even none. Current default values for width/height/colors are the same as in HFS window.

Colors can be specified in at least two forms: RGB, RRGGBB.

Refresh rate doesn't work inside template itself, but only if you access the graph alone, directly in your browser. If not specified, refresh is disabled.




From HFS 2.3, HFS Macro:

There is a new type of template code which allows for even more functionality and power. It is a simple server side scripting language called Macro. For more information checkout the Wiki links.
« Last Edit: May 28, 2018, 04:30:20 PM by Mars »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13521
    • View Profile
excellent
« Last Edit: October 17, 2011, 09:14:39 AM by rejetto »


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
Updated on Monday, January 29, 2007.
Updated on Sunday, February 4, 2007.
Updated on Monday, February 5, 2007.
Updated on Thursday, July 9, 2009.

Hopefully contains all the new vars and sections and other useful template information.

Original Post by Mr.Anon, Edited by That_Stevens_Guy.
« Last Edit: July 08, 2009, 06:08:18 PM by TSG »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13521
    • View Profile
huge work, thank you
« Last Edit: October 17, 2011, 09:13:03 AM by Mars »