News:

SMF 2.0.19 has been released! Please update. Read more.

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



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/

Advertisement: