Ok, well I've got it implimented.

meter-fill.png - http://img407.imageshack.us/img407/2935/meterfill.png
banner1.png  - http://img189.imageshack.us/img189/4644/banner1ny.png

--------------banner1.css--------------
a.banner1 {
        position:absolute;
        top:13px;
        text-decoration: none;
        color:#000;
        cursor:pointer;
        margin:0;
        padding:0;
} div#banner1 {
        background:url('banner1.png') no-repeat;
        height:60px;
        width:600px;
        overflow:hidden;
} #countdown {
        color:#555;
        position:relative;
        top:-23px;
        left:6px;
        margin:5px;
} #marker1 {
        background:#ccf4c6;
        border:1px solid #18a303;
        position:relative;
        top:-3px;
        left:248px;
        width:330px;
} #marker2 {
        position:relative;
        height:13px;
        background:#18a303 url('meter-fill.png') repeat-x;
        bottom:0;
        left:0;
        display:block;
        border-right:1px solid #207313;
} #marker-text {
        color:#106802;
        position:relative;
        top:27px;
        left:248px;
        z-index:5;
        width:330px;
        font-size:0.9em;
        text-align:center;
}
------------End banner1.css------------------


------------banner1.php-------------------------
<?php
$donation_goal = 50000;
$donation_current = 1568; // Where to link this?
$currency = '&#8364;'; // Euros


// Get a percentage
$donation_percent = ($donation_current / $donation_goal) * 100;

// Make the percentage an integer
if ($donation_percent > 100) {
        $donation_percent = 100;
} elseif ($donation_percent > 99 && $donation_percent < 100) {
        $donation_percent = 99;
} elseif ($donation_percent < 1 && $donation_percent > 0) {
        $donation_percent = 1;
} else {
        $donation_percent = round($donation_percent);
}

// convert it to pixels
$donation_pixels = $donation_percent * 3.3;


// mktime ( Hours, Mins, Secs, Month, Day, Year )
$to = mktime(23, 59, 59, 2, 28, 2011);
$now = time();
$interval = $to - $now;

$countdown_d = floor ( $interval /  (24*3600) );
$countdown_h = floor( ($interval-$countdown_d*24*3600) / 3600 );
$countdown_m = floor( ($interval-$countdown_d*24*3600-$countdown_h*3600) / 60 );
?>
-------------End banner1.php-------------------------



------------- Nest this in <div id="TopHeader" /> replacing <p
id="HeaderTagLine"
/> --------------------------
                                <!--donation meter begin-->
                                <a class="banner1" href="/get-involved/donate/" 
title="Go to the
donations page to find out more"><div id="banner1">
                                        <p id="marker-text">
                                                <?php 
echo($currency.$donation_current.",&nbsp;".$donation_percent);?>%
                                        </p>
                                        <div id="marker1">
                                                <div id="marker2" 
style="width:<?php echo($donation_pixels);?>px;">
                                                </div>
                                        </div>
                                        <h2 id="countdown"><?php
                                                             if ($countdown_d < 
5 && $countdown_d != 0)
echo ("Only ");
                                                                                
 if ($countdown_d > 0) echo ($countdown_d." days left!");
                                                                                
 elseif ($countdown_d <= 0 && $countdown_h > 0) echo
($countdown_h." hours left!");
                                                                                
 elseif ($countdown_h <= 0 && $countdown_m > 0) echo
($countdown_h." minutes left!");
                                                                                
 else echo ("Times up! But you can still donate...");
                                                           ?></h2>
                                </div></a>
                                <!--donation meter end-->
-------------- End section to be nested ---------------------

And don't forget to <link> the CSS stylesheet, and include(); the PHP script


Oh, and upload the images - and correct any paths (URL/URI's) in any
of the text ofcourse

-- 
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