HeXHub • Web

	The following variables and macros can be used in your index files (the content of all index files starts with "<").

1. General variables


1.1. %[hname]
Hub's name.

1.2. %[topic]
Current topic set.

1.3. %[uptime]
Hub's uptime in format: YYYY-MM-DD, HH:MM:SS.

1.4. %[uptimesec]
Hub's uptime in number of seconds.

1.5. %[webusers]
Number of users visiting hub's website.

1.6. %[owneremail format]
format = optional format type identifier
This will output owner's e-mail address as specified in hub's settings (!set hub mail)
Supported format identifiers:
normal - e-mail address unchanged
owner@host.com
java - a javascript that will output the e-mail address string
<SCRIPT TYPE="text/javascript"> document.write('owner'); document.write('@'); document.write('host'); document.write('.'); document.write('com'); </SCRIPT>
html - the address will have invisible random html tags in it
ow<!-- k -->ner@host.c<!-- twsons -->o<!-- ltgnrea -->m
atdot - the characters '@' and '.' will be replaced with '[at]' and '[dot]
owner [at] host [dot] com
hexurl - to be used only in "mailto:" links, all characters will be replaced with hexadecimal eqivalents
%6F%77%6E%65%72%40%68%6F%73%74%2E%63%6F%6D
dechtml - all characters will be replaced with decimal equivalents
&#111;&#119;&#110;&#101;&#114;&#64;&#104;&#111;&#115;&#116;&#46;&#99;&#111;&#109;
spaces - a space will be inserted after each character
o w n e r @ h o s t . c o m
Example: <a href="mailto:%[owneremail hexurl]">%[owneremail dechtml]</A>

1.7. %[rndmail format]
format = optional format type identifier
This macro will generate a random e-mail address to trick e-mail harvester bots.
Supported formats:
text
czpolxwmi3@z9lgg1ob4im.edu
html
<A HREF="mailto:pmblb8scfj0q@fnix7.net">pmblb8scfj0q@fnix7.net</A>
Example: %[repeat 100,1000,rnd]%[n 1]. %[rndmail html]<P>%[/repeat]
This will generate a random amount (between 100 and 1000) of random e-mail addresses.

1.8. %[url]
URL entered in browser.

1.9. %[host]
Hostname as specified in HTTP headers.

1.10. %[referer]
Referer link from HTTP headers (with parameters becomes a user-agent based restriction, see 5.10).

1.11. %[useragent]
User-agent from HTTP headers (with parameters becomes a user-agent based restriction, see 5.9).

1.12. %[location status] %[/location]
status = optional redirect status code (301 Moved Permanently or 302 Found), default is 301
If %[location] is present the returned status to client will be a HTTP redirect. The content between %[location] and %[/location] will be parsed and set as "Location:" for redirect.

1.13. %[cookie name]
name = the name of a saved cookie
This will output the value of a cookie.

1.14. %[setcookie name=value]
name = name of a cookie
value = optional new value that will be set
This macro will change the value of a cookie. If value is missing, the cookie will be deleted.

1.15. %[n start,step,format]
start = optional starting value for enumeration index of 0
step = optional increment for eaxh enumeration
format = optional format identifier
This variable is valid only in the context of an enumeration (3.) and will optput the enumeration index as specified.
Possible valued for format:
1 = numeric
0 = binary
x = hexadecimal, lowercase
X = hexadecimal, uppercase
3 = base32
a = alphabetic, lowercase
A = alphabetic, uppercase
i = roman, lowercase
I = roman, uppercase
- = morse code representation
+size = random arithmetic expression with [size] operands (minimum accepted is 1), if size is missing a default of 2 will be used (rnd is also accepted as a size value, minimum is 2, maximum follows or a default of 5 will be used)
Examples:
%[n] - index
%[n ,,X] - index in uppercase hexadecimal
%[n ,2] - index with increment step of 2
%[n 4] - index with starting value of 4 (4 is added to enumeration index)
%[n 10,5,I] - index with starting value of 10, increment of 5, represented as roman numbers
%[n 2,,+3] - index with starting value of 2, represented with random arithmetic expressions of 3 operands
%[n ,,+rnd 4] - index represented with random expressions of a minimum of 2 and a maximum of 4 operands

