Random User Picker? Wordpress plugin?

Discussion in 'HTML & Website Design' started by victor9191, Apr 6, 2009.

  1. #1
    Is there a plugin that randomly chooses a user? Like something for a giveaway? FOr wordpress though? If you could help me out that'd be awesome guys, I'd add rep.
     
    victor9191, Apr 6, 2009 IP
  2. ExtremeData

    ExtremeData Well-Known Member

    Messages:
    450
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    125
    #2
    Can you post more details ? From where to choose a user ? A user registered to your wp blog ?
    Should be easy to select a random user but post here more details.
     
    ExtremeData, Apr 6, 2009 IP
  3. victor9191

    victor9191 Active Member

    Messages:
    615
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    90
    #3
    Ya, a random user on the WP blog please :D
     
    victor9191, Apr 7, 2009 IP
  4. El_9_Nino

    El_9_Nino Member

    Messages:
    73
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #4
    You could try putting your users' names into random.org/lists.
     
    El_9_Nino, Apr 7, 2009 IP
  5. ExtremeData

    ExtremeData Well-Known Member

    Messages:
    450
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    125
    #5
    I don't thinkthis is what he need.
    I understand that you need to select a random user from existing users not to generate a new username.
    You can do that pretty simple..I think into the users table (on your database) you have unique ID for each username (the ID is autoincremental so it's unique ).You need to make a little php script to generate a number (ID) and to get the user with this ID from databse.
    Will be like that:
    
    $total_num_of_users = ......... //get the total number of users
    $randim_id = rand(1, $total_num_of_users);
    //here get the username with the ID $randim_id
    
    Code (markup):
    Now you will have a random username selected from your db ( the username with the id $randim_id ).
     
    ExtremeData, Apr 7, 2009 IP