Advertisement:

Author Topic: Say Thanks  (Read 113365 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: 322
    • @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: 322
    • @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: 441
  • 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: 112
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: 195
  • 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://www.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  :(

Offline dekatria

  • Jr. Member
  • **
  • Posts: 103
  • Leave Nothing
    • roulette30 on Facebook
    • roulette30 on LinkedIn
    • @@roulette30 on Twitter
    • How to play Roulette
Re: Say Thanks
« Reply #412 on: July 24, 2018, 08:14:06 AM »
I have migrated my forum to new folder and new domain.
The stats are there and the option to thank, but when I press the "say thanks" link, it doesn't work - it goes on "loading mode" indefinitely.

Would uninstalling and reinstalling the mod be a good idea?

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 2,029
  • Gender: Male
  • I also speak english :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Say Thanks
« Reply #413 on: July 24, 2018, 11:36:26 AM »
I have migrated my forum to new folder and new domain.
The stats are there and the option to thank, but when I press the "say thanks" link, it doesn't work - it goes on "loading mode" indefinitely.

Would uninstalling and reinstalling the mod be a good idea?

What I can think of is that the route is wrong to move it, it would be good to uninstall it and reinstall to correct this, otherwise it would be to look for the wrong route.

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


Ayudame via PayPal

Offline dekatria

  • Jr. Member
  • **
  • Posts: 103
  • Leave Nothing
    • roulette30 on Facebook
    • roulette30 on LinkedIn
    • @@roulette30 on Twitter
    • How to play Roulette
Re: Say Thanks
« Reply #414 on: July 24, 2018, 12:13:23 PM »
I tried to uninstall and all hell broke lose.

I got the  theme_template_error

Hopefully the automatic backup saved me.

Then I tried to manually uninstall, error again.
Tried to reinstall, error again (class SayThanka ALREADY DEFINED IN SOURCES/SAYTHANKS.PHP etc.)

Now I'm stuck with a neither removed nor installed mod that doesn't work and when I try to either install or remove I get an error.

For example I have manually reversed all modifications to the files. But when I try to delete the additional files added by the mod I get an error, although the mod was not installed according to admin panel.

I believe it must be a modification in the db that causes the error and that while the theme is not installed the db asks for some file. I attack the add_settings.php which installs the mod and the remove_settings.php in case anyone would like to take a look and help me.

Offline dekatria

  • Jr. Member
  • **
  • Posts: 103
  • Leave Nothing
    • roulette30 on Facebook
    • roulette30 on LinkedIn
    • @@roulette30 on Twitter
    • How to play Roulette
Re: Say Thanks
« Reply #415 on: July 24, 2018, 02:32:39 PM »
I have manually reversed all the changes and the package appears as not installed. But when I try to manually delete the SayThanksTemplate.php files I get an theme_template_error.

I believe something is requesting these files though the package appears as not installed.

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 2,029
  • Gender: Male
  • I also speak english :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Say Thanks
« Reply #416 on: July 24, 2018, 02:53:19 PM »
At the moment of removing it, you have to extract the information from the database and it seems that there is some restro, try using the fix_packages to erase everything else. Also try to make a backup before touching any file ... I will try to do a local tests to see if I can reproduce the error and tell you more safe to do, sorry not to help more at this time.


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


Ayudame via PayPal

Offline dekatria

  • Jr. Member
  • **
  • Posts: 103
  • Leave Nothing
    • roulette30 on Facebook
    • roulette30 on LinkedIn
    • @@roulette30 on Twitter
    • How to play Roulette
Re: Say Thanks
« Reply #417 on: July 24, 2018, 03:25:55 PM »
Thanks.

I would like someone who knows php to tell me what the install/uninstall files do, so I can do it manually.
Because when I delete the additional files manually I get an error.

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 2,029
  • Gender: Male
  • I also speak english :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Say Thanks
« Reply #418 on: July 24, 2018, 03:30:27 PM »
By doing so it automatically removes it from several places without problems to the contrary manually does not remove all the code at one time generating an error ... Since there is a variable you are making this call to what you got, you would have to remove everything completely and if the error still persists, something must be removed or it was not removed correctly!


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


Ayudame via PayPal

Offline dekatria

  • Jr. Member
  • **
  • Posts: 103
  • Leave Nothing
    • roulette30 on Facebook
    • roulette30 on LinkedIn
    • @@roulette30 on Twitter
    • How to play Roulette
Re: Say Thanks
« Reply #419 on: July 24, 2018, 04:31:51 PM »
When I try to re-install the package I get the error:

Code: [Select]
Fatal error: Cannot declare class SayThanks, because the name is already in use in /home/xxx/public_html/domain.com/Sources/SayThanks.php on line 17