PDA

View Full Version : News Module Not Working



MtnDewMan
05-22-2007, 09:36 PM
I updated my vbadvanced to 3.0 today and get a database error when the news module is active. I do not get a database error when the news module is not active. The error I get is below:


Database error in vBulletin 3.6.7:

Invalid SQL:

SELECT IF(votenum >= 2, votenum, 0) AS votenum, IF(votenum >= 2 AND votenum != 0, votetotal / votenum, 0) AS voteavg, votetotal, thread.threadid, post.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, sticky, thread.attach, thread.lastpostid, thread.lastposter, thread.lastpost, IF(views<=thread.replycount, thread.replycount+1, views) AS views, thread.forumid, post.postid, pagetext
, allowsmilie, pagetext_html, hasimages, showsignature, sigparsed.signatureparsed, sigparsed.hasimages AS sighasimages, sigpic.userid AS sigpic, sigpic.dateline AS sigpicdateline, sigpic.width AS sigpicwidth, sigpic.height AS sigpicheight, NOT ISNULL(subscribethread.subscribethreadid) AS subscribed
FROM thread AS thread
LEFT JOIN post AS post ON (post.postid = thread.firstpostid)
LEFT JOIN user AS user ON (user.userid = post.userid) LEFT JOIN postparsed AS postparsed ON (postparsed.postid = post.postid AND postparsed.styleid = 9 AND postparsed.languageid = 1) LEFT JOIN sigparsed AS sigparsed ON (sigparsed.userid = user.userid AND sigparsed.styleid = 9 AND sigparsed.languageid = 1)
LEFT JOIN sigpic AS sigpic ON (sigpic.userid = post.userid) LEFT JOIN subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = '4')
WHERE thread.threadid IN(25775)


ORDER BY sticky DESC,thread.dateline DESC
LIMIT 1;

MySQL Error : Column: 'hasimages' in field list is ambiguous
Error Number : 1052
Date : Tuesday, May 22nd 2007 @ 07:33:57 PM
Script : http://www.reeffrontiers.com/
Referrer : http://www.reeffrontiers.com/
IP Address : 67.183.147.136
Username : MtnDewMan
Classname : vb_database


Any ideas?

Brian
05-23-2007, 12:54 PM
That's an error that could happen when you have signatures and the post cache options enabled in your news module. The forum/modules/news.php file in the package here has been updated with the fix, so if you'll download it again and replace that file with the new one, that should take care of the problem.

Our Sponsors
 

MtnDewMan
05-23-2007, 06:41 PM
Thank you, I will re-download tonight and give it a shot and will report back if it is successful.

MtnDewMan
05-23-2007, 08:05 PM
It worked without giving me database errors :) Thanks It will not show signature images with the IMG tags however. It just shows the IMG tags with the link to the image within the tags. Not the image itself. But at least it works without database errors now :)

Thanks again

Our Sponsors
 

voter
07-30-2007, 10:46 AM
Trying to put the sorting in News Modul by Last Post I am getting this error



Database error in vBulletin 3.6.4:

Invalid SQL:

SELECT thread.threadid, post.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, sticky, thread.attach, thread.lastpostid, thread.lastposter, thread.lastpost, IF(views<=thread.replycount, thread.replycount+1, views) AS views, thread.forumid, post.postid, pagetext, user.*
, allowsmilie, pagetext_html, postparsed.hasimages, NOT ISNULL(subscribethread.subscribethreadid) AS subscribed
FROM vbthread AS thread
LEFT JOIN vbpost AS post ON (post.postid = thread.firstpostid)
LEFT JOIN vbuser AS user ON (user.userid = post.userid)
LEFT JOIN vbpostparsed AS postparsed ON (postparsed.postid = post.postid AND postparsed.styleid = 5 AND postparsed.languageid = 4) LEFT JOIN vbsubscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = '52')
WHERE thread.threadid IN(155,616,1258,1991,2169,2247)

AND thread.forumid NOT IN(29)
ORDER BY lastpost ASC
LIMIT 6;

MySQL Error : Column 'lastpost' in order clause is ambiguous
Error Number : 1052

Brian
07-30-2007, 11:20 AM
Thank you for pointing that out. If you'll look in your modules/news.php file for this code:

ORDER BY " . iif($mod_options['portal_news_sticky'], 'sticky DESC,') . iif($mod_options['portal_news_orderby'] == 'postdateline', 'thread.dateline', $mod_options['portal_news_orderby']) . " $mod_options[portal_news_direction]


And replace with this:

ORDER BY " . iif($mod_options['portal_news_sticky'], 'sticky DESC, ') . 'thread.' . iif($mod_options['portal_news_orderby'] == 'postdateline', 'dateline', $mod_options['portal_news_orderby']) . " $mod_options[portal_news_direction]


Then that should fix the problem.

voter
07-31-2007, 10:48 AM
Thanks Brian it works now.
One more question, is it possible that news moduls shows the last post of thread I choosed? I was hoping that the sorting by last post will show the last posts of threads but it justs sorts the threads, still showing the first post of threads.

Brian
07-31-2007, 12:07 PM
Sorry, but there is not an option to show the last post instead of the first.

glorify
08-21-2007, 12:03 AM
Even after your news.php edit, I still get:


Database error in vBulletin 3.6.8:

Invalid SQL:

SELECT thread.threadid, post.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, sticky, thread.attach, thread.lastpostid, thread.lastposter, thread.lastpost, IF(views<=thread.replycount, thread.replycount+1, views) AS views, thread.forumid, post.postid, pagetext, user.*
, allowsmilie, thread.iconid AS threadiconid, iconpath AS threadiconpath, NOT ISNULL(subscribethread.subscribethreadid) AS subscribed
FROM thread AS thread
LEFT JOIN post AS post ON (post.postid = thread.firstpostid)
LEFT JOIN user AS user ON (user.userid = post.userid)
LEFT JOIN icon AS icon ON (icon.iconid = thread.iconid) LEFT JOIN subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = '1')
WHERE thread.threadid IN(18735,18725,18724,18715,18714,18687,18684,18634,18696,18620)


ORDER BY lastpost DESC
LIMIT 10;

MySQL Error : Column 'lastpost' in order clause is ambiguous
Error Number : 1052
Date : Monday, August 20th 2007 @ 10:00:18 PM
Script : http://www.glorifythepast.com/

Brian
08-21-2007, 06:32 PM
Sounds like you didn't apply the change correctly. Can you post that section of code from your news.php file here?

glorify
08-21-2007, 09:30 PM
Yep. Did the edits twice on two different news.php's:


$getnewsids = $db->query_read("
SELECT $ratingsql threadid, firstpostid FROM " . TABLE_PREFIX . "thread AS thread
WHERE visible = 1
AND open != 10
AND thread.forumid IN(" . implode(',', $mods['inforums']) . ")
" . iif($mod_options['portal_news_cutoffdate'], 'AND thread.dateline > ' . (TIMENOW - ($mod_options['portal_news_cutoffdate'] * 86400))) . "
ORDER BY " . iif($mod_options['portal_news_sticky'], 'sticky DESC, ') . 'thread.' . iif($mod_options['portal_news_orderby'] == 'postdateline', 'dateline', $mod_options['portal_news_orderby']) . " $mod_options[portal_news_direction]
$newslimit
");

Brian
08-23-2007, 11:45 AM
The only other thing I could guess is that the file is not being overwritten when you upload it as the code from the SQL error and the code you've posted are not the same.