Ability to customize default name ("Anonymous")

This commit is contained in:
Savetheinternet 2011-02-17 20:12:09 +11:00
parent 7ecac9937d
commit 5170cd7aa8
2 changed files with 7 additions and 4 deletions

View File

@ -306,10 +306,13 @@
$config['button_newtopic'] = 'New Topic'; $config['button_newtopic'] = 'New Topic';
$config['button_reply'] = 'New Reply'; $config['button_reply'] = 'New Reply';
// The default name (ie. Anonymous)
$config['anonymous'] = 'Anonymous';
// The string passed to date() for post times // The string passed to date() for post times
// http://php.net/manual/en/function.date.php // http://php.net/manual/en/function.date.php
$config['post_date'] = 'm/d/y (D) H:i:s'; $config['post_date'] = 'm/d/y (D) H:i:s';
// Always act as if they had typed "noko" in the email field no mattter what // Always act as if they had typed "noko" in the email field no mattter what
$config['always_noko'] = false; $config['always_noko'] = false;
?> ?>

View File

@ -142,7 +142,7 @@
error($config['error']['noimage']); error($config['error']['noimage']);
} }
$post['name'] = (!empty($_POST['name'])?$_POST['name']:'Anonymous'); $post['name'] = (!empty($_POST['name'])?$_POST['name']:$config['anonymous']);
$post['subject'] = $_POST['subject']; $post['subject'] = $_POST['subject'];
$post['email'] = utf8tohtml($_POST['email']); $post['email'] = utf8tohtml($_POST['email']);
$post['body'] = $_POST['body']; $post['body'] = $_POST['body'];
@ -189,7 +189,7 @@
if($mod && $mod['type'] >= MOD && preg_match('/^((.+) )?## (.+)$/', $post['name'], $match)) { if($mod && $mod['type'] >= MOD && preg_match('/^((.+) )?## (.+)$/', $post['name'], $match)) {
if(($mod['type'] == MOD && $match[3] == 'Mod') || $mod['type'] >= ADMIN) { if(($mod['type'] == MOD && $match[3] == 'Mod') || $mod['type'] >= ADMIN) {
$post['mod_tag'] = $match[3]; $post['mod_tag'] = $match[3];
$post['name'] = !empty($match[2])?$match[2]:'Anonymous'; $post['name'] = !empty($match[2])?$match[2]:$config['anonymous'];
} }
} else { } else {
$post['mod_tag'] = false; $post['mod_tag'] = false;