Advertisement:

Author Topic: Say Thanks  (Read 106847 times)

Offline Romanj

  • Semi-Newbie
  • *
  • Posts: 12
Re: Say Thanks
« Reply #400 on: February 28, 2017, 03:40:08 PM »
I've tested and compared several similar mods. This one appeared best for my needs. Good, simple and stable (at least seems stable).
I'm going to use it on a working project. So I keep in mind there is a chance some day in future I'll move to SMF 2.1 hopefully.
Thanks (or likes) it is a kind of user data. It is a good idea to keep them while moving to a new engine version.

I dont know will this mod be available for 2.1 or not. So I want to make sure I will able to convert this "thanks" to inbuilt "likes" of 2.1.
I've checked and compared database tables for thanks of this mod and inbuilt 2.1 likes system. I found they are pretty much similar.

Say Thanks main table "smf_messages_thanks" columns:
id_msg   |   id_member

SMF 2.1 likes main table "smf_user_likes" columns:
content_type   |   content_id   |   id_member   |   like_time

id_msg = content_id. "content_id" - contains "msg" for all messages.
The only difference - in 2.1 there is additional column - time_like. The time when like was given.
So I'd like to save this data while using Say Thanks mod. With this I would have full data needed for 2.1 convertation in some future.

How to record "like_time" to DB:
Please tell me if this code is correct. I've checked and it works fine. Though I'm not a php-mysql pro, so I don't know if this 100% correct.

in SayThanks.php find:
Code: [Select]
$smcFunc['db_insert']('ignore' ,
'{db_prefix}messages_thanks',
array(
'id_msg' => 'int', 'id_member' => 'int'
),
array(
$msg, $user_info['id']
),
array('id_msg','id_member')
);

replace with:
Code: [Select]
$smcFunc['db_insert']('ignore' ,
'{db_prefix}messages_thanks',
array(
'id_msg' => 'int', 'id_member' => 'int', 'like_time' => 'int'
),
array(
$msg, $user_info['id'], time()
),
array('id_msg','id_member','like_time')
);

Column "like_time" at "smf_messages_thanks" table could be created manually with phpMyAdmin. Or by changing code at add_settings.php before first installation.


Ideas for author of this beautiful mod, how to make it even better:

- If you also add time of thanks column, it would be possible to add "most thanked post of the day" or "most thanked post of the week" functions.
- Ability to choose the groups of users who can and can't give thanks. Just to prevent manipulations when "fake" users with no posts give a lot of thanks.

Offline pocttopus

  • Jr. Member
  • **
  • Posts: 215
    • @pocttopus on Twitter
Re: Say Thanks
« Reply #401 on: March 20, 2017, 05:53:05 AM »
Hello folks,

I have an issue with this mod and I want to fix it. Forum version: 2.0.13 Mod version: 1.3.6
The mod is working actual, but in the administration panel it says that I can only delete the files from the server and there is red notification.
I went to delete it and again to install from beginning, but after that I need to replace some code in the "Profile.template.php" file.

The issue is that the code is not there to be replaced. Here is what I need to do:



How can I solve this because I am making a migration of the forum to other host. When I run the forum locally the posts are missing. For now, I want to fix the issues when I am going to contact the support of the new host.
Code: [Select]
« Reply #1460 on: March 08, 2017, 09:13:24 am »

Fatal error: Class 'SayThanks' not found in D:\xampp\htdocs\smf\Sources\Load.php(2266) : eval()'d code on line 460

Offline aetherdan

  • Semi-Newbie
  • *
  • Posts: 12
Re: Say Thanks
« Reply #402 on: March 22, 2017, 06:06:39 AM »
Hi,

Would like to report a bug, can grant myself unlimited likes.

Code: [Select]
index.php?action=thank;msg=3580;member=273;topic=88
change the "msg=3580" to any number and continuously get thanks.

Tested it out and it will even work for post that haven't even been created yet.

Offline aetherdan

  • Semi-Newbie
  • *
  • Posts: 12
Re: Say Thanks
« Reply #403 on: March 30, 2017, 03:21:26 AM »
I assume this mod is no longer supported.

Offline pocttopus

  • Jr. Member
  • **
  • Posts: 215
    • @pocttopus on Twitter
Re: Say Thanks
« Reply #404 on: March 30, 2017, 03:56:24 AM »
I assume this mod is no longer supported.
I think you're right!  :(

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 408
  • Gender: Female
Re: Say Thanks
« Reply #405 on: March 30, 2017, 07:01:46 AM »
Would like to report a bug, can grant myself unlimited likes.

Code: [Select]
index.php?action=thank;msg=3580;member=273;topic=88
change the "msg=3580" to any number and continuously get thanks.

Tested it out and it will even work for post that haven't even been created yet.
I must admit I would consider it highly unusual for a member to continually edit a URL string to boost the 'Thanks' count of another user.

That said the following code change should prevent this happening (it works on a test forum I've created - the member's 'Thanks' count doesn't increase and the message ID of the non-existent post isn't added to the database).

In the file ./Sources/SayThanks.php

Find:
Code: [Select]
if (empty($msg) || empty($topic) || empty($member) || (!empty($msg) && SayThanks::isPostOwner($msg))) {
Replace with:
Code: [Select]
// Make sure the post being thanked actually exists
$request = $smcFunc['db_query']('', '
SELECT id_member, id_topic
FROM {db_prefix}messages
WHERE id_msg = {int:id_msg}',
array(
'id_msg' => $msg,
'id_topic' => $topic,
'id_member' => $member,
)
);
$info = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);

if (empty($info) || empty($msg) || empty($topic) || empty($member) || (!empty($msg) && SayThanks::isPostOwner($msg))) {

Offline dansal

  • Semi-Newbie
  • *
  • Posts: 16
    • LaArmada
Re: Say Thanks
« Reply #406 on: August 02, 2017, 05:57:38 PM »
Hi, great mod!!

I dont see here how list the last thanks of all users, ¿its possible?

Offline kim_c

  • Semi-Newbie
  • *
  • Posts: 16
Re: Say Thanks
« Reply #407 on: October 22, 2017, 07:39:12 AM »
The thanks string under posts is showing up twice, any idea why? Thanks

Offline kim_c

  • Semi-Newbie
  • *
  • Posts: 16
Re: Say Thanks
« Reply #408 on: October 27, 2017, 01:17:46 PM »
Is this mod no longer supported?  :-\

Offline Novice

  • Jr. Member
  • **
  • Posts: 110
Re: Say Thanks
« Reply #409 on: January 03, 2018, 08:15:33 AM »
I'd like to know the answer to that one myself. I just need it to function correctly in 2.0.15 as it did in versions previous to 2.014.

Offline jack001

  • Jr. Member
  • **
  • Posts: 172
  • Gender: Male
  • Edutainment Forum
    • @edutain_forum on Twitter
    • EDUTAINMENT FORUM - Education with Entertainment
Re: Say Thanks
« Reply #410 on: January 19, 2018, 05:39:56 AM »
just installed it on my forum and works nice. Would like to have highest 3 thank you receiver on info center. How can i do that?
https://edutainmentforum.com Edutainment forum - Education with Entertainment!

Offline kim_c

  • Semi-Newbie
  • *
  • Posts: 16
Re: Say Thanks
« Reply #411 on: January 19, 2018, 10:59:01 AM »
just installed it on my forum and works nice. Would like to have highest 3 thank you receiver on info center. How can i do that?

Mod is no longer supported so you probably won't receive an answer  :(