News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

SMF Versatile Post Reactions

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

Previous topic - Next topic

Decent_946

Link to the mod



SMF Versatile Post Reactions
Developed by Assadullah Shaikh AKA Decent_946



About Mod:

This mod adds animated reaction emojis/smileys below every post of a topic. It allows users to show their reaction towards the post by clicking the emoji. By hovering over the emoji, you can view the list of users who have reacted to the post with selected reaction. Reaction count is also displayed alongside each emoji separately.



Credits:

I pay my special credits to @Arantor for helping me in solving queries and errors of the mod. :)

The mod is Inspired by: Awesome Post Ratings and SMFPacks Reactions Mod.



Features and Options

Users:
-Only registered member's can react to the post.
-A user can react with multiple reactions on same post.


Admins:
-Edit, Add and Remove Reaction Emojis with via Admin Panel.
-Allow/Disallow a member to revert their casted reaction

Admin Tabs:
Admin -> Forum -> VReactions:
  • General - Contains the Mod information and tools used.
  • Edit Reactions - Contains the list of available Reaction smileys. Allows you to delete any reaction.
  • Add Reactions - Allows you to add new reaction by uploading a new .gif image file.

*Note: Currently, only .gif file is allowed to be uploaded.

Admin -> Configuration-> Modification Settings:
    Check: Allow members to revert their reaction.



Github:
Source Files.


Changelog:

09/08/2020 - v1.1
-Fixed a bug reported by Shadav. Now it deletes the checked emojis.

12/08/2020 - v1.2
-Updated the mod. Now Administrator can enable/disable whether members can revert their vote or not.

12/08/2020 - v1.2
-Fixed a bug upon reverting a reaction.
-Altered the CSS to have a proper layout

06/09/2020
-Fixed a bug reported by njtweb which caused overwriting of other mod options. If one has lost some options from Miscellanous, users are requested to re-install.


License: Mozilla Public License 2.0


Screenshots: https://imgur.com/a/mnmXBA1
Thankx to RebellioN

shadav

looks good
would be nice to be able to edit the existing ratings :) instead of deleting and readding them

as well in display.template.php

to hide the ratings from guests and topic author (kind of silly to rate your own posts  :P )
find
//versatile reactions
loadreactionemojis($message['id'], $context['user']['id']);

replace with
//versatile reactions
if ($user_info['is_guest'] == false && !$message['is_message_author'])
{
loadreactionemojis($message['id'], $context['user']['id']);
}


hm ok if you do that then you can't see the rating results....hm....

so then maybe a way to not allow topic author to rate own post but still display how many and who rated their posts....

thank you for this mod :) and great work

shadav

found a bug

when deleting a reaction, it doesn't delete the selected one, it deletes whatever the last one is
so if i'm trying to delete id 1 and there's a total of 8 reacts
I click on delete for id 1, but id 8 gets deleted, if i click on id 1 again, id 7 gets deleted....

Decent_946

Quote from: shadav on August 08, 2020, 02:36:23 AM
found a bug

when deleting a reaction, it doesn't delete the selected one, it deletes whatever the last one is
so if i'm trying to delete id 1 and there's a total of 8 reacts
I click on delete for id 1, but id 8 gets deleted, if i click on id 1 again, id 7 gets deleted....
Umm, looks like the last change made it happen. Will be fixing it soon.

Thank you for debugging! :-)
Thankx to RebellioN

KittyGalore

Quote from: shadav on August 08, 2020, 02:36:23 AM
found a bug

when deleting a reaction, it doesn't delete the selected one, it deletes whatever the last one is
so if i'm trying to delete id 1 and there's a total of 8 reacts
I click on delete for id 1, but id 8 gets deleted, if i click on id 1 again, id 7 gets deleted....
Yes you can't remove any reaction it stays there.
SMF Curve 2.0x

AlanDewey

I just installed it.   

I like it !
Causing lots of electrons to push each other around since 1985.

-Rock Lee-

It seems interesting I will try to see what I find too, great job :)!


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Decent_946

Quote from: shadav on August 08, 2020, 02:36:23 AM
found a bug

when deleting a reaction, it doesn't delete the selected one, it deletes whatever the last one is
so if i'm trying to delete id 1 and there's a total of 8 reacts
I click on delete for id 1, but id 8 gets deleted, if i click on id 1 again, id 7 gets deleted....
Fixed. The mod now uses checkboxes instead of buttons to delete the emojis.

Once again thank you everyone for your feedback! :)


