Hi Matt, *,

On Tue, Feb 15, 2011 at 10:45 PM, Matt Sturgeon <mtt...@gmail.com> wrote:
> Update, Christian has added the banner to the pumbaa site
> http://pumbaa.documentfoundation.org:7780
>
> He also made a few changes (I think to integrate with SilverStripe),
> for those interested I have quoted his email below (since it wasn't
> CC'd to the list).

For completeness also the Banner-function.
I simplified it a bit for now (esp. I didn't include the sub-day logic
(xxx hours left) and did not yet add the "deadline is in the past"
checks.)

        public static function Banner() {
                return new DataObjectSet(); /* return empty DataObject
set to disable the banner */
                $currentdonations = 5340; /* 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;
        }

ciao
Christian

-- 
Unsubscribe instructions: E-mail to website+h...@libreoffice.org
List archive: http://listarchives.libreoffice.org/www/website/
*** All posts to this list are publicly archived for eternity ***

Reply via email to