Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Project U-232 (http://www.bvlist.com/forumdisplay.php?f=80)
-   -   Donation Bar [Tweaked] (http://www.bvlist.com/showthread.php?t=10236)


       
       
BamBam0077 29th January 2015 16:31

Donation Bar [Tweaked]
 
Hey guys & girls,

not sure if many people would like this addon / tweak but I thought why not share it with you as I just wanted to be nice today and share it with you.

ok I ripped the code out donations.php
Code:

    $progress='';
    $totalfunds_cache = $mc1->get_value('totalfunds_');
    if ($totalfunds_cache === false) {
    $totalfunds_cache =  mysql_fetch_assoc(sql_query("SELECT sum(cash) as total_funds FROM funds"))/* or sqlerr(__FILE__, __LINE__)*/;
    $totalfunds_cache["total_funds"] = (int)$totalfunds_cache["total_funds"];
    $mc1->cache_value('totalfunds_', $totalfunds_cache, $INSTALLER09['expires']['total_funds']);
    }
    $funds_so_far = (int)$totalfunds_cache["total_funds"];
    $totalneeded = 1000;    //=== set this to your monthly wanted amount
    $funds_difference = $totalneeded - $funds_so_far;
    $Progress_so_far = number_format($funds_so_far / $totalneeded * 100, 1);
    if($Progress_so_far >= 100)
    $Progress_so_far = 100;

then added it above the first $htmlout variable
Code:

$htmlout = $doctype."
Then I ripped the rest out that I needed from donations.php
Code:


   
$Progress_so_far%

then I added it after the :
Code:

       

       
       
        Donation Goal: $Progress_so_far%
       

Then appears like this :

http://i.imgbox.com/MzytRNWU.png


OR

http://i.imgbox.com/WOpRHTK7.png

Code:

       

       
       
       
       
        Donation Goal: $Progress_so_far%
       

I hope you like it I know you could just use the default u-232 donation script but I have seen/herd to many ask about making like the way I done it so meh upto you to test and use and edit to your appeal. Good Luck!
DND 29th January 2015 16:40

round edges are the bomb dot com :D
no more square.. :D and also some css3. we are in 2015, not '97 :gum:
this is the only things it's missing :D
and $totalneeded = 1000; can easily be adapted to $VARIABLE['needfunds'] = xyz; in config.php :)
everyone can tweak it as they like.

BamBam0077 29th January 2015 16:41

Quote:

meh upto you to test and use and edit to your appeal. Good Luck!
:ok:

DND 29th January 2015 16:43

no no, it's good, just saying a few options.. maybe someone will actually use it like in my vision :P:wild:

BamBam0077 29th January 2015 16:45

oh, sorry bro misunderstood. :ok:

Bump: Safe from SQL injection :drink:

Bump: Non Memcache
PHP Code:

    $funds_so_far = (int)$totalfunds_cache["total_funds"];
    
$totalneeded 1000;    //=== set this to your monthly wanted amount
    
$funds_difference $totalneeded $funds_so_far;
    
$Progress_so_far number_format($funds_so_far $totalneeded 1001);
    if(
$Progress_so_far >= 100)
    
$Progress_so_far 100;
then 



All times are GMT +2. The time now is 21:48.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.