ElkArte Community

General => OpenImporter => Topic started by: radu81 on October 28, 2014, 07:13:37 pm

Title: Thank-o-matic to Elkarte Likes
Post by: radu81 on October 28, 2014, 07:13:37 pm
Hello,

is there any way to convert the "Thank you" from SMF mod Thank-o-matic to Elkarte likes?

Thank you in advance
Title: Re: Thank-o-matic to Elkarte Likes
Post by: emanuele on October 29, 2014, 04:12:47 am
Do you mean the data in the database?
Title: Re: Thank-o-matic to Elkarte Likes
Post by: radu81 on October 29, 2014, 07:21:56 am
Yep
Title: Re: Thank-o-matic to Elkarte Likes
Post by: emanuele on October 30, 2014, 12:25:40 pm
The mod should be that one:
http://www.smfpersonal.net/mods/thankomatic-t3284.0.html

After a quick look at the mod install, it should be possible and not too difficult.
I think it could even be added directly to the importer as an optional step

Memo while I have the file open, the table is:
{db_prefix}thank_you_post
and contains the following fields:
id_thx_post
id_msg
id_topic
id_board
id_member
member_name
thx_time

The query to add to the importer may look something like:
Code: [Select]
SELECT th.id_member, th.id_msg, m.id_member AS id_poster, th.thx_time
FROM {$from_prefix}thank_you_post AS th
LEFT JOIN {$from_prefix}topics AS t ON (th.id_topic = t.id_topic)
LEFT JOIN {$from_prefix}messages AS m ON (th.id_first_msg = m.id_msg)

Then there is to recount all the likes per topic and per member.
@Spuds does the forum maintenance recount likes too?
Title: Re: Thank-o-matic to Elkarte Likes
Post by: Spuds on October 30, 2014, 02:32:21 pm
I don't recall there being any, maybe a good thing to add to 1.02 or should that be 1.1?  I'd guess for us topic counts could get messed up, like a split to new topic thing.  Given/received, not sure how to validate that really, well received we can, not sure on given.

You would have to check the imported table for message_id's that were topic first message_id's and increment the topic table with the counts. 

The member one, hummm,  I'd guess the given is just the total of each id_member count in that table, the received would be the count of id_msg in that table on a per id_member basis (so all messages posted by member x).  Thats a guess since I have not looked at the mod.
Title: Re: Thank-o-matic to Elkarte Likes
Post by: emanuele on October 30, 2014, 06:31:02 pm
I didn't check deeply, but I think you are right.
Title: Re: Thank-o-matic to Elkarte Likes
Post by: radu81 on November 18, 2014, 05:12:30 am
I know you guys have a lot of things to do, but are athere any news on this? thank you
Title: Re: Thank-o-matic to Elkarte Likes
Post by: emanuele on November 19, 2014, 09:23:38 am
I have not been able to look into that one yet, sorry.
Title: Re: Thank-o-matic to Elkarte Likes
Post by: emanuele on November 25, 2014, 09:27:49 am
https://github.com/emanuele45/openimporter/compare/likes
This should do the trick for the thank-o-matic/thank you mod.

/me should find in the meantime also the other like mods available in order to add importers as well.
Title: Re: Thank-o-matic to Elkarte Likes
Post by: Jorin on November 25, 2014, 09:32:14 am
/me thinks emanuele should have a life! ;)

You're a workaholic depending ElkArte! Please do not exaggerate! :o
Title: Re: Thank-o-matic to Elkarte Likes
Post by: emanuele on November 25, 2014, 09:35:46 am
/me feels the same... from time to time. :P
Title: Re: Thank-o-matic to Elkarte Likes
Post by: radu81 on November 25, 2014, 09:51:10 am
 :o I can't belive what I'am seeing. I cannot test it now, but I'll try it soon.

Thank you Emanuele for your help!
Title: Re: Thank-o-matic to Elkarte Likes
Post by: Spuds on November 25, 2014, 10:36:57 am
Quote from: emanuele – https://github.com/emanuele45/openimporter/compare/likes
This should do the trick for the thank-o-matic/thank you mod.

/me should find in the meantime also the other like mods available in order to add importers as well.
Whats the best way to do a mod to addon during the import (something that is not in the core)

 For example the googlemap one, so if an SMF site thats being imported has that data, and the new site has installed the mod?
