Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hi Matt,

On Tue, Feb 22, 2011 at 3:34 PM, Matt Sturgeon <mttza1@gmail.com> 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 website+help@libreoffice.org
List archive: http://listarchives.libreoffice.org/www/website/
*** All posts to this list are publicly archived for eternity ***

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.