fyjpm
12-09-2005, 02:26 AM
Hi I've come across what I believe is a bug in lastesttopics.php when you use the "Thread Display Order" => "Rating" the following error is returned:
Database error in vBulletin 3.5.2:
Invalid SQL:
SELECT
thread.threadid, thread.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, IF(views <= thread.replycount, thread.replycount+1, views) AS views, thread.lastposter, thread.lastpost, pollid
FROM vb_thread as thread
LEFT JOIN vb_deletionlog AS deletionlog ON (thread.threadid = deletionlog.primaryid AND type = 'thread')
WHERE open != 10 AND thread.visible = 1
AND deletionlog.primaryid IS NULL
ORDER BY voteavg DESC
LIMIT 5;
MySQL Error : Unknown column 'voteavg' in 'order clause'
Error Number : 1054
the affected code is on line 79 (or perhaps 133 if a divide by zero error?) here is line 77,78, & 79:
$threads = $db->query_read("
SELECT
" . iif($mod_options['portal_threads_showrating'], 'IF(votenum >= ' . $vbulletin->options['showvotes'] . ', votenum, 0) AS n
umbvote, IF(votenum >= ' . $vbulletin->options['showvotes'] . ' AND votenum != 0, votetotal / votenum, 0) AS voteavg,') . "
(might I add some pretty funny looking "if" statements!!) Anyone have some info to get this fixed would be much appreciated! Thanks,
John
Database error in vBulletin 3.5.2:
Invalid SQL:
SELECT
thread.threadid, thread.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, IF(views <= thread.replycount, thread.replycount+1, views) AS views, thread.lastposter, thread.lastpost, pollid
FROM vb_thread as thread
LEFT JOIN vb_deletionlog AS deletionlog ON (thread.threadid = deletionlog.primaryid AND type = 'thread')
WHERE open != 10 AND thread.visible = 1
AND deletionlog.primaryid IS NULL
ORDER BY voteavg DESC
LIMIT 5;
MySQL Error : Unknown column 'voteavg' in 'order clause'
Error Number : 1054
the affected code is on line 79 (or perhaps 133 if a divide by zero error?) here is line 77,78, & 79:
$threads = $db->query_read("
SELECT
" . iif($mod_options['portal_threads_showrating'], 'IF(votenum >= ' . $vbulletin->options['showvotes'] . ', votenum, 0) AS n
umbvote, IF(votenum >= ' . $vbulletin->options['showvotes'] . ' AND votenum != 0, votetotal / votenum, 0) AS voteavg,') . "
(might I add some pretty funny looking "if" statements!!) Anyone have some info to get this fixed would be much appreciated! Thanks,
John