Blogs Database error in vBulletin 4.1.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DWest
    New Member
    • Aug 2011
    • 4
    • 4.1.x

    [Blog] Blogs Database error in vBulletin 4.1.0

    When I try to enable Blogs on the site and visit /blog.php I get the Invalid SQL error below. Strange thing is that if I'm logged in as the original admin it seem to work, but any other administrator or user get this error. It works for everyone though to visit an individual users blog posts or blog profile, only the main blog page that doesn't work.
    Any idea what might be causing this?


    I have no modifications/plugins installed and all blog posts were imported from a Ning site. I run vBulletin 4.10 PL4.
    If you need any more info to pinpoint this let me know and I'll post it ASAP.

    It has worked before but now I get this error:
    Code:
    Invalid SQL:
    
    
            (
                SELECT COUNT(*) AS total,
                FROM_UNIXTIME(dateline - 10800, '%c-%e-%Y') AS period
                FROM forum_blog AS blog
                
                WHERE state IN('visible', 'moderation', 'deleted') AND dateline >= 1311465600 AND dateline < 1312889953
                GROUP BY period
            ) UNION (
                SELECT COUNT(*) AS total,
                FROM_UNIXTIME(dateline - 10800, '%c-%e-%Y') AS period
                FROM forum_blog AS blog
                WHERE blog.userid IN () AND dateline >= 1311465600 AND dateline < 1315094400
                GROUP BY period
            );
    
    
    MySQL Error   : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND dateline >= 1311465600 AND dateline < 1315094400
                GROUP BY period
            )' at line 12
    Error Number  : 1064
    Request Date  : Tuesday, August 9th 2011 @ 02:39:13 PM
    Error Date    : Tuesday, August 9th 2011 @ 02:39:13 PM
    Script        : http://mysite.com/forum/blog.php
    Referrer      : http://mysite.com/forum/forum.php
    IP Address    : xx.x.xxx.x
    Username      : xxxx
    Classname     : vB_Database
    MySQL Version : 5.1.54-0.dotdeb.0-log
  • Lynne
    Former vBulletin Support
    • Oct 2004
    • 26255

    #2
    This:
    PHP Code:
    WHERE blog.userid IN () 
    comes from this:
    PHP Code:
    else if (!$userinfo AND $vbulletin->userinfo['userid'] AND $vbulletin->userinfo['permissions']['vbblog_general_permissions'] & $vbulletin->bf_ugp_vbblog_general_permissions['blog_canviewown'])
        {
            
    // blogs that I am a member of here ....
            
    $sql2[] = "blog.userid IN (" $vbulletin->userinfo['memberblogids'] . ")"
    I wouldn't think they would end up in that else statement. Disable all other products except the vBulletin Blog and vBulletin CMS (Admin CP -> Plugins & Products -> Manage Products -> Disable) AND uncheck all the plugins except those related to the vBulletin Blog and vBulletin CMS by (Admin CP -> Plugins & Products -> Plugin Manager). You must do BOTH of those steps in order to disable all non vBulletin Modifications and then see if you still have the same problem.

    Please don't PM or VM me for support - I only help out in the threads.
    vBulletin Manual & vBulletin 4.0 Code Documentation (API)
    Want help modifying your vbulletin forum? Head on over to vbulletin.org
    If I post CSS and you don't know where it goes, throw it into the additional.css template.

    W3Schools &lt;- awesome site for html/css help

    Comment

    • DWest
      New Member
      • Aug 2011
      • 4
      • 4.1.x

      #3
      I've tried your suggestion and done BOTH of these steps, but I still get the same error. The thing puzzling me the most is why it works for the admin user but not for anyone else. Any suggestions?

      Comment

      • Trevor Hannant
        vBulletin Support
        • Aug 2002
        • 24325
        • 5.7.X

        #4
        Can you try re-downloading the ZIP file from the Members Area and re-upload all files (except install/install.php and includes/config.php.new) making sure you overwrite all files currently on your server.

        Does this resolve the problem?
        Vote for:

        - Admin Settable Paid Subscription Reminder Timeframe (vB6)
        - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

        Comment

        • Neutral Singh
          Senior Member
          • Sep 2004
          • 232
          • 3.8.x

          #5
          did it resolve the problem... i am facing exactly the same problem...

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...