Announcement

Collapse
No announcement yet.

Update Thread Info Problem after ubb import

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    I upgraded to vb3 last night.......all is well for now

    Comment


    • #17
      Cheers Scott, I was getting the same error as Freeones... made the mod to misc.php and now all is fine.... thanx

      Comment


      • #18
        Originally posted by UKGSer
        Cheers Scott, I was getting the same error as Freeones... made the mod to misc.php and now all is fine.... thanx
        I was able to fix it by adding a line to misc.php:

        Please forgive me if I'm posting too much code:

        PHP Code:
         // ###################### Start update threads #######################

        if ($action=="updatethread") {
          if (isset(
        $perpage)==or $perpage=="") {
            
        $perpage=2000;
          }
          if (isset(
        $startat)==or $startat=="") {
            
        $startat=0;
          }
          
        $finishat=$startat+$perpage;
          echo 
        "<p>Thread ids:</p>";
          
        $threads=$DB_site->query("SELECT MIN(post.postid) AS minpost, MAX(post.postid) AS maxpost, thread.threadid, MAX(post.dateline) AS dateline,
                (COUNT(*)-1) AS posts,
                  SUM(attachment.visible) AS attachsum
               FROM post,thread
               LEFT JOIN attachment ON attachment.attachmentid=post.attachmentid
               WHERE thread.threadid=post.threadid
                AND thread.threadid>=
        $startat
                AND thread.threadid<
        $finishat
               GROUP BY thread.threadid
               ORDER BY threadid DESC"
        );
          while (
        $thread=$DB_site->fetch_array($threads)) {
            
        $threadid=$thread[threadid];
            echo 
        "Processing thread <b>$threadid</b><br>\n";
            
        flush();
            
        $attachsum=$thread[attachsum];
            
        $numberposts=$thread[posts];
            
        $lastpost=$thread[dateline];
            
        $firstusername=$DB_site->query_first("SELECT username,userid FROM post WHERE postid=$thread[minpost]");
            
        $firstuserid=$firstusername['userid'];
            if (
        $firstusername[userid]==0) {
              
        $firstusername=$firstusername[username];
            } else {
              
        $users=$DB_site->query_first("SELECT username FROM user WHERE userid=$firstusername[userid]");
              
        $firstusername=$users[username];
            }
            
        $lastusername=$DB_site->query_first("SELECT username,userid FROM post WHERE postid=$thread[maxpost]");
            if (
        $lastusername[userid]==0) {
              
        $lastusername=$lastusername[username];
            } else {
              
        $users=$DB_site->query_first("SELECT username FROM user WHERE userid=$lastusername[userid]");
              
        $lastusername=$users[username];
            }
          if (!
        $attachsum$attachsum "0";
            
        $DB_site->query("UPDATE thread SET lastpost=$lastpost,replycount=$numberposts,postusername='".addslashes($firstusername)."', postuserid='$firstuserid', lastposter='".addslashes($lastusername)."',attach=$attachsum WHERE threadid=$threadid");
          }
          if (
        $checkmore=$DB_site->query_first("SELECT threadid FROM thread WHERE threadid>=$finishat")) {
            
        cpredirect("misc.php?s=$session[sessionhash]&action=updatethread&startat=$finishat&perpage=$perpage");
            echo 
        "<p><a href=\"misc.php?s=$session[sessionhash]&action=updatethread&startat=$finishat&perpage=$perpage\">Click here to continue updating threads</a></p>";
          } else {
            echo 
        "<p>Threads updated!</p>";
            
        cpredirect("misc.php?s=$session[sessionhash]",1);
          }

        The line I added is:

        if (!$attachsum) $attachsum = "0";

        Comment


        • #19
          Just wanna say "thanks".
          After a fatal server crash I restored the Database along with updating to mySQL 4.0.16, and than received this error.
          Now everything seems to run well
          Sorry for my English, I hope you'll understand....
          Das Wohlf├╝hlboard

          Comment

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