2022-02-03, 01:04 PM
Can be achieved this simple way:
-- forumdisplay.php / line 880:
SELECT t.*, {$ratingadd}t.username AS threadusername, u.username, r.rating AS userownrating
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
LEFT JOIN ".TABLE_PREFIX."threadratings r ON (t.tid = r.tid) AND (r.uid = {$mybb->user['uid']})
WHERE t.fid='$fid' $tuseronly $tvisibleonly $datecutsql2 $prefixsql2
ORDER BY t.sticky DESC, {$t}{$sortfield} $sortordernow $sortfield2
LIMIT $start, $perpage
Just add another field to the SELECT (AS userownrating) and read your rating using the additional LEFT JOIN.
Drop the following variable wherever you want in Forum Bit templates:
$thread['userownrating']
Good luck!
[ExiTuS]
-- forumdisplay.php / line 880:
SELECT t.*, {$ratingadd}t.username AS threadusername, u.username, r.rating AS userownrating
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
LEFT JOIN ".TABLE_PREFIX."threadratings r ON (t.tid = r.tid) AND (r.uid = {$mybb->user['uid']})
WHERE t.fid='$fid' $tuseronly $tvisibleonly $datecutsql2 $prefixsql2
ORDER BY t.sticky DESC, {$t}{$sortfield} $sortordernow $sortfield2
LIMIT $start, $perpage
Just add another field to the SELECT (AS userownrating) and read your rating using the additional LEFT JOIN.
Drop the following variable wherever you want in Forum Bit templates:
$thread['userownrating']
Good luck!
[ExiTuS]