This repository was archived by the owner on May 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Header link format
Jacob G edited this page Jan 3, 2016
·
3 revisions
Header links will be stored in the "header_links" config entry, in the following format:
- Most basic element is
<link> - Content of the tag is the text
- If the "notranslate" attribute is not present, the text will be interpreted as a language key, otherwise it will be shown verbatim
- It will be prefixed by the base URL the "path" attribute is used, but not if the "url" attribute is used instead
- Variables:
-
$username$ = username -
$reghash$ = registration hash used as an anti-bot measure (the stuff that goes after /register)
-
- To determine which users an link shows up for, use the "perm" attribute, and it uses the following format:
- List each user group attribute a user must have separated by spaces ("valid" means logged in, everything else is the g_ format from the database)
- Use ~ to mean NOT
- All listed permissions must be true, not just one
- Example: "valid" means user must be logged in, "~valid" means the user is NOT logged in, "g_user_list g_edit_posts" means the user must be able to view the user list AND edit posts, and "g_mod_privs ~g_admin_privs" means the user must be a moderator AND NOT an administrator
Here is an example:
<?xml version="1.0" ?>
<linkset>
<link path="">index</link>
<link path="users/$username$" perm="valid">users</link>
<link path="users" perm="g_user_list">userlist</link>
<link path="search">search</link>
<link path="admin" perm="g_admin_privs">administration</link>
<link path="bans" perm="g_mod_privs ~g_admin_privs">administration</link>
<link path="register/$reghash$" perm="~valid">register</link>
<link path="logout" perm="valid">logout</link>
<link url="http://yoursite.com" base="false" notranslate="true">EXTRA LINK</link>
</linkset>