MyBB Community Forums

Full Version: Add shortcodes like WordPress
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want shortcodes like:

[username] — retrieves user's (reader) username
[name] — retrieves user's  (reader) name

,etc.

in threads.

This is needed because I can have quizes using the repopulate function (by link).
I'm kind of on the fence for this one. On one hand we do support /me which is similar since it parses as the author. On the other hand, this is not something I'd expect a lot of forums to need and could be achieved by hooking to parse_message.
I'm on mobile, so I can't link to it, but there is a plugin called All Id that does something similar. It lets you easily link to the profiles by putting the username in brackets, like [jshort]. I've added a few extra codes myself for my forums, so adding one to get the author's information would be easy. This doesn't belong in the core though. It has a small use case and can add a bunch of queries to a page call (if done how this plugin does it). It's good for a plugin though.
(2015-06-11, 12:51 PM)jshort Wrote: [ -> ]I'm on mobile, so I can't link to it, but there is a plugin called All Id that does something similar.

Is it for MyBB v1.8?

I can't find it. Sad

[attachment=34426]

(2015-06-11, 12:35 PM)dragonexpert Wrote: [ -> ]I'd expect a lot of forums to need and could be achieved by hooking to parse_message.

In threads? Huh If yes, can you elaborate/guide me? Smile
It's for 1.6. It works just fine with you change the compatibility line to 18* though.

http://mods.mybb.com/view/all-id-mycode
(2015-06-11, 02:35 PM)jshort Wrote: [ -> ]http://mods.mybb.com/view/all-id-mycode

Hmm, indeed very similar but unfortunately doesn't help me. Sad


If it fine if I create my own MyCode to accomplish this?