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);