From 4adf893c3906bebb29fc1720793366291da87b58 Mon Sep 17 00:00:00 2001 From: Jano Slota Date: Thu, 3 Jul 2014 02:55:33 +0200 Subject: [PATCH] Random names for anonymous users - thanks to svnth --- inc/config.php | 3 ++- inc/functions.php | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/inc/config.php b/inc/config.php index 494ccda1..4ffff767 100644 --- a/inc/config.php +++ b/inc/config.php @@ -773,7 +773,8 @@ // $config['board_path'] if you wish to change the URL. $config['board_abbreviation'] = '/%s/'; - // The default name (ie. Anonymous). + // The default name (ie. Anonymous). Can be an array - in that case it's picked randomly from the array. + // Example: $config['anonymous'] = array('Bernd', 'Senpai', 'Jonne', 'ChanPro'); $config['anonymous'] = 'Anonymous'; // Number of reports you can create at once. diff --git a/inc/functions.php b/inc/functions.php index 70f15c59..6ce76472 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -240,6 +240,9 @@ function loadConfig() { event_handler('post', 'postHandler'); } + if (is_array($config['anonymous'])) + $config['anonymous'] = $config['anonymous'][array_rand($config['anonymous'])]; + event('load-config'); if ($config['debug']) {