Variable

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Get Involved
Post Reply
William959
Registered User
Posts: 33
Joined: Wed Jun 28, 2017 1:03 pm

Variable

Post by William959 »

Hello.

I would like to create a room called {USERNAME}, but I do not even know where to start.
I want to create a BBCODE, but I do not want my BBCode to follow a pattern that is: [user]{TEXT}[/user], I would like my BBCode to be only {USERNAME}. I want when someone types the {USERNAME} variable in the topic, it appears and shows the name of who is reading that topic.
Exemple:

Code: Select all

Hi {USERNAME}!

This is an explanatory topic, etc, etc, etc...
And it will look like this to anyone who reads, suppose you are the Master User.

Code: Select all

Hi Master User!

This is an explanatory topic, etc, etc, etc...

How can I do this? My version of phpBB is the latest one.
User avatar
nou nou
Registered User
Posts: 505
Joined: Sat Oct 29, 2016 8:08 pm

Re: Variable

Post by nou nou »

William959
Registered User
Posts: 33
Joined: Wed Jun 28, 2017 1:03 pm

Re: Variable

Post by William959 »

nou nou wrote: Fri May 17, 2019 5:15 am Ta-daa!

viewtopic.php?f=456&t=2511516

:)
Okay, that's what I was looking for, thank you very much.
But I have some doubts, from this post, a discussion about overloads begins when using JavaScript. Would there be a way to not overload the forum with this extension? Instead of using JavaScript to use PHP itself, or make the changes that it suggested? I do not understand much, could you explain and give me a solution to such doubts?
Another thing, I would like to hide the button that was generated as BBCode and wanted to exchange [username] for {USERNAME} is it possible?
User avatar
nou nou
Registered User
Posts: 505
Joined: Sat Oct 29, 2016 8:08 pm

Re: Variable

Post by nou nou »

Best to post these questions in the actual extension topic so the author can answer.

As for overload, I have not seen an issue with that during testing. That said, the extension is still in development so always tread with care... ;)
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Variable

Post by 3Di »

Using tokens {USERNAME} in the posting area instead of bbcodes [username] can be done via an extension, yes.
Which I think it is the best solution, so to avoid such JS at all.. just a thought though.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
EA117
Registered User
Posts: 2159
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Variable

Post by EA117 »

William959 wrote: Fri May 17, 2019 5:46 am But I have some doubts, from this post, a discussion about overloads begins when using JavaScript.
That question was not intended to give you any doubts about whether it would be appropriate or safe to use this extension. It was just "a programmer's question" about whether an optimization to the code would be appropriate or beneficial. Meaning the extension worked great for me exactly as it was, and my question was about whether the described code change might make it work even better.

For easily including the username as quickly and easily as you refer to any other BBCode, I think it's a really useful solution. The only reason I'm not running it is because I needed a different piece of information, not "username".
William959
Registered User
Posts: 33
Joined: Wed Jun 28, 2017 1:03 pm

Re: Variable

Post by William959 »

Oh yes, thank you for clarifying me.

What part of the code do I edit to switch [username] to {USERNAME}? Thank you!
User avatar
EA117
Registered User
Posts: 2159
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Variable

Post by EA117 »

William959 wrote: Fri May 17, 2019 1:05 pm What part of the code do I edit to switch [username] to {USERNAME}? Thank you!
I believe that 3Di was describing the creation of a different kind of extension that would handle insertion of the username using a non-BBCode-dependent mechanism.

For the current BBCode Username extension, you would have to use [username], same as the syntax of any BBCode. There is not an option or a simple change you could make in the current extension to "use {username} instead", because it's actually phpBB's own BBCode system that imposes this syntax.
Post Reply

Return to “Extension Requests”