Username of deleted user still shows in thread starters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • borbole
    Senior Member
    • Feb 2010
    • 3074
    • 4.0.0

    #16
    Originally posted by chran
    That's ok

    See my reply to Andreas for why I haven't done that yet.
    All you have to do is to enter the right id of the post/s and the thread/s of the deleted user/s and a username under which you want to bring those posts and threads. You can get their ids at the db or even at the forum (by checking the url at the posts/threads in question).

    Comment

    • chran
      Member
      • Mar 2006
      • 49
      • 3.6.x

      #17
      Originally posted by borbole
      All you have to do is to enter the right id of the post/s and the thread/s of the deleted user/s and a username under which you want to bring those posts and threads. You can get their ids at the db or even at the forum (by checking the url at the posts/threads in question).
      I think I'm getting somewhere

      I'm playing around with phpMyAdmin, and I've managed to get all the threads where she is the thread starter:

      Code:
      SELECT  `threadid` ,  `title` ,  `postuserid` 
      FROM  `vb_thread` 
      WHERE  `postuserid` =99
      LIMIT 0 , 100
      That gets the right threads, and there are 88 of them. The "title" is just for verification.

      That means that

      Code:
      UPDATE vb_thread SET postusername = '"Deleted user"' WHERE postuserid= 99;
      should do I want, right? Am I using the right things around "Deleted user" (I don't know what they're called)? I know SQL is pretty anal about that kind of thing.

      Incidentally, there are no results in the vb_post table when I run a search for userid 99; I'm guessing thread starters are different from posts? That makes it easier - it's just one table to update.

      Comment

      • borbole
        Senior Member
        • Feb 2010
        • 3074
        • 4.0.0

        #18
        Originally posted by chran
        I think I'm getting somewhere

        I'm playing around with phpMyAdmin, and I've managed to get all the threads where she is the thread starter:

        Code:
        SELECT  `threadid` ,  `title` ,  `postuserid` 
        FROM  `vb_thread` 
        WHERE  `postuserid` =99
        LIMIT 0 , 100
        That gets the right threads, and there are 88 of them. The "title" is just for verification.

        That means that

        Code:
        UPDATE vb_thread SET postusername = '"Deleted user"' WHERE postuserid= 99;
        should do I want, right? Am I using the right things around "Deleted user" (I don't know what they're called)? I know SQL is pretty anal about that kind of thing.

        Incidentally, there are no results in the vb_post table when I run a search for userid 99; I'm guessing thread starters are different from posts? That makes it easier - it's just one table to update.
        No no, I think you are doing it wrong. The way you posted it is from the way I asked you before to do it with my mod. Which you said that you didn''t want to do that. you simply wanted to replace the username of the deleted user with another username. That is what you said.

        That can be done with the queries that were posted by Andreas.


        Now, that username that you want to replace the posts of the deleted users, is that from another user at your forum? Or it is just a username that doesn''t belong to anyone.

        I am asking you because you got me all confused again with your last post. If the username belongs to another user at your forum and you want to bring all the posts and threads of the deleted user under him/her, then run these queries instead:


        For the posts:

        Code:
        UPDATE vb_post 
                SET userid = 99
                WHERE username = 'deletedusername';
        For the threads:

        Code:
        UPDATE vb_thread 
                SET postuserid = 99
                WHERE postusername = 'deletedusername';
        And replace accordingly the uid and the deleted username. I used uid 99 based on your example above.


        Now, which from the 2 ways is it

        Another thing, it would be best to make a duplicate of your main forum to a test one and experiment at the db of your test forum until you get things right.


        P.s. From your last post I think it is the second method, which I mentioned before as well. But I am not really sure. That is why I needed you to be as detailed and exact as possible,

        Comment

        • chran
          Member
          • Mar 2006
          • 49
          • 3.6.x

          #19
          I do want to use Andreas' solution, I'm just trying to figure out what to put in there.

          The first query I ran was

          Code:
          SELECT  `title` ,  `postusername` ,  `postuserid` 
          FROM  `vb_thread` 
          WHERE  `postusername` LIKE CONVERT( _utf8 'USERNAME'
          USING latin1 ) 
          COLLATE latin1_swedish_ci
          LIMIT 0 , 30
          that's when I found out that her userid is still there, even though she's deleted.

          But since there are multiple threads (88), I use the postuserid in my WHERE-clause instead of the threadid:

          Code:
          UPDATE thread SET postusername = 'X' WHERE postuserid = Y;
          No, "Deleted user" is not a user on the forum

          Comment

          • borbole
            Senior Member
            • Feb 2010
            • 3074
            • 4.0.0

            #20
            When a user is deleted from your forum, then his/her id goes to 0, like guests. That is why you need to enter their old username at the query.

            Just run Andrea''s suggestions exactly as he posted them. Only thing is to edit accordingly the deleted user username and the posts/threads id''s and you should be all set

            Comment

            • chran
              Member
              • Mar 2006
              • 49
              • 3.6.x

              #21
              Originally posted by borbole
              When a user is deleted from your forum, then his/her id goes to 0, like guests. That is why you need to enter their old username at the query.
              Like I already said, her userid is in the table. I don't know why but it is.

              Originally posted by borbole
              Just run Andrea''s suggestions exactly as he posted them. Only thing is to edit accordingly the deleted user username and the posts/threads id''s and you should be all set
              I don't want to run that query 88 times in a row. Why should I, when postuserid is right there?

              Thank you for help.

              Comment

              • borbole
                Senior Member
                • Feb 2010
                • 3074
                • 4.0.0

                #22
                Originally posted by chran
                Like I already said, her userid is in the table. I don't know why but it is.

                I don't want to run that query 88 times in a row. Why should I, when postuserid is right there?

                Thank you for help.
                You have never mentioned before in your posts here that her userid is still on the table. You said only thet that user is deleted. If her uid is still at the table then her account is not deleted. If it was deleted then her userid would have jumped to 0. And if the poster user id was still there then the posts wouldn''t appear as belonging to the guests.

                Anyway, this is getting a bit confusing for me. In order to help you properly I must check things out visually for myself.

                Sorry that I couldn''t be of no more help. Hopefully someone else that won''t get confused by all these contradictory statements will come along and help you out further

                Comment

                • chran
                  Member
                  • Mar 2006
                  • 49
                  • 3.6.x

                  #23
                  Originally posted by borbole
                  You have never mentioned before in your posts here that her userid is still on the table. You said only thet that user is deleted.
                  Well, this post says that there are no posts matching her userid in the vb_post table (bottom paragraph), and this post says her userid is still there.

                  Originally posted by borbole
                  If her uid is still at the table then her account is not deleted. If it was deleted then her userid would have jumped to 0. And if the poster user id was still there then the posts wouldn''t appear as belonging to the guests.
                  Her userid is not present in vb_user, so she is deleted. Also, I remember quite clearly deleting her.

                  Originally posted by borbole
                  Anyway, this is getting a bit confusing for me. In order to help you properly I must check things out visually for myself.
                  Which I why I put an image in my first post ...

                  Originally posted by borbole
                  Sorry that I couldn''t be of no more help. Hopefully someone else that won''t get confused by all these contradictory statements will come along and help you out further
                  I'm sorry that vBulletin is not behaving the way you expect, but I haven't made contradictory statements. I have told what I have done, and what is in my database.

                  Comment

                  • borbole
                    Senior Member
                    • Feb 2010
                    • 3074
                    • 4.0.0

                    #24
                    Originally posted by chran

                    I'm sorry that vBulletin is not behaving the way you expect, but I haven't made contradictory statements. I have told what I have done, and what is in my database.
                    It is not like how I want it but how it is

                    Also Andreas posted the examples on the assumptions that the user was deleted totally from the db, the same thing I assumed as well... .

                    Comment

                    • chran
                      Member
                      • Mar 2006
                      • 49
                      • 3.6.x

                      #25
                      I have been in contact with vBulletin staff (via a support-ticket) and they say it's expected behaviour that the postid stays in the thread-table, but is set to 0 in the post-table.

                      Comment

                      • Andreas
                        Senior Member
                        • Feb 2004
                        • 2323

                        #26
                        I have been in contact with vBulletin staff (via a support-ticket) and they say it's expected behaviour that the postid stays in the thread-table, but is set to 0 in the post-table.
                        The only postids there are in table thread are firstpostid/lastpostid - and those obviously will stay as long as those posts are not being deleted/moved/etc.

                        If the postuserid/userid is still in the tables then the account wasn't fully deleted (otherweise it would be zero).

                        Anyway:
                        Code:
                        UPDATE post SET userid = 0, username = 'W' WHERE postid IN (X, Y, Z);
                        UPDATE thread SET postuserid = 0, postusername = 'W' WHERE threadid IN (X, Y, Z);
                        With
                        W = The usernamne you want to set (eg. Deleted User)
                        X, Y, Z being the affected postids/threadids.

                        Comment

                        • chran
                          Member
                          • Mar 2006
                          • 49
                          • 3.6.x

                          #27
                          Originally posted by Andreas
                          The only postids there are in table thread are firstpostid/lastpostid - and those obviously will stay as long as those posts are not being deleted/moved/etc.
                          Well, that's not the case in my database ... (these are the fields from my vb_thread-table):

                          Code:
                          vb_thread
                          
                          threadid
                          title
                          [B]firstpostid[/B] <--
                          lastpost
                          forumid
                          pollid
                          open
                          replycount
                          hiddencount
                          postusername
                          [B]postuserid[/B] <--
                          lastposter
                          dateline
                          views
                          iconid
                          notes
                          visible
                          sticky
                          votenum
                          votetotal
                          attach
                          similar
                          deletedcount
                          [B]lastpostid[/B] <--
                          prefixid
                          taglist
                          Originally posted by Andreas
                          If the postuserid/userid is still in the tables then the account wasn't fully deleted (otherweise it would be zero).
                          The vB-staffer I contacted disagree with you:

                          Once a user is deleted, all the posts (in the post table) retain the username, but get the userid "0" (yes, borbole was correct). In the thread table, the old userid actually stays in the database. This is why when Andreas wrote the queries, he did it based on the username, not a userid.
                          Originally posted by Andreas
                          Anyway:
                          Code:
                          UPDATE post SET userid = 0, username = 'W' WHERE postid IN (X, Y, Z);
                          UPDATE thread SET postuserid = 0, postusername = 'W' WHERE threadid IN (X, Y, Z);
                          With
                          W = The usernamne you want to set (eg. Deleted User)
                          X, Y, Z being the affected postids/threadids.
                          Thank you for this! So I actually do need to put in those 88 thread-id's? :-/

                          Comment

                          • Andreas
                            Senior Member
                            • Feb 2004
                            • 2323

                            #28
                            Originally posted by chran
                            Code:
                            vb_thread
                            threadid
                            title
                            [B]firstpostid[/B] <--
                            lastpost
                            forumid
                            pollid
                            open
                            replycount
                            hiddencount
                            postusername
                            [B]postuserid[/B] <--
                            lastposter
                            dateline
                            views
                            iconid
                            notes
                            visible
                            sticky
                            votenum
                            votetotal
                            attach
                            similar
                            deletedcount
                            [B]lastpostid[/B] <--
                            prefixid
                            taglist
                            Well ... either I am blind or there are only 2 postids: firstpostid and lastpostid, as stated in my previous post

                            In the thread table, the old userid actually stays in the database. This is why when Andreas wrote the queries, he did it based on the username, not a userid.
                            Amazing, I never noticed that - reporting as a bug right now :-)
                            Last edited by Andreas; Mon 10 May '10, 12:20am.

                            Comment

                            • chran
                              Member
                              • Mar 2006
                              • 49
                              • 3.6.x

                              #29
                              Originally posted by Andreas
                              Well ... either I am blind or there are only 2 postids: firstpostid and lastpostid, as stated in my previous post
                              Tru dat

                              Originally posted by Andreas
                              Amazig, I never noticed that - reporting as a bug right now :-)
                              If at first you don't succeed, report it as a bug

                              Anywho, I'll get to deleting tonight - I figure it's best to do when the forum is shut down.

                              Comment

                              • borbole
                                Senior Member
                                • Feb 2010
                                • 3074
                                • 4.0.0

                                #30
                                Like I told you chran, it is not like how I want it but how it is, as confirmed to you by the vb staff as well

                                Anyway, it would be best, in my opinion, if you made first a duplicate of your forum at your test one and run the query at your test database first. Or if you want to run them directly at your live db then make a full backup of those tables. Good luck with it

                                Comment

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