TabRe Titles (danh hiệu)
Collectible titles that members wear next to their name across the forum: a solid colour pill with the site's own
icon art. Members buy one with points at /titles — or receive one from an administrator — and wear one at a time.
It is another sink for points, and a visible reward: the title follows the displayed name in lists, topics and on the
profile header, and the profile carries a small showcase of everything the member owns.
The catalogue
The catalogue is a plugin setting (Admin → Extensions → TabRe Titles, or the titles setting), one title per line:
key|Name|icon|#colour|price|description
legend|Huyền thoại|trophy.png|#f59e0b|5000|Huyền thoại của cộng đồngkey— letters, digits and_; identifies the title in data (legend).icon— a file inplugins/tabre_titles/assets/icons/(trophy.png), or a built-in icon name.#colour— the pill's solid fill. The text/art ink (near-black or white) is chosen automatically from the colour's
relative luminance, so every pill stays readable.price— points;0means the title can only be granted from the admin page (used for "Sáng lập").- Lines starting with
#are comments.
The 30 shipped titles (founder, legend, VIP, diamond, aura, crystal, angel, premium, gold, cash, medal, rocket,
silver, sword, shield, lucky, potion, key, shadow, chest, gift, fire, star, heart, clover, planet, dice, target,
scroll, torch) cost 250–5,000 points.
Data
plugin_tabre_titles_owned—user_id,title,acquired_at,acquired_by; unique per member and title.plugin_tabre_titles_worn— the one title a member currently wears (user_idunique,title,since).
Purchases debit points with one conditional UPDATE (WHERE points>=?) inside the same transaction as the grant, so
two tabs cannot spend the same points or buy the same title twice. The worn map is loaded once per request throughrequest_cache(), so the user.link_after hook (which runs inside lists) never touches the database.
Where it shows up
| Place | What |
|---|---|
/titles | The shop: every title as a card with its art, the real pill preview, price and one action (Buy / Wear / Take off). |
| Usernames | user.link_after appends the worn pill after every rendered name; larger on the profile header. |
| Profile | region.member.sections card: the worn title and up to 8 owned titles (with +N), linking to /titles on your own profile. |
| Sidebar | Community nav: Danh hiệu. |
| Points | A quick action on the Points page; purchases log reason tabre_titles with a crown icon. |
| Notifications | A gifted title notifies the member (kind tabre_titles). |
| Admin | Danh hiệu: give a title to a member, see every holder, take a title back (sudo + confirm, logged). |
Two settings toggle the pill after names (on_name) and the profile card (profile_card).
Icons
The default catalogue ships 30 PNGs in assets/icons/. To add a title, drop a 64px PNG into that folder and name the
file in the catalogue — 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)/.