Jump to the post that solved this thread.
Solved: 2 Years, 11 Months, 3 Weeks ago Getting a a value from one of the SQL tables to show up on forumdisplay
#8
Solved: 2 Years, 11 Months, 3 Weeks ago
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]
Reply
Jump to the post that solved this thread.


Messages In This Thread
RE: Getting a a value from one of the SQL tables to show up on forumdisplay - by [ExiTuS] - 2022-02-03, 01:04 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)