1.16. %[counter format]
format = optional format identifier
Number of times a page was sent. Version 5.00 supports only counters for single index sharing settings.
Possible valued for format:
1 = numeric
0 = binary
x = hexadecimal, lowercase
X = hexadecimal, uppercase
3 = base32
a = alphabetic, lowercase
A = alphabetic, uppercase
i = roman, lowercase
I = roman, uppercase
- = morse code representation
+size = random arithmetic expression with [size] operands (minimum accepted is 1), if size is missing a default of 2 will be used (rnd is also accepted as a size value, minimum is 2, maximum follows or a default of 5 will be used)

1.17. %[random count,charset]
count = optional number of random characters (default = 1)
charset = optional character set allowed specified by a character range (default = a-z 0-9)
This will insert a count number of random characters from specified character range. More ranges are allowed
Examples:
%[random] - inserts a random letter or number
%[random 5] - inserts 5 random letters or numbers
%[random 10,A-Z 0-9] - inserts 10 random capital letters or numbers
%[random ,a-z A-Z] - inserts a random letter

1.18. %[var name]
name = the name of a parameter
Using this without "=" will output the value of specified parameter (with "=value" becomes a restriction, see 5.12).

1.19. %[langctrl]
Inserts a SELECT combobox with all installed languages for language selection.

1.20. %[cpost]
Inserts default FORM for posting comments according to user's rights, hub settings and login state.

1.21. %[quote]
Inserts a quoted comment as specified in 7.8.

1.22. %[motd]
Inserts hub's Message Of The Day (converted to HTML).

1.23. %[cpageidx number]
number = a page index for comments or a relative index to current page (+number for current_page+number or -number for current_page-number), use "last" to specify last page.
Inserts a number relative to index for current page. Use it to display the page number in page controls.

1.24. %[version]
Inserts hub's version.

1.25. %[include filename]
Includes a file and translates all macros from it.

1.26. %[date format]
Inserts current date, default format is: y-m-d (identifiers are: y=year, m=month, d=day).

1.27. %[time format]
Inserts current time, default format is: h:m:s (identifiers are: h=hour, m=minute, s=second, ms=millisecond).


2. Variables related to %[hublist]
All variables have a parameter n that is used by %[hublist] enumerator. For hublist, starting n is 1. Current hub has an index of 0.

