Option #1 - [No numbers on the end of generated names]
For anyone else who'd like to remove the numbers added to the end of names;
Simply find this line of code in the usergenerator.php file
- $user = trim($names[$i]).$n;
And replace it with -->
- $user = trim($names[$i]); //.$n;
-----------------------------------------------------
Option #2 - [Shorter numbers on the end of generated names.]
(this will help the script avoid duplicate names if you plan on making a lot of fake users)
Alternately, in case anyone else would like to keep the names+numbers; but doesn't like how long the numbers are here here is an adjustment to the number variables that will create names with shorter number suffixes.
Example; Mike12673212 will now be something closer to Mike01 or Mike23
Find this block of code:
- $newuser =& datamanager_init('User', $vbulletin, ERRTYPE_ARRAY);
$i = rand(0, count($names)-1);
$n = rand(0,10);
for($ii = rand(2, 8); $ii > 1; $ii--) {
$n .= rand(0, 9);
}
$user = trim($names[$i]).$n;
$newuser->set('username', $user);
And change it to:
- $newuser =& datamanager_init('User', $vbulletin, ERRTYPE_ARRAY);
$i = rand(0, count($names)-1);
$n = rand(0,1);
for($ii = rand(1, 2); $ii > 1; $ii--) {
$n .= rand(0, 9);
}
$user = trim($names[$i]).$n;
$newuser->set('username', $user);
Additional Names - [Adding more names to the source in which the script pulls its names]
Here's a how to for anyone planning on making more than 20-30 fake users; I recommend adding more names to the source.
Find the code below: (I've shortened the names list to save space here - I'm sure you get the idea)
- $names = array('neo', 'raydon', 'mark', 'giovanni', 'haxerrebel', 'twisted', 'metsrule', 'yankessloser', 'bigwang', 'gangstapride');
Simply add names in the same format as you see above. I've added some below as an example.
- $names = array('neo', 'raydon', 'mark', 'giovanni', 'haxerrebel', 'twisted', 'metsrule', 'jimmyjam', 'tonka', 'tweedle', 'deedum', 'RocketMan', 'tommyboy', 'yankcranker', 'mothergoose', 'rainman', 'yankessloser', 'bigwang', 'gangstapride');
Then after you've made your changes, make sure to save your work. Then upload it - overwrite if prompted. (make sure you upload it to the same location and directory as before).
I hope this little bit helps other coding newbs like myself who were looking for a little bit more flexibility in the script.
please note* I am not the creator of the original code - nor do I make any claims to such. My thanks to it's creator. With a bit of tweaking this script can be polished into a fine tool for forum owners to give themselves a little jump start in building up their forum community.