Last user to register bug...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WebStyles
    Senior Member
    • Apr 2000
    • 323

    Last user to register bug...

    Ok, not sure if this is a bug or not... Or if something got messed up when we imported our UBB info. We noticed that the member count went up by 2, and the thread/reply counts were a little "padded" as well. When we upgraded to 1.1.1 today, that all fixed itself. Unfortunately, the [i]welcome to our newest member, username![/i] displays the wrong member now. I found the query that finds the newest member, [b]SELECT username,userid FROM user WHERE userid=$numbermembers[/b]. It looks like it will always be 2 behind now. Is there any way to fix this?
    We're Here Forums!
    [email protected]
  • John
    Senior Member
    • Apr 2000
    • 4042

    #2
    Hmmm. I'm not exactly sure why it should be doing that, but try this code instead:

    [code]
    $getnewestusers=$DB_site->query_first("SELECT username,userid FROM user ORDER BY joindate DESC LIMIT 1");
    [/code]

    John
    John Percival

    Artificial intelligence usually beats real stupidity ;)

    Comment

    • werehere
      Senior Member
      • Apr 2000
      • 1827

      #3
      This bit of code did not work. It dropped the member number displayed down 17 member numbers, where before it was only 2.

      Hope that made sense:)
      Attached Files
      We're Here Forums!
      [email protected]

      Comment

      • TB2
        Member
        • May 2000
        • 63

        #4
        Bug?

        421 Users registered

        Let's have a look at my table "user":

        I have entries for users with the id:

        1 exists
        2 to 5 doesn't exist
        6 exists
        7 to 24 doesn't exist
        25 to 419 exists

        The last member owns the userid 442 !

        vB shows in the forumhome as last member the data of member 421 instead of 442 .... i think cause it simply counts the amount of entries in the table "user" and adds the name and link of the my member 421 (the real amount of members) instead of the last entry in the table ....

        How could i fix this?

        Should vB offers something like "Renumber members" in the controlpanel?


        Comment

        • John
          Senior Member
          • Apr 2000
          • 4042

          #5
          This is fixed in the next version. Until then, you can use that code above.

          John
          John Percival

          Artificial intelligence usually beats real stupidity ;)

          Comment

          • werehere
            Senior Member
            • Apr 2000
            • 1827

            #6
            WE ended up using

            [code]$query = "select * from user order by userid desc limit 1";[/code]

            in replacement to the SQL query that john suggested.
            We're Here Forums!
            [email protected]

            Comment

            • Rick Horwitz
              Senior Member
              • Apr 2000
              • 361
              • 3.8.x

              #7
              What file is that code go into?

              Comment

              • Moonwolf
                Member
                • May 2000
                • 92

                #8
                [QUOTE][i]Originally posted by Rick Horwitz [/i]
                [B]What file is that code go into? [/B][/QUOTE]

                forum/index.php

                Find on Line 90:

                [code]
                $getnewestusers=$DB_site->query_first("SELECT username,userid FROM user WHERE userid=$numbermembers");
                [/code]

                That's the one you need to change, to which-ever version above you want :)

                Katherine

                Comment

                • werehere
                  Senior Member
                  • Apr 2000
                  • 1827

                  #9
                  When we used Johns version it was seriously off for some reason, but that one I posted seemed to fix all problems with our last registered members:)
                  We're Here Forums!
                  [email protected]

                  Comment

                  Related Topics

                  Collapse

                  Working...