PDA

View Full Version : Error on index.php when drawing news from forum


Vilandra
08-06-2004, 01:41 AM
I am getting this error on my vba index.php. It only happens if I enter a forumid in the News Forum ID line of the cp:

Invalid SQL:
SELECT IF(votenum >= 1, votenum, 0) AS votenum, IF(votenum >= 1 AND votenum != 0, votetotal / votenum, 0) AS voteavg,
thread.threadid, thread.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, thread.lastposter, thread.lastpost, IF(views<=thread.replycount, thread.replycount+1, views) AS views, thread.forumid, post.postid, pagetext, allowsmilie, forumhomeicon
, showsignature, usertextfield.signature

, avatarpath, NOT ISNULL(avatardata) AS hascustom, customavatar.dateline AS avatardateline, avatarrevision
, NOT ISNULL(subscribethread.subscribethreadid) AS subscribed
, attachment.filename, attachment.filesize, attachment.visible, attachmentid, counter, thumbnail, LENGTH(thumbnail) AS thumbnailsize
FROM thread AS thread
LEFT JOIN forum USING (forumid)
LEFT JOIN post AS post ON (post.postid = thread.firstpostid)

LEFT JOIN attachment AS attachment ON (post.postid = attachment.postid)
LEFT JOIN user AS user ON (user.userid = post.userid)

LEFT JOIN usertextfield AS usertextfield ON (post.userid = usertextfield.userid)

LEFT JOIN avatar as avatar ON (avatar.avatarid = user.avatarid)
LEFT JOIN customavatar as customavatar ON (customavatar.userid = user.userid)

LEFT JOIN subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = '1')
LEFT JOIN deletionlog AS deletionlog ON (thread.threadid = deletionlog.primaryid AND type = 'thread')
WHERE thread.forumid IN(46) AND thread.visible = 1 AND thread.open != 10 AND deletionlog.primaryid IS NULL
GROUP BY post.postid
ORDER BY postdateline DESC
LIMIT 4
mysql error: Unknown column 'forumhomeicon' in 'field list'


http://ukfconline.co.uk

I can't even find this code - plus I have this installed on another board with no problems. I am at a loss - does anyone have any ideas for me to point me in the right direction? Thanks :)

Brian
08-06-2004, 01:48 AM
Upload a fresh, un-hacked version of your forum/modules/news.php file. There's no way you would get this error unless the file has been modified.

Our Sponsors
 

Vilandra
08-06-2004, 01:54 AM
I didn't modify it, but maybe it got corrupted when I uploaded :) Thanks mate, that did the trick :)

Brian
08-06-2004, 02:00 AM
Corruption would have nothing to do with it... 'forumhomeicon' was added to the query.