Next update would be; move up/down the emojis. So that one can place the emoji's in the order they want.




Quote from: shadav on August 08, 2020, 01:46:20 AM
so then maybe a way to not allow topic author to rate own post but still display how many and who rated their posts....
I can disallow the post author to rate. But here I'm following discord settings a bit. :P Thus, I've kept it this way.
Thankx to RebellioN

SychO

By the way, If you're gonna make more mods in the future, I would recommend you don't group all of your mods in one single repository, It's always better to have each mod in its own repository.

Otherwise, nice mod :)
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

KittyGalore

Quote from: Decent_946 on August 09, 2020, 05:44:35 AM
Quote from: shadav on August 08, 2020, 02:36:23 AM
found a bug

when deleting a reaction, it doesn't delete the selected one, it deletes whatever the last one is
so if i'm trying to delete id 1 and there's a total of 8 reacts
I click on delete for id 1, but id 8 gets deleted, if i click on id 1 again, id 7 gets deleted....
Fixed. The mod now uses checkboxes instead of buttons to delete the emojis.

Once again thank you everyone for your feedback! :)


Next update would be; move up/down the emojis. So that one can place the emoji's in the order they want.




Quote from: shadav on August 08, 2020, 01:46:20 AM
so then maybe a way to not allow topic author to rate own post but still display how many and who rated their posts....
I can disallow the post author to rate. But here I'm following discord settings a bit. :P Thus, I've kept it this way.
I still can't remove a reaction from either admin account or a regular member. On a post i press on the emoji and it goes from 0 to 1 but then when i go and press on it again it doesn't remove it and go back to 0 where can you remove the reaction can you provide some screenshots.
SMF Curve 2.0x

vicram10


Decent_946

#11
Quote from: KittyGalore on August 09, 2020, 08:33:31 AM
I still can't remove a reaction from either admin account or a regular member. On a post i press on the emoji and it goes from 0 to 1 but then when i go and press on it again it doesn't remove it and go back to 0 where can you remove the reaction can you provide some screenshots.
This is how the mod is intended to work. As for Shadav, she actually meant "deleting the reaction emoji entirely" via Admin section instead of removing the casted reaction to the post.

I haven't added revert the reaction function in the mod with a mindset that people can react to multiple emoji's. And, while developing this was suggested from my mates that it's better to allow members vote only. But as per your request, I'll add an option in admin section to allow/disallow members to revert their reaction upon re-clicking the reacted emoji.
Thankx to RebellioN

shadav

Quote from: Decent_946 on August 09, 2020, 10:11:54 AM
Quote from: KittyGalore on August 09, 2020, 08:33:31 AM
I still can't remove a reaction from either admin account or a regular member. On a post i press on the emoji and it goes from 0 to 1 but then when i go and press on it again it doesn't remove it and go back to 0 where can you remove the reaction can you provide some screenshots.
This is how the mod is intended to work. As for Shadav, he actually meant "deleting the reaction emoji entirely" via Admin section instead of removing the casted reaction to the post.

I haven't added revert the reaction function in the mod with a mindset that people can react to multiple emoji's. And, while developing this was suggested from my mates that it's better to allow members vote only. But as per your request, I'll add an option in admin section to allow/disallow members to revert their reaction upon re-clicking the reacted emoji.
*cough, checks gender...nope...  :laugh: :P *
but yeah I was referring to deleting the actual emoji/react

but it would be nice to be able to revert a vote....as I don't know how many times I misclick....don't need to be accidently laughing at a sad post  :-[ :P

and again thanks for the mod

pocttopus

Nice mod but I can't change the background color, now it's transparent and it's messing with signatures.  :-[


Decent_946

Quote from: pocttopus on August 09, 2020, 11:45:16 AM
Nice mod but I can't change the background color, now it's transparent and it's messing with signatures.  :-[
The background color is actually the color for windowbg2 in your index.css file. I noticed some themes have this transparent for some reason. You can override the settings by visiting Admin => Configuration > Current Theme: Click Modify stylesheets and choose index.css. There you can find windowbg2 and give it a background color very relative to your themes wrapper color to make it look appealing.




Quote from: SychO on August 09, 2020, 06:21:07 AM
By the way, If you're gonna make more mods in the future, I would recommend you don't group all of your mods in one single repository, It's always better to have each mod in its own repository.
I'll follow this.



Quote from: shadav on August 09, 2020, 10:46:33 AM
*cough, checks gender...nope...  :laugh: :P *
Hehe. Fixed ;D
Thankx to RebellioN

efk

Cool idea, this will be interesting. Can anyone add 1 full screenshot of post since it is not possible to see how does it look in action.
Also can we expect .png to be supported in near future?
Have 1 idea, since we don't want on every forum and on every post to be displayed entire list of smileys/emojis which can be considered as forum-self-spam and boring for users to scroll more just because entire list of emojis is shown in every single post, can you make it be hidden under single smiley or something like that and expanded on click, of course already used emoji/smiley should be displayed, or even option could be there as well to expand used options.

shadav

hm...I mean you could maybe do something more like how fb does and have the reacts in a hover/popup effect....

i don't mind them showing up on every post (another forum I'm active in has it this way and it's not that intrusive, however they use small reacts 16px in size)

as for using png instead of gif, i'd imagine that you could just change all instances of gif to png should work....just you can only use one or the other, not both....

shadav

#17
Quote from: efk on August 09, 2020, 04:11:52 PMCan anyone add 1 full screenshot of post since it is not possible to see how does it look in action.
there are some screenshots on the download page but :)

