The Arcive of vBulletin Modifications Site. | 
    |
| 
		 
			 
			#1  
			
			
			
			
			
		 
		
	 | 
|||
		
		
  | 
|||
| 
		
	
		
		
			
			 
			
			I know i have seen a hack that allows the system to randomly pick a users name that appears in a forum.  I am starting a Random Giveaway every month on my sports card trading site and would like a hack that will randomly select a user from the user database....can anyone point me in the right direction? 
		
		
		
		
		
		
		
		
	
	Chris  | 
| 
		 
			 
			#2  
			
			
			
			
			
		 
		
	 | 
|||
		
		
  | 
|||
| 
		
	
		
		
			
			 
			
			How exactly do you want this to work? 
		
		
		
		
		
		
		
		
	
	This will select a random username from all registered users with each and every page load. in global.php find (around line 548): Code: 
	// parse headinclude, header & footer
eval('$headinclude = "' . fetch_template('headinclude') . '";');
eval('$header = "' . fetch_template('header') . '";');
eval('$footer = "' . fetch_template('footer') . '";');
if ($shownewpm)
{
	if ($bbuserinfo['pmunread'] == 1)
	{
		$pmpopupurl = "private.php?$session[sessionurl_js]do=showpm&pmid=$newpm[pmid]";
	}
	else
	{
		$pmpopupurl = "private.php?$session[sessionurl_js]";
	}
	eval('$footer .= "' . fetch_template('pm_popup_script') . '";');
}
Code: 
	$who=$DB_site->query_first("SELECT username, usergroupid, userid FROM " . TABLE_PREFIX . "user WHERE usergroupid='2' ORDER BY rand() LIMIT 1");
$rUsr=$who['username'];
Then in any template add $rUsr where ever you want the username to appear.  | 
| 
		 
			 
			#3  
			
			
			
			
			
		 
		
	 | 
|||
		
		
  | 
|||
| 
		
	
		
		
			
			 
			
			Is there a way to use this code so I can do this via the admin area?  What I would love to be able to do is have a 'Random User Selection' option in the admincp area...then when I click on that it will choose the random user and just print it in that area...so I would need help on adding the link in the admin cp area and then also where I add a template for the admin area. 
		
		
		
		
		
		
		
		
	
	If you can help with this that would be great!  | 
| 
		 
			 
			#4  
			
			
			
			
			
		 
		
	 | 
||||
		
		
  | 
||||
| 
		
	
		
		
			
			 | 
| 
		 
			 
			#5  
			
			
			
			
			
		 
		
	 | 
|||
		
		
  | 
|||
| 
		
	
		
		
			
			 
			
			Thank you - Thank you - Thank you!!! 
		
		
		
		
		
		
		
		
	
	I requested this hack because I run a sports card trading site. On this site we received product from sponsors that we give out to members. I was looking for something to pick a random user every month from the entire member base - not just a thread where a member posts. Thank you again for the hack!  | 
![]()  | 
	
	
		
  | 
	
		
  | 
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
						
  | 
				|
  More Information | 
				|
| 
						 Template Usage: 
						
 Phrase Groups Available: 
						
  | 
					
						 Included Files: 
						
 Hooks Called: 
						
  |