Hi Matt,

On Tue, Feb 22, 2011 at 3:34 PM, Matt Sturgeon <[email protected]> wrote:
> The script converts the current amount into a percentage, and then
> converts the percentage into pixels (for use in the width of the bar.)

Minor detail: it doesn't use the percentage (as that is rounded right
away), but computes also the pixels using the amount.

> Currently 100% is 50'000 EURO and 100% is also 330px. The script also
> prevents the percentage from being higher than 100%.

exactly - for reference:

public function Banner() {
        //return new DataObjectSet(); /* return empty DataObject set to
disable the banner */
        /* no banner for fi_FI */
        if ($this->Locale == "fi_FI") {
                return new DataObjectSet();
        }
        $currentdonations = 37900; /* update me */
        /* 2011-03-21 23:59:59 is deadline */
        $seconds = mktime(23, 59, 59, 3, 21, 2011) - time();
        $days = floor($seconds/86400);
        $percent = min(100, round($currentdonations / 500));
        $pixels = min(330, round($currentdonations * 3.3/500)); /* width of
bar is 330px */
        $vars = new DataObjectSet(new ArrayData(array(
                "Metertext"  => $currentdonations."€ ($percent%)",
                "Meterwidth" => $pixels,
                "Bannertext" => $days." days left")));
        return $vars;
}

> The way we should logically allow the script to show higher values

I'd just wouldn't show a progress-meter at all then
But no matter what is decided, adjusting the php/templates accordingly
is rather easy...

ciao
Christian

-- 
Unsubscribe instructions: E-mail to [email protected]
List archive: http://listarchives.libreoffice.org/www/website/
*** All posts to this list are publicly archived for eternity ***

Reply via email to