2.1. %[addr n] / %[haddr n]
Hub address (if n=0 will be current hub's address).

2.2. %[hdesc n]
Hub's description.

2.3. %[online n]
If the hub is online, the value will be "Online", else will be "Offline".

2.4. %[hubowner n]
Hub's owner.

2.5. %[redirects n]
Total number of users redirected to this hub.

2.6. %[redirhour n]
Number of users per hour redirected to this hub.

2.7. %[minshare n]
Minimum share size detected by pinger.



3. Variables related to %[nicklist] and %[oplist]
Reserved indexes: 0=hub-security, 1=opchat. If n is missing, information about current user will be displayed.

3.1. %[nick n]
Nickname.

3.2. %[description n]
User's description.

3.3. %[sharesize n]
User's share size.

3.4. %[useremail n]
User's e-mail address.

3.5. %[ip n]
User's IP address.

3.6. %[isp n]
Detected ISP for user's IP.

3.7. %[usercountry n]
User's 2-letter country identifier.

3.8. %[userlanguage n]
User's prefered language.

3.9. %[userprofile n]
User's profile name.

3.10. %[reason n]
The reason this user was kicked or the comment associated with his account.

3.11. %[expires n]
Remaining time until account expiration.

3.12. %[changedby n]
Last operator who changed user's account.

3.13. %[createdby n]
Account's creator.


4. Variables related to %[comments]

4.1. %[author n]
Author's nickname.

4.2. %[authorip n]
Author's IP.

4.3. %[signature n,size]
size = the size of delimiter, usually 20
Author's signature / comment / reason.

4.4. %[msgdate n]
Date when the comment or topic was posted.

4.5. %[msgtime n]
Time when the comment or topic was posted.

4.6. %[message n,maxmsg]
maxmsg = message length restriction in bytes.
Text of posted comment or topic. The message will be truncated to specified number of bytes instead of all data being inserted.

4.7. %[kauthor n]
The nickname of the author of last comment, if the entry is for a topic.

4.8. %[kauthorip n]
The IP of the author who posted last comment, if the entry is for a topic.

4.9. %[ksignature n,size]
size = the size of delimiter, usually 20
The date last comment was posted on topic n.

4.10. %[kmsgdate n]
The date last comment was posted on topic n.

4.11. %[kmsgtime n]
The time last comment was posted on topic n.

4.12. %[kmessage n,maxmsg]
maxmsg = message length restriction in bytes.
Text of last posted comment on topic n. The message will be truncated to specified number of bytes instead of all data being inserted.

4.13. %[topicname n]
The title of topic n.

4.14. %[topicfile n]
The file name (without path) for topic n.

4.15. %[posts n]
Total number of comments posted on topic n.

4.16. %[update key valuename] %[/update]
key = a number that should be unique and identifies a %[cdata] section from another file (if a topic is posted by a user, the hub generates the key)
valuename = the name of the message specific parameter that will written between %[update] and %[/update]
The content between %[update] and %[/update] is updated automatically by hub when a new comment is posted to a file that has the required key in %[cdata update:key].

4.16.1. %[update key author]
Author's nickname.

4.16.2. %[update key authorip]
Author's IP address.

4.16.3. %[update key msgdate]
Date when the comment was posted.

4.16.4. %[update key msgtime]
Time when the comment was posted.

4.16.5. %[update key message maxmsg]
maxmsg = message length in bytes.
The message that was posted (see 4.5.)

4.16.6. %[update key counter]
A number that is incremented each time a comment is posted. You can specify an initial value between %[update] and %[/update].

4.16.7. %[update key tname]
Topic name.

4.16.8. %[update key tfile]
File name without path for generated topic.


5. Restrictions
To restrict some content for specific groups of users you can use these variables:

5.1. %[rights mask] %[/rights]
mask = a mask of rights
This restriction will skip the block between %[rights mask] and %[/rights] if the user does not have required rights.

5.2. %[access level] %[/access]
level = minimum access level required
This restriction will skip the block between %[access level] and %[/access] if the user does not have minimum access level required.

5.3. %[userip ip] %[/userip]
ip = IP or IP range
Only users having IP in specified range will be able to access this content.

5.4. %[country country_id_list] %[/country]
country_id_list = a list with allowed 2-letter contry identifiers
This restriction uses the GeoIP database to restrict content by country.

5.5. %[language lang_id_list] %[/language]
lang_id_list = a list with allowed 2-letter identifiers of installed languages
Only users who chose one of the specified languages will access this content.

5.6. %[loggedin account] %[/loggedin]
account = optional parameter specifying a registered account name (if it is missing the match will be for non-logged in users)
This restriction allows displaying login controls / logged in information according to a user's login state. To test for guests use %[loggedin -]

5.7. %[profile name] %[/profile]
name = the name of an existing profile
Use this restriction to define profile-specific content blocks.

5.8. %[time HH:MM:SS HH:MM:SS] %[/timerange]
HH:MM:SS HH:MM:SS = a time range between starting hour:minute:second (all are optional) and ending hour:minute:second (all are optional)
This restriction can determine time-based content delivery.
Examples:
%[time 5:30 7:30] - only between 5:30 and 7:30
%[time :5] - every hour only first 5 minutes
%[time : :37] - every hour only after minute 37

5.9. %[useragent substring] %[/useragent]
substring = a string that may be part of a user-agent (browser identifier)
This restriction can determine client-based content delivery. If the string is missing the User-Agent value is inserted as content (see 1.11).
Examples:
%[useragent google] - this content will be only for GoogleBot
%[useragent msie] - only for Internet Explorer
%[useragent -msie] - all clients except Internet Explorer
%[useragent Opera/9.20] - only Opera version 9.20

5.10. %[referer substring] %[/referer]
substring = a string that may be part of a referer link.
This restriction can determine redirect-based content delivery. If the string is missing the Referer value is inserted as content (see 1.10).

5.11. %[realip ip] %[/realip]
ip = IP or IP range
Only users having IP in specified range will be able to access this content. This information is taken from X-ForwardedFor field of a proxy header if a proxy is detected, else the connected IP is used. On error (for example anonymous proxy) the realip will have a value of 255.255.255.255.

5.12. %[var name=value] %[/var]
name = the name of a parameter used to open this page
value = value of specified parameter, use ~value for partial strings
This restriction can determine content delivery based on values entered by users in forms. If value is missing the value will be inserted as unescaped text (see 1.18).

5.13. %[cookie name=value] %[/cookie]
name = the name of a saved cookie
value = value of cookie
This restriction is affected by cookies saved locally by clients. Use this to personalize content delivery. If value is missing and the cookie exists, its value will be inserted as unescaped text (see 1.13).

5.14. %[url substring] %[/url]
substring = a string that may be part of URL.
This restriction can determine content delivery based on the URL entered in browser. If the substring is missing the entered URL is inserted as text (see 1.8).

5.15. %[cpage number] %[/cpage]
number = a page index for comments or a relative index to current page (+number for current_page+number or -number for current_page-number), use "last" to specify last page.
This restriction requires that there are enough comments to make at least the requested number of pages. Use it to display page controls. To display an index relative to cpage, see 1.23.
Examples:
%[cpage 2]Pages%[/cpage]
%[cpage +1]Next page: %[cpageidx]%[/cpage]


6. Enumerators
The following are supported enumerators. Each enumerator has a loop counter "n" which can be used as enumeration index (except the rnd enumerator). This "n" may or may not have consecutive values. Non-numeric indexes called "n" will be replaced by hub with enumeration index on each loop. To explicitly insert the value of "n" in your document use %[n].

6.1. %[repeat min|count,max] %[/repeat]
min|count = optional parameter for first value of n (if max is present, default=0) or number of enumerations (if max is not present, default=1)
max = if this parameter is present, a random value between min and max will be used as count
This enumerator deppends only on numeric start/stop/count parameters.
Examples:
%[repeat 100] test %[/repeat]
%[repeat 10,20] %[n] %[/repeat]
%[repeat 5,30] %[n]. %[rndmail] %[/repeat]
%[repeat 10] %[n 1]. %[n 100,100,+ rnd 4]=%[n 100,100] <P> %[/repeat]

6.2. %[rnd importance1] .. %[rnd importanceN] .. %[/rnd]
importance1 = an optional number specifying the importance of the block, the higher this number is, the bigger there are chances for it to be chosen (by default random blocks have an importance of 100).
This sequence will determine a random chosen block to be parsed, all others will be ignored. Blocks are separated by %[rnd], the sequence ends with %[/rnd].
Example:
<img src="%[rnd]img1.jpg%[rnd]img2.jpg%[rnd]img3.jpg%[/rnd]"> - at every refresh another image will be displayed

6.3. %[hublist] %[/hublist]
This enumerator can be used to display network hublist.

6.4. %[nicklist] %[/nicklist]
This enumerator will traverse the list with all connected users.

6.5. %[oplist] %[/oplist]
This enumerator can be used to list all operators.

6.6. %[plugin dll,parameters] %[/plugin]
dll = the file name of an installed DLL plugin
parameters = optional parameters for this enumeration
This enumerator will allow a plugin to enumerate its data. See the documentation for that plugin for information about accepted parameters.

6.7. %[comments - maxcomments d] %[/comments]
- = if "-" is present, no comments are shown on first page, but a "show comments" link.
maxcomments = maximum number of comments per page. If there are more comments, the hub will generate more "&cpage=" pages for these comments where only %[comments] will be the difference. Default number of comments per page is 50.
d = if "d" is present, the comments are shown in descending order.
This enumerator will show all comments for a specified index. For page controls, see 5.15.

6.8. %[cdata bak,move,msg,img:host1,img:host2,...,img:hostN,rights:mask,access:level,rss update:key:filename template:filename] %[/cdata]
bak = if this parameter is present, the hub will create a backup file of the changed index. The backup file will have .ht# as extension. Files with "#" in their name cannot be shared over HTTP by HeXHub.
move = an update in cdata from another index causes the updated cdata entry to be moved so it can be the last entry
msg = updates in other indexes will have full posted message
img = if this parameter is present, restriction for hosts of linked images is enabled. Users who don't have spam1 right will not be able to link images from servers that are not listed here as img:. If no img: restrictions are present, restriction for hosts of images is disabled and everyone can post image links from any servers.
rights = if this parameter is present, only users who have all the rights specified in the mask can post a comment
access = if this parameter is present, only users who have at least the specified access level can post a comment
rss = if this parameter is present, the configured RSS feed will be updated with this comment. Minimum access level to update RSS is 4000.
update:key:filename = if this parameter is present, another file is updated when a new comment is posted with comment data. The key should be unique for a %[cdata] section. In the destination file the key is searched for %[update]..%[/update] and for <key>..</key> and if matches are found, the content is updated. The path is relative to HeXHub's install directory.
template:filename = in case of topic posts, a template can be specified to save the posted message as a new file named by topic title. For every new file created, the hub will generate a new Key that will be stored in %[cdata] for the new file and in <key> of current message. Special keywords for templates that are replaced when creating a new topic are: %[_topic] (topic title) , %[_article] (the first posted message, which is not a comment for this topic) , %[_author] (nickname of the user who posted first message) , %[_cdata] (cdata entry for current message) and %[cdata] where the "update" keyword is search and updated with the new key.
This enumerator is updated internally by HeXHub with all new posted comments. The information contained in a cdata enumeration will not be displayed in requested index file, but it can be called by other macros (like %[comments]). An index file can have only one %[cdata] enumerator.
The starting comment of a new topic (if "update" is present) has an addition to posted message, <HR>signature<key value numcomments>cdata_entry</key><A href="%[link]">topic_name</A>.

6.9. %[dir dirame] %[/dir]
dirname = a list of directories separated by ";" that will be searched, paths are relative to web root, wildcards for filenames are supported
This enumerator can be used to list directories that contain downloads. This enumerator is not recursive (there cannot be a %[dir] enumeration inside another %[dir] block). Files that have "#" in their name are not listed.


7. Calling Hub functions
These paths can be used to call some of hub's functions:

7.1. /%[dll]/%[parameters]
%[dll] = the dll name of an installed plugin
%[parameters] = optional parameters for plugin
This will allow a plugin to generate its own pages. Everything that follows will be parameters for this plugin.

7.2. /login?user=%[user]&pass=%[pass]&repass=%[repass]&return=%[return]&oldpass=%[oldpass]
%[user] = nickname of the user who is logging in, or void to logout
%[pass] = registered user's password
%[repass] = if the user is self registering, this is re-typed password
%[return] = redirect address after login is completed, the address must start with "/" or it will be ignored
%[oldpass] = if this parameter is used, the password will be updated with %[pass]
This function will allow a user to log in or to self register (self registration is possible only if the default profile has pwd1 right).

7.3. /bans?start=%[start]&target=%[target]&&return=%[return]
%[start] = banlist index
%[target] = nick, IP, IP range or ISP to ban or unban
%[return] = return address, the address must start with "/" or it will be ignored
This function will list bans and will allow an operator or admin to set new bans or to unban users. If target is found in banlist, it will be unbanned, else it will be banned. If target is not present, banlist will be displayed.

7.4. /language?lang=%[language]&return=%[return]
%[language] = the new language that will be set
%[return] = return address, the address must start with "/" or it will be ignored
This function will allow a user to set his own language.

7.5. /report?nick=%[nick]&return=%[return]&msg=%[message]&separator=%[separator]
%[nick] = nickname of the user who sends the report
%[return] = return address, the address must start with "/" or it will be ignored
%[message] = the message that will be sent in opchat
%[separator] = message terminator, can have any value
This function allows users to send reports to opchat (like +report). For this function to work, the user needs to have chat3 right.

7.6. ?user=%[user]&title=%[title]&postcomment=%[comment]&separator=%[separator]
%[user] = nickname of the user who posted the comment
%[title] = an optional title if the posted message will be saved as a new topic using a template
%[comment] = comment message
%[separator] = message terminator, can have any value
This function allows posting comments. For this function to work, the user must have chat0 right and the index where the comment will be posted must have a %[cdata] enumerator.

7.7. ?cdelete=%[index]
%[index] = enumeration index for comment
This function allows a moderator or hub administrator that has adm6 right to delete a posted comment from %[cdata].

7.8. ?quote=%[index]
%[index] = index of a comment
This function will set the %[quote] variable with BBCode quotation of a posted comment.


8. BBCode allowed in comments

8.1. [B] [/B]
Bold text.

8.2. [I] [/I]
Italic.

8.3. [U] [/U]
Underline.

8.4. [color=%[color]] [/color]
%[color] = a color name of a hexadecimal colour identifier prefixed by "#"
Changes font's colour

8.5. [size=%[size]] [/size]
%[size] = a number indicating new font size
Changes font's size

8.6. [font %[name]] [/font]
%[name] = name of an existing font
Changes font.

8.7. [quote="%[nick]"] [/quote]
%[nick] = author of quoted message
Inserts a quoted message.

8.8. [code] [/code]
Inserts a portion of code.

8.9. [list] [/list]
Unordered list, list items will be prefixed with "[*]".

8.10. [list=1|a|A|i|I] [/list]
1 = optional parameter, numeric type
a = optional parameter, literal, lowercase
A = optional parameter, literal, uppercase
i = optional parameter, roman numbers, lowercase
I = optional parameter, roman numbers, uppercase
Ordered list with numeric or literal type, as specified, list items will be prefixed with "[*]".

8.11. [url] [/url]
Inserts a named link. The hub adds 'rel="nofollow"' to links posted by users who don't have spam1 right.

8.12. [url=%[url]] [/url]
Inserts a link. The hub adds 'rel="nofollow"' to links posted by users who don't have spam1 right.

8.13. [email] [/email]
Inserts a named e-mail address.

8.14. [email=%[email]] [/email]
Inserts an e-mail address.

8.15. [img]%[imgsrc][/img]
%[imgsrc] = address of an image
Inserts an image in comments. If the user doesn't have spam1 right, cdata restriction for image host applies.

8.16. [button %[url] %[var_list]]%[name][/button]
%[url] = address of a website
%[var_list] = a list of "name=value" variables separated by space that will be added as hidden form elements to be used in a HTTP POST request
%[name] = button name, can contain BBCode tags
Inserts a form with a button and optional hidden elements that uses HTTP POST method.
Examples:
[button=http://en.wikipedia.org/wiki/Special:Search search=test]Search Wikipedia for "test"[/button]
[button=http://en.wikipedia.org/wiki/Special:Search search=test ns6=1 redirs=0][size=3]Search [b][color=green]Wikipedia[/color][/b] for "[i]test[/i]"[/size][/button]


9. Variables and macros related to %[dir]
These variables don't need %[n] because they cannot be used outside %[dir].

9.1. %[file name]
File name.

9.2. %[file size]
File size in bytes or "<DIR>" if it is a directory

9.3. %[file date]
Date when the file was modified.

9.4. %[file time]
Time when the file was modified.

9.5. %[file desc mask description]
mask = a substring common to all filenames described by this call
description = a common description for this mask
This macro will insert specified description if the file name matches defined mask. There can be more than 1 %[file desc] inside a %[dir] enumeration. All parameters are required.

9.6. %[lastdir files]
This can be used after a %[dir] enumeration to display total number of listed files.

9.7. %[lastdir dirs]
This can be used after a %[dir] enumeration to display total number of directories.

9.8. %[lastdir bytes]
This can be used after a %[dir] enumeration to display total number of bytes if listed files.

Comments

There are no comments for this page, you can write one here.