View Single Post
  #46  
Old 02-16-2009, 03:03 PM
Brakkish Brakkish is offline
 
Join Date: Feb 2009
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01216 seconds
  • Memory Usage 1,770KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete