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)
Scam Warning
Post Reply
William959
Registered User
Posts: 15
Joined: Wed Jun 28, 2017 1:03 pm

Variable

Post by William959 » Fri May 17, 2019 4:24 am

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.

nou nou
Registered User
Posts: 328
Joined: Sat Oct 29, 2016 8:08 pm

Re: Variable

Post by nou nou » Fri May 17, 2019 5:15 am


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

Re: Variable

Post by William959 » Fri May 17, 2019 5:46 am

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?

nou nou
Registered User
Posts: 328
Joined: Sat Oct 29, 2016 8:08 pm

Re: Variable

Post by nou nou » Fri May 17, 2019 5:50 am

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
Former Team Member
Posts: 13780
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Variable

Post by 3Di » Fri May 17, 2019 5:51 am

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.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
EA117
Registered User
Posts: 643
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Variable

Post by EA117 » Fri May 17, 2019 10:28 am

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: 15
Joined: Wed Jun 28, 2017 1:03 pm

Re: Variable

Post by William959 » Fri May 17, 2019 1:05 pm

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: 643
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Variable

Post by EA117 » Fri May 17, 2019 1:27 pm

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”