here is of the new version
keep in mind I've changed all of the react images to my own (though I kept the thumbs up and thumbs down one, just resized them to be smaller)
as well as removed the sizes from the image codes, so the reacts show up in their normal sizes...resized everything to be the same height as to not cause issues....this way the few that are wider than others can still show up properly....

admin


post with no reacts
I've added an opacity to the images, so they become brighter when hovered over


post with reacts
I removed the position: absolute; to help with the signature overlay issue, now it just bumps the signature down to display who reacted

efk

Thanks shadav. As I thought displaying all in every post is not good. 1 button to hide it before user click can do the job.

Decent_946

Update: 12/08/2020
-Added a mod setting to allow/disallow users from reverting their reaction. Can be found under Admin-> Configuration -> Modification Settings.
-Updated the topic and added some screenshots.
I was wondering if I could attach images into the first post. But I'm unable to. Thus. I've added a link to imgur.



Now I can move on to its discussion.

Quote from: efk on August 09, 2020, 04:11:52 PM
Have 1 idea, since we don't want on every forum and on every post to be displayed entire list of smileys/emojis which can be considered as forum-self-spam and boring for users to scroll more just because entire list of emojis is shown in every single post, can you make it be hidden under single smiley or something like that and expanded on click, of course already used emoji/smiley should be displayed, or even option could be there as well to expand used options.
I appreciate your feedback. As I've mentioned in the first post that the mod is inspired by two previously present mods. You may think of it as a mod without PRO tag. The reason I created this mod is quite understandable. Most of the users ask about reactions mod. The communities I manage, their was a huge demand. As there wasn't any free mod, I decided to develop a simple version. However, I'll add another section named [More](x reactions) near the current reaction emojis. Which will show up more emojis on hovering as per your suggestion.

Truly speaking, I had set my mind that it'll be the simples version of reactions mod. But, I'm much motivated to see the feedback and mod ranked in most Popular Mods.


Side note: In the general section of mod, I've mentioned if one needs any additional feature can pm me, I'll develop specifically for paid.



Quote from: shadav on August 09, 2020, 05:26:18 PM
keep in mind I've changed all of the react images to my own (though I kept the thumbs up and thumbs down one, just resized them to be smaller)
as well as removed the sizes from the image codes, so the reacts show up in their normal sizes...resized everything to be the same height as to not cause issues....this way the few that are wider than others can still show up properly....
Looks good. the reason I kept it of the present size;
-The emojis are animated. At 16px, it was too small to notice the animation. Because the emoji's I chose are of dynamic type. I can see the emoji's you have added can be seen properly because these are designed of that size.
-Other mods that use 16px have static emojis and there reaction count is in form of a list. It shows like: Image (name)...... (list) which already takes up good space. Thus, I used tooltip to let users view the title.

Quote from: shadav on August 09, 2020, 05:26:18 PM
post with no reacts
I've added an opacity to the images, so they become brighter when hovered over
It's a good modification on user hand. I'd still choose the current view of the emojis. Opacity can be affected on different themes. Not everybody uses dark colored theme.

Quote from: shadav on August 09, 2020, 05:26:18 PM
post with reacts
I removed the position: absolute; to help with the signature overlay issue, now it just bumps the signature down to display who reacted
I wouldn't recommend it though. I made it absolute thinking a scenario; if an emoji is reacted with 100x reactions. It'll break the view of the forum.



Once again, thank you everyone for your feedback! :)
Thankx to RebellioN

Advertisement: