From b5736e3ad3830fa732dcbd1a518ec3dd6ea7b98a Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Thu, 13 Aug 2009 17:46:09 -0400 Subject: Rewrote Admin panel The following database changes must be made: * A TEXT column called "text" must be added to the end of "polloftheweek" * The transferPollRss.php script must be run * The "pollrss" table must be dropped Closes #113 --- includes/functions.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'includes/functions.php') diff --git a/includes/functions.php b/includes/functions.php index 090e9d0..b0b28d5 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -65,7 +65,14 @@ function dispIfNotOld($datTim) function getpercent($getpoll3,$num) { $maxper = ($getpoll3['clicks1'] + $getpoll3['clicks2'] + $getpoll3['clicks3'] + $getpoll3['clicks4']); - $percent = round(($getpoll3['clicks' . $num] / $maxper) * 100); + + if ($maxper == 0) + { + return 0; + } else { + $percent = round(($getpoll3['clicks' . $num] / $maxper) * 100); + } + return($percent); } -- cgit 1.4.1