• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Import Post Thanks to Likes

yavuz

Well-known member
#27
Thanks :) BTW I'm male, it's just an avatar :)
Since XenForo has it's own "Like" system, [DBTech] doesn't consider as a high priority making an import tool for its plugin, from what I could understand after I got in contact with the developer. I even offered a boost to encourage it but that didn't help either. I can understand that they have other priorities, I'm ok with that.

Would you maybe reconsider making an import tool for the [DBTech] Advanced Post Thanks / Like hack g0rn ?

Thanks.
 

g0rn

Well-known member
#28
Since XenForo has it's own "Like" system, [DBTech] doesn't consider as a high priority making an import tool for its plugin, from what I could understand after I got in contact with the developer. I even offered a boost to encourage it but that didn't help either. I can understand that they have other priorities, I'm ok with that.

Would you maybe reconsider making an import tool for the [DBTech] Advanced Post Thanks / Like hack g0rn ?

Thanks.
I've taken a quick look over this mod and its database scheme is mostly similar to the Post Thank You Hack. I can offer you a couple of file edits to make this importer work with DBTech hack, however I am not going to update or check the compatibility with further versions of the importer, but this should be ok as importing is usually one-time procedure. Please let me know if you are interested and I'll post the edits here.
 

yavuz

Well-known member
#29
I've taken a quick look over this mod and its database scheme is mostly similar to the Post Thank You Hack. I can offer you a couple of file edits to make this importer work with DBTech hack, however I am not going to update or check the compatibility with further versions of the importer, but this should be ok as importing is usually one-time procedure. Please let me know if you are interested and I'll post the edits here.
That would be more than enough. Thank you g0rn.
 

g0rn

Well-known member
#30
Ok, here it is. In PostThanksImporter/Importer/vBulletin.php replace
PHP:
        if ($options['max'] === false)
        {
            $options['max'] = $sDb->fetchOne('
                SELECT MAX(id)
                FROM ' . $prefix . 'post_thanks
            ');
        }

        $postThanks = $sDb->fetchAll($sDb->limit(
            '
                SELECT pt.*, post.userid as content_userid
                FROM ' . $prefix . 'post_thanks AS pt
                LEFT JOIN ' . $prefix . 'post AS post USING (postid)
                WHERE pt.id > ?
                ORDER BY pt.id
            ', $options['limit']
        ), $start);
with this:
PHP:
        if ($options['max'] === false)
        {
            $options['max'] = $sDb->fetchOne('
                SELECT MAX(entryid)
                FROM ' . $prefix . 'dbtech_thanks_entry
            ');
        }

        $postThanks = $sDb->fetchAll($sDb->limit(
            '
                SELECT pt.entryid AS id, pt.userid AS userid, pt.contentid AS postid,
                    pt.dateline AS date, post.userid as content_userid
                FROM ' . $prefix . 'dbtech_thanks_entry AS pt
                LEFT JOIN ' . $prefix . 'post AS post ON (pt.contentid = post.postid)
                WHERE entryid > ?
                    AND entrytype IN (\'like\', \'thanks\')
                GROUP BY contentid, pt.userid
                ORDER BY pt.entryid
            ', $options['limit']
        ), $start);
This will add a XenForo like to the message if it was liked or thanked (or both) in vBulletin. If you wish to import only likes or only thanks then replace in the above code \'like\', \'thanks\' with \'like\' or \'thanks\' respectively.
 

yavuz

Well-known member
#31
Thank you gorn, I have imported data from my previous vB board to XenForo before. as I attempt to import data, I have to go through the whole process again. Would I lose my data & setting doing that ?
 

g0rn

Well-known member
#32
Importing doesn't delete anything from your XenForo installation, it will save your existing posts and threads, and it will copy the data from vB, and if you have already imported that data, it will copy it once again, so you will have two instances of each forum/post/thread on you board and the likes you have imported during the second import will be associated with posts imported second time as well. I would recommend importing only to the clean installation.
 

yavuz

Well-known member
#33
Importing doesn't delete anything from your XenForo installation, it will save your existing posts and threads, and it will copy the data from vB, and if you have already imported that data, it will copy it once again, so you will have two instances of each forum/post/thread on you board and the likes you have imported during the second import will be associated with posts imported second time as well. I would recommend importing only to the clean installation.
that would be a problem since my board is an active and that would duplicate the threads.

Would it be possible if I imported it on an different location, select the affected database tables and dump it after ?
 

Brogan

XenForo moderator
Staff member
#34
If you run the script on an old database and then import selected tables to your live database, there will be a mis-match due to new content posted on your live site and updates to the db since the original import.
 

yavuz

Well-known member
#35
If you run the script on an old database and then import selected tables to your live database, there will be a mis-match due to new content posted on your live site and updates to the db since the original import.
Either way it look bad :) I'm not comfortable to start again from scratch. If only there were a way to pass former steps and only import single tasks. Thanks though to gorn, who was kind and helpfull for the modification.
 

Anthony Parsons

Well-known member
#36
If you run the importer with the standard thanks import, and if you delete it from the server, then continue and run another task of the import, upload it again with the changed schema, it should pop back up for you to run the new task... ie. it may not register then as imported for the thanks.

Just don't complete the import basically until you have tried a few ways, and hopefully you can get it to import using different methods... even if you have to rename the file with the changed code... then you won't have to literally run any of the vb importer again and duplicate anything.

Basically... I'm sure you could change a few references around to rename the entire thing after one import so it picks up as a new importer....
 

yavuz

Well-known member
#37
If you run the importer with the standard thanks import, and if you delete it from the server, then continue and run another task of the import, upload it again with the changed schema, it should pop back up for you to run the new task... ie. it may not register then as imported for the thanks.

Just don't complete the import basically until you have tried a few ways, and hopefully you can get it to import using different methods... even if you have to rename the file with the changed code... then you won't have to literally run any of the vb importer again and duplicate anything.

Basically... I'm sure you could change a few references around to rename the entire thing after one import so it picks up as a new importer....
When I run it as the importing process would normally proceed, until I reach the level where I get to import the Thanks / Like from the previous database, all usergroups, users etc. will be duplicated, thats the way it goes :)

I honestly didn't understand what you suggested after that. This seems to be also a litle bit of a gamble , forgive me for saying that Anthony :D

I appreciate your opinion though.