News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Thanks for SMF 2.1

Started by GL700Wing, May 19, 2022, 07:25:39 PM

Previous topic - Next topic

GL700Wing

Link to the mod

Thanks for SMF 2.1

This mod is a 'Thanks' version of the 'Likes' feature that is a standard part of SMF 2.1.

For those who want/need a 'Thanks' feature, it provides a consistent look/feel and the same functionality the default SMF 2.1 'Likes' feature.

Notes:
All the source code for this mod is derived from the SMF 2.1 'Likes' system.
Apart from replacing the 'Like' word with the equivalent 'Thank' word the only other source code changes are as follows:
1. Configure an icon for the 'Thank' action/alert and an icon for the 'Unthank' action; and
2. Configure extra spacing to the left of the 'Thank' button in a message if the 'Likes' feature is also enabled.



Release History:
1.0 - 13-May-22
o Initial Release with support only for SMF 2.1.2

1.1 - 26-May-22
o As per this message specified resources in 'db-install.php' to enable mod to install on large forums.
o Fixed bug in './Themes/default/scripts/topic.js' that prevented 'Quick Edit' feature from working.

1.2 - 19-Jun-22
o As per this message fixed issue of incorrect thank/unthank icons being displayed and of thank/unthank text/icon not maintaining left spacing in relation to the like/unlike text/icon.




License
Copyright 2022 Kathy Leslie

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Life doesn't have to be perfect to be wonderful ...

gevv

Hi, thanks @GL700Wing

I think it will be very difficult to install in the big forum.

I tried (my pc wampserver) 4 minutes later, the white page opened,

index.php?action=admin;area=packages;sa=install2;package=Thanks_for_SMF21_v1.0.zip;pid=0

the mod was not installed (didn't create error log)

ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

GL700Wing

Quote from: gevv on May 20, 2022, 03:00:49 PMI think it will be very difficult to install in the big forum.

I tried (my pc wampserver) 4 minutes later, the white page opened,

index.php?action=admin;area=packages;sa=install2;package=Thanks_for_SMF21_v1.0.zip;pid=0

the mod was not installed (didn't create error log)
The mod installation makes some database changes (ie, creates the 'user_thanks' table, adds a 'thanks' column and index to the 'messages' table, and adds a 'msg_thank' row to the alerts table) and I suspect that on a large forum  a timeout is occurring then the 'messages' table is being updated.

I've attached a replacement db_install.php file to which I've added the following lines before any changes are made to the database:
// Secure some resources
@set_time_limit(600);
@ini_set('mysql.connect_timeout', -1);
@ini_set('default_socket_timeout', 900);
@ini_set('memory_limit', '512M');

I've used the same values that are in the 'upgrade'php' file that is run when a forum is upgraded from SMF 2.0 to SMF 2.1 - you may need to adjust these values if you used different values when upgrading or if you still get timeout issues when installing this mod (you may need to check/adjust the corresponding timeout values configured in cPanel as well).
Life doesn't have to be perfect to be wonderful ...

gevv

Thanks @GL700Wing  Adding code worked. It took a while, but it was installed and working without any problems.
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

GL700Wing

#4
Version 1.1 - 25-May-22
o As per this message specified reources in 'db-install.php' to enable mod to install on large forums.
o Fixed bug in './Themes/default/scripts/topic.js' that prevented 'Quick Edit' feature from working.


Note: Upgrade option for v1.0

@gevv - FYI
Life doesn't have to be perfect to be wonderful ...

Steve

Will this give an alert like the 'like' feature?
Please do not PM me for support.

GL700Wing

Quote from: Steve on June 18, 2022, 01:28:48 PMWill this give an alert like the 'like' feature?
Yes.

All the source code for this mod is derived from the SMF 2.1 'Likes' system.
Apart from replacing the 'Like' word with the equivalent 'Thank' word the only other source code changes are as follows:
1. Configure an icon for the 'Thank' action/alert and an icon for the 'Unthank' action; and
2. Configure extra spacing to the left of the 'Thank' button in a message if the 'Likes' feature is also enabled.
Life doesn't have to be perfect to be wonderful ...

Steve

I read all that in your initial post lol ... just wanted to be sure it gave an alert. Thanks GL.  :)
Please do not PM me for support.

GL700Wing

Quote from: Steve on June 18, 2022, 07:10:40 PMI read all that in your initial post lol ... just wanted to be sure it gave an alert. Thanks GL.  :)
Yep - I have tested and confirmed that the alerts are generated!
Life doesn't have to be perfect to be wonderful ...

Steve

It installed without a hitch and works but there a couple of issues.

The 'Thank' icon and text move when clicked and again when unthanked. A refresh shows it in the original position.

If you click 'Thank', then 'Unthank', then 'Thank' again, another refresh is needed to show it in the correct spot instead right next to 'Like'.

When 'Thank' is clicked a thumb down appears in order to unthank. However, if you refresh after clicking 'Thank', the thumb down becomes a red x.

It's getting late so I can give you screenshots of what I'm talking about in the morning if you want them.
Please do not PM me for support.

GL700Wing

#10
Quote from: Steve on June 18, 2022, 07:41:52 PMIt installed without a hitch and works but there a couple of issues.

The 'Thank' icon and text move when clicked and again when unthanked. A refresh shows it in the original position.

If you click 'Thank', then 'Unthank', then 'Thank' again, another refresh is needed to show it in the correct spot instead right next to 'Like'.

When 'Thank' is clicked a thumb down appears in order to unthank. However, if you refresh after clicking 'Thank', the thumb down becomes a red x.

It's getting late so I can give you screenshots of what I'm talking about in the morning if you want them.
Thanks for the feedback.

The icons for the 'thank'/'unthank' actions are a tick and a cross/X so I don't understand why the thumb up/down icons are coming into play or why a refresh is sometimes needed for stuff to display correctly.  These issues didn't occur when I was testing the mod but it could be related to a different browser/OS to what I'm using - I'll have to check the Javascript again ...

PS:  Confirmed and found cause of thumbup/thumbdown  icon issue and text/icon moving - working on a fix now ...
Life doesn't have to be perfect to be wonderful ...

GL700Wing

Version 1.2 - 19-Jun-22
o As per this message fixed issue of incorrect thank/unthank icons being displayed and of thank/unthank text/icon not maintaining left spacing in relation to the like/unlike text/icon.


Note: Upgrade option available for v1.0 and v1.1

@Steve - thanks for reporting the issues and apologies for not identifying them during original testing.

Life doesn't have to be perfect to be wonderful ...

Steve

No worries GL. That's what you have us for, to find things that may have gotten missed.  ;D

Works beautifully now.
Please do not PM me for support.

sevamaster

Hello,
Tell me please, doesn't your mod conflict with "Pretty URLs" mod?

I have not install your mod yet. But I have that conflict with "Say Thanks" mod.

So, I want to know if I will not get the same result with your mod.

Thank you.

Steve

To be honest, it's not the mod author's responsibility to ensure that their mod doesn't conflict with any other. Conflicts can be reported and they may take a look at why.

In your case, backup your forum, uninstall the Say Thanks mod if you haven't already and try installing this one. I had errors with the Say Thanks mod (no offense to that mod's author) but this one works perfectly.
Please do not PM me for support.

Advertisement: