Bug Pagination problem

Status
Not open for further replies.
What's the value of the Recent Entries setting in the vBOptions for APTL? Does lowering it alleviate this issue?
 
Recent Entries is set to 30. I can't see difference when changing it.

I think that problem is in dbtech/thanks/includes/class_profileblock.php: prepare_output()
Code:
			// Count number of users
			$count = intval(THANKS::$db->fetchOne('
				SELECT COUNT(*)
				FROM $dbtech_thanks_recententry AS entry
				WHERE entry.receiveduserid = ?
			', array($this->profile->userinfo['userid'])));

			if ($displayGiven)
			{
				$count += intval(THANKS::$db->fetchOne('
					SELECT COUNT(*)
					FROM $dbtech_thanks_recententry AS entry
					WHERE entry.userid = ?
				', array($this->profile->userinfo['userid'])));
			}

For user View Profile: undomiel9 - Forums
First count 239 - looks like content for page 1-12 (20 entry per page)
Second count 171 - looks like empty pages 13-21 (20 entry per page, so space for 180 entries)

$displayGiven = true in line 89 so if ($displayGiven) condition is always true. Is there a piece of code missing?
 
There's a Pro-only setting that allows admins to configure whether it should display given or just received stats, but the reading of that vBOption is stripped from the Lite version.

Could you try first running
Code:
TRUNCATE TABLE dbtech_thanks_entrycache
and then using the Rebuild Button Click Cache action under the Thanks' Maintenance menu entry, and let me know if that changes anything? If you have a very large amount of button click entries, it might take a long time to run through them all, but hopefully this will resolve the issue.

At this time I don't have access to a test board with a large amount of clicks given/received in the span of 30 or fewer days, so I'm not sure if this is an issue with the entrycache or whether this is an issue that only manifests itself when a large amount of entries are in the entrycache.
 
It does not help. I found problem in SQL. Plugin calculates the limit for each query separately that is incorrect:
View Profile: undomiel9 - Forums (last page of results)
dbtech/thanks/includes/class_profileblock.php: prepare_output():

SELECT entryid, contenttype
FROM dbtech_thanks_recententry
WHERE receiveduserid = 2060811
ORDER BY entryid DESC
LIMIT 380, 20; -- impossible because count(*) = 229 < 380

0 row(s) returned

SELECT entryid, contenttype
FROM dbtech_thanks_recententry
WHERE userid = 2060811
ORDER BY entryid DESC
LIMIT 380, 20; -- impossible because count(*) = 158 < 380

0 row(s) returned

It should be calculated for whole result like this:
SELECT entryid, contenttype FROM (
SELECT entryid, contenttype
FROM dbtech_thanks_recententry
WHERE receiveduserid = 2060811
UNION
SELECT entryid, contenttype
FROM dbtech_thanks_recententry
WHERE userid = 2060811
) t
ORDER BY entryid DESC
LIMIT 380, 20

7 row(s) returned
 
Sorry, I forgot to post back here; The latest Patch Level for APTL should resolve this, if not let me know and I'll re-examine it :)
 
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,024
Customer rating
5.00 star(s) 1 ratings
Back
Top