Announcement

Collapse
No announcement yet.

userid issue

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

  • userid issue

    I noticed that if I have, say, 310 registered members on the board, with userIDs of 1-310, and deleted the newest 10 (userID 301-310) then the next user to register will get a userID of 311, instead of getting the first empty slot, which is now 301.

    I looked into register.php and found that the first INSERT query enters NULL instead of userid, and I guess that's why it creates a new userid instead of using one that was cleared.

    I added these lines before the insert:


    PHP Code:
    $maxuserid=$DB_site->query_first("SELECT MAX(userid) AS max FROM user");
    $userid=($maxuserid['max']+1); 
    and also changed NULL to $userid.

    That seems to solve this and now all userIDs are consequtive.
    Is this ok, or is there a reason for the original way it is written in?
    Last edited by Zbro; Mon 4th Feb '02, 11:25pm.
    My Board: http://ilf.israel.net/vbb/

  • #2
    The way it is originally written is the way it is supposed to be; that is, letting MySQL handle the auto-incrementing. In this case there is not much harm in doing this (that is not the case for other things, however) but there is little point - the userid is just a number used to manage users internally, it is never actually used anywhere that the end-user would really see it on the screen.

    Comment


    • #3
      Thanks for the reply!

      I used UBB before I moved to vB and in that board each member had his member number written under his post count, like this:

      Zbro
      custom title
      Member # 4


      It's another thing that shows how veteran a member is, like post count, so here's an idea on how the end-user can see it on screen.

      btw, if I use this and make my userIDs consequtive, does it make my database smaller? I mean, since I use less rows...
      My Board: http://ilf.israel.net/vbb/

      Comment


      • #4
        No because it doesn't actually use less rows. The number is completely irrelevant. If for example you had done a UBB import three times, your lowest member number might be 3000 but there are not 2,999 extra rows before it.

        Comment


        • #5
          Originally posted by Zbro
          Thanks for the reply!
          It's another thing that shows how veteran a member is, like post count, so here's an idea on how the end-user can see it on screen.

          Your reasoning doesn't quite make sense to me... You want to display a members userid as a way of showing member seniority, yet you also want to recycle userid's when they're deleted.

          So, if you delete user number 10 who has been around your boards for a couple years, and joe newbie comes in and is assigned userid 10 it'll make him appear more senior than he really is.

          I really think the post count, user title, and registration date are much more effective and you can avoid messing with the internals of vB!
          Boardoo.com - Hosting, Software, WHMCS Addons, and whole lot more.
          Featuring vBLink :: The vBulletin Integration Suite for WHMCS

          Comment


          • #6
            Originally posted by TheHideoutGuy

            So, if you delete user number 10 who has been around your boards for a couple years, and joe newbie comes in and is assigned userid 10 it'll make him appear more senior than he really is.
            Hmm no, I'm afraid you misunderstood me.
            I meant that if I have 300 members, and I remove user #300, that leaves me 299 members... so It makes more sense that the next user will get the highest available userID, which is 300, instead of 301 like usually in vB. Going and filling missing spots in the middle of the table is possible, but like you said, will miss the point of the "seniority" thing.

            It just looks wierd to me to see on boards with 600 members, a member with a userID of 3899. I guess it's just me

            Anyway all I wanted to know is whether my little PHP experiment could mess things up for me, and I got my answer. Thanks again!
            My Board: http://ilf.israel.net/vbb/

            Comment


            • #7
              Ah ha!

              Gotcha... Someone who likes to displays user numbers, you wouldn't be an old BBS operator would you?
              Boardoo.com - Hosting, Software, WHMCS Addons, and whole lot more.
              Featuring vBLink :: The vBulletin Integration Suite for WHMCS

              Comment


              • #8
                Nah...
                Just a picky perfectionist
                My Board: http://ilf.israel.net/vbb/

                Comment

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