slawkens1 2017-05-05 14:11:55 +02:00
parent 729944006e
commit 187b70761c

View File

@ -796,6 +796,8 @@ function checkName()
$newchar_vocation = isset($_POST['newcharvocation']) ? $_POST['newcharvocation'] : NULL;
$newchar_town = isset($_POST['newchartown']) ? $_POST['newchartown'] : NULL;
$newchar_errors = array();
$newchar_created = false;
if(isset($_POST['savecharacter']) && $_POST['savecharacter'] == 1) {
if(empty($newchar_name))
$newchar_errors[] = 'Please enter a name for your character!';
@ -929,6 +931,8 @@ function checkName()
}
$player->save();
$player->setCustomField("created", time());
$newchar_created = true;
$account_logged->logAction('Created character <b>' . $player->getName() . '</b>.');
unset($player);
$player = $ots->createObject('Player');
@ -958,8 +962,7 @@ function checkName()
}
}
}
else
{
if(count($newchar_errors) > 0) {
echo '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$template_path.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$template_path.'/images/content/attentionsign.gif);" /></div>';
echo '<b>The Following Errors Have Occurred:</b><br/>';
@ -967,6 +970,8 @@ function checkName()
echo '<li>'.$newchar_error . '</li>';
echo '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$template_path.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></div> </div></div><br/>';
}
if(!$newchar_created) {
echo 'Please choose a name';
if(count($config['character_samples']) > 1)
echo ', vocation';