SMF Versatile Post Reactions

Started by Decent_946, August 07, 2020, 11:57:15 PM

Previous topic - Next topic

shadav

just installed the update...

a few requests :) please and thank you

a way to actually edit the reactions (without having to go into the db) .... right now you can only delete and add, there's no actual way to edit them

a sort option...to pick which ones you want to show first, second, ect...so you can easily move them around

if you use different reacts that are different sizes
in sources/manageReactions.php
find
return (\'<img width="26px" height="26px" src="\'. $settings[\'default_images_url\']. \'/reactions/\'. $row[\'emoji_name\']. \'.gif" alt="\'. $row[\'emoji_title\']. \'" title="\'. $row[\'emoji_title\']. \'" />\');'
replace
return (\'<img src="\'. $settings[\'default_images_url\']. \'/reactions/\'. $row[\'emoji_name\']. \'.gif" alt="\'. $row[\'emoji_title\']. \'" title="\'. $row[\'emoji_title\']. \'" />\');'

in Themes/default/css/vreactions.css
find
.emojis img {
width: 26px;
height: 26px;
}

replace
.emojis img {
}


or if you use the same sized reacts but bigger/smaller than the ones supplied just change the 26px to whatever your sizes are

a side note ;) if you want to resize your gifs or do some other edits to them, this is a decent site that I use
ezgif.com

shadav

well I tried....
so I was looking into how to hide the reactions until a button was clicked....

going off of this: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_toggle_hide_show

I did this....but it doesn't work
maybe it'll give someone with more knowledge some ideas though

so in vreactions.css
at the end add
#reactiontab {
  width: 100%;
  margin-top: 20px;
}


in Display.template.php
not quite sure this is right
find
//versatile reactions
loadreactionemojis($message['id'], $context['user']['id']);


replace
echo '
<button onclick="reactionFunction()">React</button>
<div id="reactiontab">';
//versatile reactions
loadreactionemojis($message['id'], $context['user']['id']);
echo '
</div>';


in vreactions.js
at the end add
function reactionFunction() {
  var x = document.getElementById("reactiontab");
  if (x.style.display === "none") {
    x.style.display = "block";
  } else {
    x.style.display = "none";
  }
}


the button shows up but clicking it doesn't do anything and the reactions aren't hidden by default, which I'm assuming is because of the function code isn't working
anyways, a start for someone else to maybe play around with

camefromwpandmybb

great mod. curious though. wouldnt it be prudent to remove the "stock" like 2.1 rc3 button?

i hate wordpress, vanilla, mybb and phpbb

Diego Andrés

Quote from: camefromwpandmybb on June 10, 2021, 09:17:14 PM
great mod. curious though. wouldnt it be prudent to remove the "stock" like 2.1 rc3 button?

You could just disable it from the admin as both are different features

SMF Tricks - Free & Premium Responsive Themes for SMF.

camefromwpandmybb

i hate wordpress, vanilla, mybb and phpbb

StarredSkies

This is a fantastic mod that strays from the regular reactions modifications I see. Almost reminds me of Discord emotes. Thank you!

rusbowden

This mod killed the attachment upload button.

Once I uninstalled it, I was able to add attachments to messages again.

aegersz

#47
BTW, I got this error in the developer's tools as there were boxes saying No reactions on top of the actual Members reacted xxxx; members box without actually moving the cursor over the emojis.

Uncaught TypeError: $ is not a function
    at HTMLDocument.<anonymous> (vreactions.js:31)
    at l (jquery.min.js:2)
    at c (jquery.min.js:2)


and fixed it by changing ./Themes/default/scripts/vreactions.js (see below)

This did not happen in my vanilla 2.0.18 system but did on my very modded live system.


function loadreactions(id_msg, id_emoji, id_member, event) {
        event.preventDefault();

        id_msg = parseInt(id_msg,10);
        id_emoji = parseInt(id_emoji,10);
        id_member = parseInt(id_member,10);

        console.log(id_msg + " - " + id_emoji + " - " + id_member);

        jQuery(document).ready(function($){
                $.ajax({
                        url: smf_prepareScriptUrl(smf_scripturl) + 'action=callreactions',
                        type: 'post',
                        data: {
                                msg_id: id_msg,
                                emoji_id: id_emoji,
                                member_id: id_member
                        },
                        dataType: 'json',
                        success: function(data) {
                                $("#counts-" + id_emoji + "-" + id_msg).text(data['no_of_reactions']);
                                $("#who_reacted-" + id_emoji + "-" + id_msg).html(data['who_reacted']);
                        }
                });
        });
}

//do show who_reacted on hover and hide on hover exit.
jQuery(document).ready(function($) {
        $(".who_reacted").hide();

        $(".emojis").hover(function() {
                window.id = this.id;
                window.split_id = id.split("-");
                window.name = split_id[0];
                window.emoji_id = split_id[1];
                window.msg_id = split_id[2];
                $("#who_reacted-" + window.emoji_id + "-" + window.msg_id).show();
        },
        function() {
                $("#who_reacted-" + window.emoji_id + "-" + window.msg_id).hide();
        });
});
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

