[OzzModz] Separate Phrases For Like And Reaction

[OzzModz] Separate Phrases For Like And Reaction 2.0.0

No permission to download

Ozzy47

Well-known member
ozzy47 submitted a new resource:

[OzzModz] Separate Phrases For Like And Reaction - Seperate phrases for reaction and like.

Another addon brought to you by:
View attachment 202185

This small addon will add a separate phrase for the reaction menu. So instead of it saying "Like" it now says "React". The phrase is changeable and translatable by editing the phrase, ozzmodz_reactionlike_react. This addon is for XF2.1 and above.

View attachment 202186

There are no settings for the addon.

Special thanks to @Bespoke...

Read more about this resource...
 
@Mr Lucky @Case @John we @Nikodak @kelle67 @Bimble @Walter @Masetrix @Nirjonadda @manicomio @maszd @Matthew S @sub_ubi @Laron you might find this addon useful to you, It does what is requested.
 
Hello @ozzy47

Here, however, seems to be a misunderstanding.
As I see so far, your addon does nothing but XF already does it.

What I first need would be 2 phrases. 1.) "Rate"(React) and 2.), change to "Rated"(Reacted) after clicking on a value.

Then a value should not be assigned directly with a click on "Rate"(React), but only the tooltip menu should be opened where the users can then assign a "rating".

(Google Translating...)
 
No XF does not do it. The current phrase "Like" is used for the menu and the like reaction. This uses a phrase React for the menu, and leaves the like reaction as like.

Edit: here is a screenshot.
reactbutton2.webp
 
Last edited:
Perfect! You have achieved absolutely what you wanted to achieve. :D And it works great!

If you could extend the addon now so that when clicking or (Mobile) when tapping on "React" is not equal to a value, but only the "Tooltip" open where you can then give a reaction that would be a nice birthday gift (16.05.2019)

For other users:

Now the phrase "reaction_title.1" is for the first reaction in the "ReactionTooltip" and the phrase "ozzmodz_reactionlike_react" applies to whatever you want to have instead of "like" in the postings.
 
Last edited:
If you could extend the addon now so that when clicking or (Mobile) when tapping on "React" is not equal to a value, but only the "Tooltip" open where you can then give a reaction that would be a nice birthday gift (16.05.2019)

I would absolutely love this, it's how Discord works.
 
PHP:
 public function fnReact($templater, &$escape, array $config)
    {
        $parent = parent::fnReact($templater, $escape, $config);

        $pattern = '#<span class="reaction-text js-reactionText">(.*)</span>#U';

        $replace = '<span class="reaction-text js-reactionText"><bdi>' . \XF::phrase('ozzmodz_reactionlike_react') .'</bdi></span>';

        $output = preg_replace($pattern, $replace, $parent);

        return $parent;
    }
And what is the meaning of this supplement? Here we just allocated memory to variables and use it all the time 1 time. Yes, php has become smarter, but they promised to optimize the JIT compilation only with php 7.4, and so it was no time to allocate memory for variables. In addition, it is a concatenation of strings in the place where it should not be. I hope you heard about "" where she accepts an identifier or code without any problems.
 
@nocte seem to feel this is the proper way to do it
I cannot guarantee that it is the proper way of doing what you want to achieve, but at least it seems to be the proper way to extend the fnReact() method ;) There may be other approaches, but the current one is the nearest to what you wanted to do first in the thread you linked above.
 
Hello Ozzy, I found the small bug.
If I withdraw my reaction, so the first reaction string is displayed again.
It I reload the web page, then it's fine.

See video ("Ohodnotiť príspevok" is Set reaction phrase text for OzzoMod)

My solution proposal:
After I set reaction via hover tooltip: button text === reactionIDPharseText (it's fine until i reload the web page)
After I click the button === reactionDefaultPharseText (it's fine until i reload the web page)
If I unset my reaction === button text is OzzoModText (this works only when i reload the website)
 
Back
Top Bottom