From cf1d36aa775faa3a1760eae0e5a9740abdbebb5d Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 2 Jan 2005 19:12:56 +0000 Subject: [PATCH] - check for zero user_posts git-svn-id: file:///svn/phpbb/trunk@5041 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/ucp/ucp_main.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 3e08d4686d..c69e7a00d4 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -235,7 +235,7 @@ class ucp_main extends module $active_f_name = $active_f_row['forum_name']; $active_f_id = $active_f_row['forum_id']; $active_f_count = $active_f_row['num_posts']; - $active_f_pct = ($active_f_count / $user->data['user_posts']) * 100; + $active_f_pct = ($user->data['user_posts']) ? ($active_f_count / $user->data['user_posts']) * 100 : 0; } unset($active_f_row); @@ -245,7 +245,7 @@ class ucp_main extends module $active_t_name = $active_t_row['topic_title']; $active_t_id = $active_t_row['topic_id']; $active_t_count = $active_t_row['num_posts']; - $active_t_pct = ($active_t_count / $user->data['user_posts']) * 100; + $active_t_pct = ($user->data['user_posts']) ? ($active_t_count / $user->data['user_posts']) * 100 : 0; } unset($active_t_row);