FrizzleFried

Oddly,  with my test site of 2.1.1 I can click the reaction but it does nothing.  If I right click and open in new window,  the new window has the reaction triggered...


FrizzleFried

I just installed a fresh SMF 2.1.1.... tried this mod and got the same result above.   Too bad.  If this mod (A) worked and (B) had alerts installed it would make a pretty damn good reactions mod.

Doug Heffernan

Quote from: FrizzleFried on March 29, 2022, 08:27:36 AMI just installed a fresh SMF 2.1.1.... tried this mod and got the same result above.   Too bad.  If this mod (A) worked and (B) had alerts installed it would make a pretty damn good reactions mod.

If you are looking for an alternative mod, @vbgamer45 has a post reaction mod, compatible with 2.1. and alerts as well. It is a very advanced mod. You can see it here.

https://www.simplemachines.org/community/index.php?topic=544867.0

FrizzleFried

I already own it.  :D

I'm just poking around to be honest.  I'm pretty much all in with the Awesome Post Ratings mod.

pulgoki

Does anyone know if this will ever get updated to work with 2.1.1 or if it's been abandoned?

Doug Heffernan

Quote from: pulgoki on May 05, 2022, 07:11:52 AMDoes anyone know if this will ever get updated to work with 2.1.1 or if it's been abandoned?

No one but the mod author has the answer to that. Looking at their profile, they were last active on September 30, 2021. The chances are high that this mod will not get updated to 2.1.x anytime soon, if ever imo.

FrizzleFried

If @pulgoki is open to a paid mod... SMFHacks "Awesome Post Ratings" works great.   The stock presentation is a bit bland, but it's easily modified to spiff it up a bit.

Here is what mine looks like... (note: there is supposed to be a mouse cursor there... it's not showing up in the video).

https://youtu.be/qYtqKUbx7XE

Would be happy to provide my CSS if you like what you see...

https://www.smfhacks.com/awesomepostratings.php


pulgoki

Quote from: FrizzleFried on May 05, 2022, 08:48:55 AMIf @pulgoki is open to a paid mod... SMFHacks "Awesome Post Ratings" works great.   The stock presentation is a bit bland, but it's easily modified to spiff it up a bit.

I was considering that, but would like to be able to test it before I had to purchase it. IOW, I don't want to buy it and find out that it's not going to fit our needs. That being said, I don't have any problem at all supporting someone's hard work.

Does that mod look good on a dark theme? 

Shades.

Quote from: pulgoki on May 05, 2022, 11:25:42 AM
Quote from: FrizzleFried on May 05, 2022, 08:48:55 AMIf @pulgoki is open to a paid mod... SMFHacks "Awesome Post Ratings" works great.  The stock presentation is a bit bland, but it's easily modified to spiff it up a bit.

I was considering that, but would like to be able to test it before I had to purchase it. IOW, I don't want to buy it and find out that it's not going to fit our needs. That being said, I don't have any problem at all supporting someone's hard work.

Does that mod look good on a dark theme? 
Looks good to me on my dark theme! (2nd link in my sig)

You cannot view this attachment.
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

shadav

while I do like smfhacks I went with smfpacks instead, just to give you another option
https://www.smfpacks.com/reactionsmod/
it's easy to customize for it to look good on dark themes, just use your browsers inspection tool and change the css
to give an example (keep in mind I switched out the stock images, tweaked the css and things for it to work for my needs but it's easy enough to do...same thing you could do with smfhacks or even with this versatile if it's ever updated to 2.1.x)
freethesims.com/announcements/forums-has-been-updated/
I actually have used all 3 of these mods and while I love the work that Decent_946 put into this I did need something a bit more and I didn't have the time then to flesh this out more...but this really is great start for someone to use on their own site and evolve it

FrizzleFried

Quote from: pulgoki on May 05, 2022, 11:25:42 AM
Quote from: FrizzleFried on May 05, 2022, 08:48:55 AMIf @pulgoki is open to a paid mod... SMFHacks "Awesome Post Ratings" works great.  The stock presentation is a bit bland, but it's easily modified to spiff it up a bit.

I was considering that, but would like to be able to test it before I had to purchase it. IOW, I don't want to buy it and find out that it's not going to fit our needs. That being said, I don't have any problem at all supporting someone's hard work.

Does that mod look good on a dark theme? 

With CSS you can make it look any way you want.

Here is what my dark themes look like:

Alien Shades...

You cannot view this attachment.

Fusion...

You cannot view this attachment.

Curve2 (Dark via the mod)...

You cannot view this attachment.

Blue Space...

You cannot view this attachment.

Of course they are all "dimmed" and each icon is brighter (and zooms slightly) on mouseover...   

FrizzleFried

I see I could tweak the padding a little on the right for both the alien and blue themes ...

;)

Advertisement: