Percentage, instead of float
Posted: Thu Mar 10, 2011 3:33 pm
Thanks for your help with this, I just can't figure it out as I'm not experienced. I get white pages with the things I've tried.
I'm using a coupon modification for vbulletin and this is the function:
This is the line I need to modify. Basically, I need it to calculate a percentage rather than a float value so it will apply evenly across all subscriptions rather than a flat amount.
I've tried some different things but they've all wound up in white screens.
Thanks for your help.
I'm using a coupon modification for vbulletin and this is the function:
Code: Select all
$coupon_value = $vbulletin->db->query_first("
SELECT couponvalue, couponname
FROM " . TABLE_PREFIX . "coupons
WHERE TO_DAYS(couponvalidto) - TO_DAYS(CURDATE()) > 0
AND nouses > 0
AND couponid = '$couponid'
AND validfor LIKE '%$subscriptionid%'
");
$newvalue = floatval($coupon_value['couponvalue']);
$coupon_name = $coupon_value['couponname'];
$value = vb_number_format(($value - $newvalue), 2);
}
return $value;Code: Select all
$newvalue = floatval($coupon_value['couponvalue']);Thanks for your help.
