Results 1 to 12 of 12

Thread: News Module Not Working

  1. #1
    Join Date
    Jun 2004
    Posts
    8

    Default News Module Not Working

    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?

  2. #2
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: News Module Not Working

    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.

  3. #3
    Join Date
    Jun 2004
    Posts
    8

    Default Re: News Module Not Working

    Thank you, I will re-download tonight and give it a shot and will report back if it is successful.

  4. #4
    Join Date
    Jun 2004
    Posts
    8

    Default Re: News Module Not Working

    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

  5. #5
    Join Date
    Apr 2007
    Posts
    11

    Default Re: News Module Not Working

    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

  6. #6
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: News Module Not Working

    Thank you for pointing that out. If you'll look in your modules/news.php file for this code:
    PHP 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:
    PHP Code:
                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.

  7. #7
    Join Date
    Apr 2007
    Posts
    11

    Default Re: News Module Not Working

    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.

  8. #8
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: News Module Not Working

    Sorry, but there is not an option to show the last post instead of the first.

  9. #9

    Default Re: News Module Not Working

    Even after your news.php edit, I still get:

    Code:
    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/

  10. #10
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: News Module Not Working

    Sounds like you didn't apply the change correctly. Can you post that section of code from your news.php file here?

  11. #11

    Default Re: News Module Not Working

    Yep. Did the edits twice on two different news.php's:

    Code:
    $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
    			");

  12. #12
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: News Module Not Working

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How Do i get the news module working?
    By ep13 in forum "How Do I..." Questions
    Replies: 1
    Last Post: 01-12-2007, 02:31 PM
  2. News module not working as expected
    By mferguson in forum Troubleshooting & Problems
    Replies: 2
    Last Post: 10-08-2005, 06:33 PM
  3. News not working
    By Todaysfishing in forum Troubleshooting / "How do I..." Questions
    Replies: 4
    Last Post: 04-07-2005, 06:12 PM
  4. News Module not working properly
    By enzo81 in forum Troubleshooting / "How do I..." Questions
    Replies: 6
    Last Post: 07-05-2004, 11:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •