MyBB Community Forums
[REQ] Insert username in threads/posts. - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Resources (https://community.mybb.com/forum-8.html)
+--- Forum: MyCodes (https://community.mybb.com/forum-117.html)
+--- Thread: [REQ] Insert username in threads/posts. (/thread-78257.html)

Pages: 1 2


[REQ] Insert username in threads/posts. - AliaErenel - 2010-09-13

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 !


RE: [REQ] Insert username in threads/posts. - Nathan Malcolm - 2010-09-13

You can't do this with MyCode.

You would need a plugin.


RE: [REQ] Insert username in threads/posts. - Jammerx2 - 2010-09-14

Check out my advanced mycode permissions plugin, you will then be able to create a mycode that does this.


RE: [REQ] Insert username in threads/posts. - AliaErenel - 2010-09-15

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.


RE: [REQ] Insert username in threads/posts. - Jammerx2 - 2010-09-15

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']}.


RE: [REQ] Insert username in threads/posts. - AliaErenel - 2010-09-15

(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.


RE: [REQ] Insert username in threads/posts. - andeekaii - 2010-09-16

Thanks, this works perfectly. How would I go about getting this to work in a shoutbox though?


RE: [REQ] Insert username in threads/posts. - vash - 2010-10-09

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.


RE: [REQ] Insert username in threads/posts. - Jammerx2 - 2010-10-09

(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.


RE: [REQ] Insert username in threads/posts. - vash - 2010-10-13

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?