find:
PHP Code:
$query_goals = $vbulletin->db->query("SELECT * FROM ".TABLE_PREFIX."donation_goals WHERE active = '1' ORDER BY title ASC LIMIT 0,2");
while ($row = $vbulletin->db->fetch_array($query_goals)){
$amount = $row['amount'];
$amount_formatted = number_format($row['amount'], 2, '.', ',');
$goal_total = $row['total_donated'];
$goal_total_formatted = number_format($row['total_donated'], 2, '.', ',');
if ($row['amount'] > 0){
$percentage = round(($goal_total/$amount)*100, 2);
} else {
$percentage = '0';
}
}
replace with:
PHP Code:
$amount = 0;
$goal_total = 0;
$query_goals = $vbulletin->db->query("SELECT * FROM ".TABLE_PREFIX."donation_goals WHERE active = '1' ORDER BY title ASC LIMIT 0,2");
while ($row = $vbulletin->db->fetch_array($query_goals)){
$amount = $amount + $row['amount'];
$amount_formatted = number_format($row['amount'], 2, '.', ',');
$goal_total = $goal_total + $row['total_donated'];
$goal_total_formatted = number_format($row['total_donated'], 2, '.', ',');
if ($row['amount'] > 0){
$percentage = round(($goal_total/$amount)*100, 2);
} else {
$percentage = '0';
}
}
i have not tested this so please respond with results.