rejetto forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Mr. Anon

Pages: 1
HTML & templates / Template Help and Information - Wiki Links
« on: December 15, 2004, 11:13:37 PM »
HFS Template, Sections, Symbols & Variable Help


 - 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.

HFS: Address Operators.

HFS: Template Symbols.

HFS: Template Macros.  (Full List)

HFS: Event scripts. (by Topic)

HFS: Folder Archives.

HFS: Hidden Things.

HFS: Comment Files.

HFS: Template Gallery.

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 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-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.
%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 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.
%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.

~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:

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.

HFS ~ HTTP File Server / Little problem with HFS Tray-Icon
« on: October 28, 2004, 05:19:44 AM »
For the HFS progress tray-icon, the balloon popup shows "xxx" bytes se instead of "xxx" bytes sent. :P (The green progress tray icon)

Please note that the following F.A.Qs only apply to the latest version of HFS, version 2.0. If you do not already have this version, please download it at

Q1: What is HFS?
A1: HFS is a portable software that allows you to share files between friends and family with ease. HFS is so small that it could even fit on a FLOPPY DISK!

Q2: How much does HFS cost?
A2: HFS is completely free! However, if you like the project, please donate by going to .

Q3: I like this software! How do I donate?
A3: You can donate to the HFS project by going to and clicking the Donate button.

Q4: Does HFS contain spyware, trojans, or any malicious software?
A4: Of course not! We respect the rights and privacy of our users and does not bundle "junkware" unlike other free software(s). If you like HFS, please support HFS by donating!

Q5: What protocol(s) does HFS support?
A5: As of now, HFS only supports the HTTP 1.1 protocol.

Q6: Will HFS support the FTP file transfer protocol?
A6: FTP support is planned, but please don't expect it soon as it would probably come on a major release after v2.0.

Q7: Does HFS support server-side scripting such as CGI or PHP?
A7: No, HFS currently does not support server-side scripting such as CGI or PHP. Although this is planned for a later version, please keep in mind that HFS is meant to be a file sharing server.

Q8: When I share a file in HFS, it always asks me to download. I just want it to appear in the browser! (like images, etc)
A8: By default, HFS tells the browser that files should be downloaded and not viewed. To change this behavior, click Menu, Other Options, than click Open directly in browser... Here you can specify which files type you want HFS to directly display in the browser. (For example, *.gif;*.jpg) (File types are separated by semicolons and wildcards * are supported)

Q9: I do not like HFS's web interface, how do I change the look?
A9: If you are knowledgeable in HTML, you could edit the HTML template by selecting Menu, Other Options, Edit HTML Template...
(No WYSIWYG editor is available for editing the HFS template)
You might also be able to find customized templates by our users by looking around in the forum.

Q10: HFS reports the error "Cannot open port". What should I do?
A10: This usually means the port that HFS tries to use is in use by some other application. To fix this, specify another port (1-65535) in the port box, and click the OFF button to switch the server on.
P.S. It is recommended that you pick a high port range such as 17019 or 31028, etc.

Q11: What is the difference between Expert and Easy mode?
A11: In easy mode, a lot of HFS options is hidden from the user's view for the usability of the software for beginning users. If you are fairly knowledgeable about HFS, it is suggested that you use the Expert mode.

Q12: My download is interrupted! Does HFS supports resuming of impartically downloaded files?
A12: Yup! HFS supports HTTP 1.1 download resuming with the help of a download manager.

Q13: My friend is uploading to my HFS server, but the upload got interrupted. How could I resume the upload?
A13: Currently, the HTTP 1.1 specifications does not contain commands for resuming impartially uploads. Therefore, this feature will not be implemented in newer versions of HFS. (Unless FTP support is implemented)
Please note that HFS could be configured to delete impartially uploaded files.

Q14: How do I protect my files on the HFS server? Are they safe from Internet hackers?
A14: You can set a username and password for a file by right clicking on the file and selecting Set user/pass... This, however, will not protect your file from prying eyes when they are downloaded by an authorized user since HFS does not encrypt the data that is being sent.

Q15: What does the "hand" icon represent in the file system tree?
A15: If you see an icon that looks like a hand, it means that HFS could not find/access the original source file. HFS will hide the file from the web interface until HFS could successfully access the file in question.

Q16: I can locally access my HFS server, but when my friend tries to access my HFS server, they get the "Unable to connect" or "The page cannot be displayed" error. Why?
A16: This problem is most likely to be caused by a router or a firewall. If you are currently under a network, please make sure that the correct port is forwarded to your computer. (Instructions are available on ) Additionally, try disabling software firewalls or enable HFS server permissions if applicable.
To simplify this process, use the Self Test feature in HFS2 by clicking Menu, Self Test. The self test will let you know whether or not your HFS server is working properly.

Q17: How do I allow someone to upload to my server?
A17: In order for someone to be able to upload to your HFS server, you must first create a "real folder" in the HFS file system. To do this, simply drag a folder from Explorer and release it into the HFS window. A prompt will ask you whether you want the folder to be a Virtual or Real folder. Click Real folder. After the folder is created (red-icon), you may set password permissions by right clicking the folder, and choosing the Upload submenu.

Q18: What is the difference between an user account and an user/pass combination?
A18: A user account is basically a shortcut for the user/pass combination since you simply select the user and HFS fills in the user credentials for you. Otherwise, HFS allows you to define user and passwords for different resources freely.

Q19: How do I add a comment to the password box that pops up when a user tries to access a password protected resource?
A19: You could specify this comment by right clicking the resource, and then by selecting the Customized realm selection.

Q20: I am trying to serve small amounts of HTML pages via HFS and wants to define an index page. How do I do that?
A20: You could specify the index file mask by right clicking the home icon, and then by clicking the Default file mask selection.

Q21: How do I change the default favorite icon on the HFS web-interface?
A21: If you have a customized favorite icon you want to use, simply rename that icon to favicon.ico and drag it into the HFS file system. After that, you may choose to hide the file by right clicking the file and choose Hide.

Q22: I am sharing a lot of files at once. Could I have HFS download multiple files or download the whole folder?
A22: Currently, HFS does not support downloading multiple files nor the whole folder at once. However, this function is possible with the help of an existing download manager. (Firefox users see: )

Q23: Could I upload multiple files or the whole folder at once?
Q23: HFS does not support upload of the whole folder at once. However, users could choose to upload multiple items by selecting them one by one on the HFS upload page. (By default, multiple upload fields are offered)

Q24: How do I make HFS startup every time I start Windows?
A24: To make HFS startup every time Windows start, simply create a shortcut to HFS within Programs -> Startup in the start menu.
(For easier drag and drop shortcut, it might be easier to open the start menu by right clicking it and then click Explore)

HTML & templates / HFS Black - The Black HFS Template!
« on: May 31, 2004, 08:42:54 AM »
Screenshots (Beta 1)

Tell me what you guys think! Color changes etc?

HFS ~ HTTP File Server / More See Through % Numbers?
« on: January 14, 2004, 02:30:52 AM »
Hey rejetto, could you make the % number more clear when the dark gray bar is over the % number? Right now if the dark gray is over % number, it is very hard to see the % number without highlighting the entry.

HFS ~ HTTP File Server / Reset Hits?
« on: January 13, 2004, 04:19:11 PM »
Is there any way I could reset / disable hits in HFS?

HFS ~ HTTP File Server / Hyperlink Lockable?
« on: January 08, 2004, 07:18:26 AM »
I am using version 1.6 rc8, and it seems that the hyperlinks I create could not be locked at all.
Locked hyperlinks are just like normal links... What's with that?

Pages: 1