Announcement

Collapse
No announcement yet.

Update Thread Info Problem after ubb import

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

  • Supernature
    replied
    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

    Leave a comment:


  • adamantium
    replied
    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";

    Leave a comment:


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

    Leave a comment:


  • padmaster
    replied
    I upgraded to vb3 last night.......all is well for now

    Leave a comment:


  • Steve Machol
    replied
    Revert your vbcode_smilies_getmore template back to original.

    Leave a comment:


  • padmaster
    replied
    I reran the update thread info without any errors.....that problem seems to be fixed.


    Now I'm getting a 404 when I click on 'get more' smilies in a reply

    I tried reverting back to the smilie.php from yesterday but it didn't help.



    HELP

    Leave a comment:


  • padmaster
    replied
    hmmmm, yesterday I d/l my daily site backup thru cpanel at 28mb, today it is only 15mb......and I've actually had a couple of new members today. Could fixing this problem and running update thread info make the backup that much smaller? The forums backup is a little bigger today as I would expect.

    Leave a comment:


  • padmaster
    replied
    nevermind, I got it

    Leave a comment:


  • padmaster
    replied
    What text editor are you guys using that shows the line # ?

    Leave a comment:


  • iloco
    replied
    Thanks Steve for the code. I needed it this morning and it worked great.

    Leave a comment:


  • SixthSense
    replied
    I've faceds the same problem w/ the thread info -like last poster, number of posts-.
    After I changed that as suggested, everything is fine now.

    Thanks for your help.

    Leave a comment:


  • mark@sb.ws
    replied
    Same problem I had. I made changes Steve suggested and it works great. Thanks

    Leave a comment:


  • Boofo
    replied
    Originally posted by Steve Machol
    You shouldn't be having this same problem with 4.0.12. However it shouldn't hurt to change it. Keep a backup of misc.php just in case.
    I'm not having any problems yet, but my host changed to 4.0.1.2 before I knew it so I expect the same for 4.0.1.3. I am currently running 2.2.9 but I went ahead and changed it anyway to try and avoid any future problems.

    Leave a comment:


  • Steve Machol
    replied
    You shouldn't be having this same problem with 4.0.12. However it shouldn't hurt to change it. Keep a backup of misc.php just in case.

    Leave a comment:


  • Boofo
    replied
    Is it ok to change this if we are still running 4.0.1.2?

    Leave a comment:

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