From fa284fc37addb8fec782c0dabec94541e047c479 Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Wed, 7 May 2014 06:02:10 +0100 Subject: [PATCH] Don't show dice sum if only 1 die was rolled --- post.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/post.php b/post.php index 8e2a5a0f..c39355d6 100644 --- a/post.php +++ b/post.php @@ -534,7 +534,8 @@ if (isset($_POST['delete'])) { // Prepend the result to the post body $modifier = ($diceZ != 0) ? ((($diceZ < 0) ? ' - ' : ' + ') . abs($diceZ)) : ''; - $post['body'] = 'Rolled ' . implode(', ', $dicerolls) . $modifier . ' = ' . $dicesum . "\r\n" . $post['body']; + $dicesum = ($diceX > 1) ? ' = ' . $dicesum : ''; + $post['body'] = 'Rolled ' . implode(', ', $dicerolls) . $modifier . $dicesum . "\r\n" . $post['body']; } }