MyBB Community Forums

Full Version: [REQ] Insert username in threads/posts.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi, I've looked for this everywhere, I'm sure it's possible to do it in MyCode :
I'm looking for a code that will insert your username in the post or topic you are reading, just like your name is inserted in the header ("Welcome back, AliaErenel.") but inside a thread.

Something like this :
Quote:This is an important invitation ! Hi {username}, how would you like to do that ?
Where {username} would be replaced by your own username.

I'm managing a roleplaying forum and it would be nice if members could use that code to enhance their story, announcements, and to get the reader's attention.

Hopefully it can be done, thank you for everything !
You can't do this with MyCode.

You would need a plugin.
Check out my advanced mycode permissions plugin, you will then be able to create a mycode that does this.
Dang... I thought it would be quite easy to do. I don't know how to write plugins at all.

Thank you for your answers !
(2010-09-14, 03:56 PM)Jammerx2 Wrote: [ -> ]Check out my advanced mycode permissions plugin, you will then be able to create a mycode that does this.

Have you ever tried to do it ? I'd like to know what you have in mind, suggesting your plugin Smile.
Make sure my advanced mycode permissions plugin is installed, which can be found at the following link.

http://mods.mybb.com/view/advanced-mycode-permissions

Create a new mycode, set the regular expression to something like \[username\] and the replacement to {$mybb->user['username']}.
(2010-09-15, 07:26 PM)Jammerx2 Wrote: [ -> ]Make sure my advanced mycode permissions plugin is installed, which can be found at the following link.

http://mods.mybb.com/view/advanced-mycode-permissions

Create a new mycode, set the regular expression to something like \[username\] and the replacement to {$mybb->user['username']}.

I see. Thank you, I'll try it asap.
(2010-09-15, 11:22 PM)AliaErenel Wrote: [ -> ]
(2010-09-15, 07:26 PM)Jammerx2 Wrote: [ -> ]Make sure my advanced mycode permissions plugin is installed, which can be found at the following link.

http://mods.mybb.com/view/advanced-mycode-permissions

Create a new mycode, set the regular expression to something like \[username\] and the replacement to {$mybb->user['username']}.

I see. Thank you, I'll try it asap.

Excellent ! It is working fine. Very useful plugin, thank you very much.
Thanks, this works perfectly. How would I go about getting this to work in a shoutbox though?
Hmm, Didn't work for me. I got an error message that flashes up when I saved the my code. Using a trusty print screen it is some kind of function implode, which is above my levels of understanding. Attached a screenshot if it might be useful.

When I test it in your test box it comes up with the {$mybb->user['username']} in the html and in the display.
(2010-10-09, 01:47 AM)vash Wrote: [ -> ]Hmm, Didn't work for me. I got an error message that flashes up when I saved the my code. Using a trusty print screen it is some kind of function implode, which is above my levels of understanding. Attached a screenshot if it might be useful.

When I test it in your test box it comes up with the {$mybb->user['username']} in the html and in the display.

I will fix that error in the next update, for now just select all groups for who can view.
Hmm... I still cant get it to work. I presume mybb refers to the database prefix? If I have changed this and replaced mybb with the new database prefix should it work of is there a setting inside the php which I also need to change?
Pages: 1 2