TabRe Items (props centre)

Buy items with the forum's points and use them on a topic — the idea Discuz! calls 道具中心. It turns the points
balance into actions: a sink against inflation, and a new way for members to interact with their own topics.

The items

EffectWhat it does
highlightPaints the topic title a colour for N hours (stored in the topic's meta, so a list pays no extra query).
stickyPins the topic to the top for N hours; the scheduled job unpins it.
bumpRaises the topic to the top of the list right now (a one-off).
closeLocks the topic for N hours.
reopenUnlocks a locked topic right now.

The catalogue is a setting, so the admin adds, removes or reprices items without touching code:

key|Name|price|effect|hours|icon|#colour|description
highlight|Highlight|50|highlight|72|palette|#e11d48|Paints the topic title for 3 days

hours 0 makes the item a one-off.

Icons

The icon field takes three things:

  1. a built-in icon name — pin, lock, palette, star, flame, rocket, coin, crown, gift, medal, clock, heart, bolt… (see icon_paths());
  2. a picture in this plugin's assets/icons/ — write the file name (crown.png);
  3. an emoji (emoji:🔥).

Shipping with the plugin: highlight.png, sticky.png, bump.png, close.png, reopen.png (used by the default
catalogue) plus crown.png, potion.png, gift.png, rocket.png, medal.png ready for new items. Drop your own PNG
into plugins/tabre_props/assets/icons/ and name it in the catalogue — no upload, no settings change.

Icons: Free Icon Pack by gvesster — used under its licence (commercial use
allowed; credit appreciated). Its licence text is kept at assets/icons/LICENSE-icons.txt.

Where it shows up

  • /props — the shop and your bag (also a tile on /points and a link in the left menu);
  • Items button on the topic bar, listing what you hold (a topic you started, or any topic for a moderator);
  • Admin → Plugins → Items: hand items to a member (with a member picker), or end a running effect.

How it is put together

PieceWhere
Catalogueplugin setting items
Bagplugin_tabre_props_stock (unique on user + item)
Running effectsplugin_tabre_props_effects (with an end time)
Highlight colourtopic meta key tabre_props_highlight

Buying spends points through points_add() under the reason tabre_props, so it appears in the member's history with a
readable label and its own icon. The scheduled job (expire, every 5 minutes) ends whatever is due and clears empty bag
rows. Other plugins can listen to tabre_props.used (topic, item, effect, user).

Uninstall

Disable leaves the shop dark and the effects in place (the highlight stays until it expires). Uninstall drops the
bag and the effects table.