Status
Not open for further replies.

qpurser

Customer
Hey guys,
as you might have noticed I am in the process of replacing most of my mod's with those you are offering.
I just can't stick anymore with mod's which run great at first but then after a while they are not updated or supported anymore.
Usually I get your "lite" versions and when they work good I get the "PRO" usually.
Anyways I have a question regarding the import file you have for importing from Abe's mod.
However I am running Scandal's version which is almost the same as Abe's one. Just more advanced.

I have both Mod's installed on my test server and both DB tables are very similar.
I tried to convert your import script to use it with Scandal's version. No errors when importing but for some reason the count is off.
I must do something wrong.
I attached a screenshot from the table I am using.
You think you could have a look at your script and replace whatever needs to be replaced to get it to work?

Thanks for considering
Michael

Screen Shot 2013-10-09 at 11.41.03 AM.png
 
Can you please be more specific than "the count is off"? There may be a re-calculate feature I can have you run, but I won't know without more information.
 
Attached a screenshot.
On top are the counts from the other mod. Below yours.

Here is also the part of the code I changed from the script. Might have something wrong there also.

PHP:
$thanks = $db->query_read_slave("
			SELECT thanks.*, to_userid AS receiveduserid
			FROM " . TABLE_PREFIX . "sc_thumbs_post AS thanks
			LEFT JOIN " . TABLE_PREFIX . "post AS post ON(post.postid = thanks.postid)
			WHERE id >= " . $vbulletin->GPC['startat'] . "
			ORDER BY id
			LIMIT " . $vbulletin->GPC['perpage']
		
		);
 

Attachments

  • Screen Shot 2013-10-09 at 12.40.45 PM.png
    Screen Shot 2013-10-09 at 12.40.45 PM.png
    20 KB · Views: 20
Have you tried running the Rebuild Statistics and Recalculate maintenance actions under DBTech - Post Thanks (run them in that specific order)?
 
ha...I figured it out.
What I did is probably not the easiest way but it worked.
I made a copy from the table from Scandal's mod and named it post_thanks (as it was called in Abe's mod).
Then I modified your import script as I had one different field name (the one I changed is in BOLD)

$thanks = $db->query_read_slave("
SELECT thanks.*, to_userid AS receiveduserid
FROM " . TABLE_PREFIX . "post_thanks AS thanks
LEFT JOIN " . TABLE_PREFIX . "post AS post ON(post.postid = thanks.postid)
WHERE id >= " . $vbulletin->GPC['startat'] . "
ORDER BY id
LIMIT " . $vbulletin->GPC['perpage']
);

Ran the modified import script and ran the maintenance options.

Perfect match now. No differences in the counts
 
Noticed one more issue when implementing this wth vBactivity.

In the Post Thanks mod Statistics everything shows correct and the Top 5 users have the correct numbers (Given and Received).
Now when I tried to see if it got correctly implemented in your "Activity" mod I have an issue.
Looking into the table "dbtech_thanks_entry" it is populated with the data from the import (see screenshot).
I recalculated all points and achievements but the users didn't get any points for their thanks given/received. I started to recalculate from the date we started our forum.
The only time somebody got points is when I clicked on the "Thank you" button in a thread manually.

Am I missing something here to get those Thank You points from the past implemented?
 

Attachments

  • Screen Shot 2013-10-11 at 7.05.02 AM.png
    Screen Shot 2013-10-11 at 7.05.02 AM.png
    129.1 KB · Views: 0
The issue is the dateline column - as you can see, all entries from Scandal's mod did not get correct date stamps added. I'd suggest you make a similar change to the "to_userid" change in order to correct this, then delete all entries with dateline = 0, then run the importer again :)
 
Thanks again for pointing me in the right direction.

I am not a pro with sql scripts etc. but with some trial and error I usually get there somehow. :)

I found the reason why the dateline field didn't get imported.
If you look at your original script it uses the field "date" which is not existing

PHP:
while ($thanksinfo = $db->fetch_array($thanks))
		{
			if ($existing = $db->query_first("
				SELECT entryid FROM " . TABLE_PREFIX . "dbtech_thanks_entry
				WHERE $thanks_column = 'thanks'
					AND userid = " . $db->sql_prepare($thanksinfo['userid']) . "
					AND receiveduserid = " . $db->sql_prepare($thanksinfo['receiveduserid']) . "
					AND contenttype = 'post'
					AND contentid = " . $db->sql_prepare($thanksinfo['postid']) . "
					AND dateline = " . $db->sql_prepare($thanksinfo['date']) . "

			"))


replaced "date" with "dateline" in my script and now it got imported properly:
PHP:
while ($thanksinfo = $db->fetch_array($thanks))
		{
			if ($existing = $db->query_first("
				SELECT entryid FROM " . TABLE_PREFIX . "dbtech_thanks_entry
				WHERE $thanks_column = 'thanks'
					AND userid = " . $db->sql_prepare($thanksinfo['userid']) . "
					AND receiveduserid = " . $db->sql_prepare($thanksinfo['receiveduserid']) . "
					AND contenttype = 'post'
					AND contentid = " . $db->sql_prepare($thanksinfo['postid']) . "
					AND dateline = " . $db->sql_prepare($thanksinfo['dateline']) . "

			"))

As a result the point are calculated also in the "activity" mod and the Leaderboards show correctly

Sorry for all the trouble but I guess maybe you can use it to include an import script for Scandal's mod with your mod...
 
Status
Not open for further replies.

Legacy Advanced Post Thanks / Like

vBulletin 3.8.x vBulletin 4.x.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
4,034
Customer rating
5.00 star(s) 1 ratings
Back
Top