Title: Re: Thank-o-matic to Elkarte Likes
Post by: emanuele on November 25, 2014, 10:50:17 am
At the moment OI doesn't have any way to detect if a table in the "destination" database exists.
It could (and probably should) be added, then you can add as much stuff as you want to any importer: detects if the tables (source/destination) exist and if so process the data.
Title: Re: Thank-o-matic to Elkarte Likes
Post by: radu81 on November 25, 2014, 10:59:00 am
I tried the importer and all "thank you" are correctly imported into likes.  8)
Is there a way to re-count the likes? I searched into Maintenance but I could not find it. All profiles have 0 likes given/received
Title: Re: Thank-o-matic to Elkarte Likes
Post by: emanuele on November 25, 2014, 11:02:26 am
Ohhh... right! :-[

I forgot about them. lol
I recounted the topics, but not the members.

ETA: https://github.com/OpenImporter/openimporter/pull/32
Title: Re: Thank-o-matic to Elkarte Likes
Post by: radu81 on November 25, 2014, 12:12:58 pm
Just one word: PERFECT!

thank you for your help
Title: Re: Thank-o-matic to Elkarte Likes
Post by: emanuele on November 25, 2014, 03:36:22 pm
I just added support for the other three like mods I know. My keyboard is dead and the virtual doesn't work either. Darn.
Title: Re: Thank-o-matic to Elkarte Likes
Post by: Spuds on November 26, 2014, 08:09:33 pm
I was just running the importer for some tests (yes I know I'm way behind :P) ... I did not have the likes mod installed so when it got to that step it failed and ended instead of skipping.  That step did was not listed as mandatory so not sure what was going on there.
Title: Re: Thank-o-matic to Elkarte Likes
Post by: emanuele on November 27, 2014, 03:29:40 am
hmm... why things work when I test them? xD
Title: Re: Thank-o-matic to Elkarte Likes
Post by: Spuds on November 27, 2014, 08:33:50 am
On the super positive side it handled multiple attachment directory properly and a custom avatar upload location :D
Title: Re: Thank-o-matic to Elkarte Likes
Post by: emanuele on November 27, 2014, 08:45:02 am
hmm... that's odd, when I test it on my local I see what is in the attachment... :-\
Title: Re: Thank-o-matic to Elkarte Likes
Post by: Spuds on November 27, 2014, 10:41:05 am
Is that from the latest master?  I had just pulled that down yesterday and I got the green error box table not found error at that point.   Maybe I missed an update  :-[
Title: Re: Thank-o-matic to Elkarte Likes
Post by: emanuele on November 27, 2014, 11:09:30 am
Ahh!
I was looking at the commit dates, but the PR has been merged yesterday morning (ECT), so you may have downloaded the broken one. O:-)
Title: Re: Thank-o-matic to Elkarte Likes
Post by: radu81 on December 31, 2014, 10:04:38 am
I did a mess when I convert, I didn't remember that I had installed in SMF the Like mod from Ilori. So I convert the forum and I think that only the old likes from Ilori mod were imported and not those from Thank-o-Matic.

Is there a way to import manually the thank-o-matic likes to elkarte?
Thank you in advance

=== edit ===
SOLVED! I did another import from smf and imported into elkarte the two tables elkarte_members and elkarte_message_likes
Title: Re: Thank-o-matic to Elkarte Likes
Post by: emanuele on December 31, 2014, 11:52:08 am
Glad you solved! :D
Title: Re: Thank-o-matic to Elkarte Likes
Post by: Floyyd on January 10, 2016, 10:51:14 am
Hello Guys!

In the currently openImporter i can't found the thank-o-matic converter but also here in this board.
Where can i find the thank-o-matic converter for a SMF 1.1.20 to Elkarte?

Sorry for my bad english!

Regards
Title: Re: Thank-o-matic to Elkarte Likes
Post by: radu81 on January 10, 2016, 11:07:22 am
Have you seen this topic? http://www.elkarte.net/community/index.php?topic=3122.0

This one should work, but I did not tested recently
https://github.com/OpenImporter/openimporter/archive/master.zip

===edit===

(http://i.imgur.com/glqgw17.png)

(http://i.imgur.com/zany7Z4.png)

====================

sorry but my post was referred to smf 2.0.x not to smf 1.x