TabRe Ranks (cấp bậc)
A ten-step ladder earned by writing. A member's EXP is topics × 5 + comments × 1 by default, and the current rank
follows their name everywhere as a solid colour pill with its own art. The profile carries a progress card, and /ranks
shows the member's next step, the whole ladder and the members with the most EXP.
Nothing is stored: the ladder is a plugin setting, and EXP is computed from the counters the forum already keeps
(fb_users.topic_count and post_count), so a rank updates the moment a topic or a reply is posted.
The ladder
The ladder is a plugin setting (Admin → Plugins → TabRe Ranks → Settings, the ranks field), one rank per line:
key|Name|icon|#colour|min EXP|description
warrior|Chiến binh|axe.png|#b91c1c|800|Xông pha mọi chủ đềkey— letters, digits and_; sorts ties when two ranks share a threshold.icon— a file inplugins/tabre_ranks/assets/icons/(axe.png), or a built-in icon name.#colour— the pill's solid fill. The ink (near-black or white) is chosen from the colour's relative luminance so
every pill clears WCAG AA.min EXP— the EXP that opens the rank. Ranks are ordered by this number, not by the line order; the level number is
the position in that order.- Lines starting with
#are comments.
The two weights are settings too: EXP cho mỗi chủ đề (default 5) and EXP cho mỗi bình luận (default 1). A topic
counts once, however many replies it gets.
The 10 shipped ranks (Tân binh, Tập sự, Học việc, Đồng đội, Thợ lành nghề, Lực sĩ, Chiến binh, Pháp sư, Thủ lĩnh,
Huyền thoại) open at 0, 20, 50, 100, 200, 400, 800, 1,600, 3,200 and 6,400 EXP.
Where it shows up
| Place | What |
|---|---|
/ranks | The member's rank, EXP and progress to the next rank; every rank as a card; the top 10 writers by EXP. |
| Usernames | user.link_after appends the rank pill after every rendered name; larger on the profile header. |
| Profile | region.member.sections card: rank art, name, EXP, progress bar and the breakdown (topics × 5 + comments × 1), linking to /ranks. |
| Sidebar | Community nav: Cấp bậc. |
| Other plugins | The user.level filter answers with the rank number, so badges or gated topics can read user_level($user). |
Both display hooks run inside lists and never query the database: the catalogue and weights are request-cached and EXP
comes from the user row. A row without topic_count/post_count (a partial admin row) renders no pill rather than a
wrong one.
Two settings toggle the pill after names (on_name) and the profile card (profile_card).
Icons
The default ladder ships 10 PNGs in assets/icons/: egg, cracked egg, book, friend, hammer, arm, axe, teleporter,
a team and a rebirth — one step of a story from newcomer to legend. To add a rank, drop a 64px PNG into that folder and
name the file in the ladder — no upload, no code change.
Icons: Free Icon Pack v3.1 (Basic) by gvesster — used under its licence
(commercial use allowed; do not resell or repackage the icons). The licence text is kept atassets/icons/LICENSE-icons.txt, and a copy of the full pack lives outside the web root atdata/icon-pack/Free Icon Pack v3.1 (Basic)/.