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

Hi Matt, *,

On Tue, Feb 15, 2011 at 10:45 PM, Matt Sturgeon <> wrote:
Update, Christian has added the banner to the pumbaa site

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"

        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."€
                                "Meterwidth" => $pixels,
                                "Bannertext" => $days." days left")));
                return $vars;


Unsubscribe instructions: E-mail to
List archive:
*** All posts to this list are publicly archived for eternity ***


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.