81
intel352
Re: Paypal Donations 1.4 / Donators listed as anonymous...
  • 2004/6/29 12:16

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23





i recommend looking around the paypal developer site if you're really interested in learning more about how paypal works, it's some interesting information, and you might find ways to change the module to more suit your site, if needed

82
alyussiu
Re: Paypal Donations 1.4 / Donators listed as anonymous...
  • 2004/6/29 13:58

  • alyussiu

  • Not too shy to talk

  • Posts: 119

  • Since: 2004/4/9 9


Thanks "bd" ... I'm interested in it, sure, but I don't have a lot of time cause of my website ... Anyway, I'll try to have a look.

It's true that, maybe I'd need to change one thing or two about the module ^_^.

Thanks again!

83
alyussiu
Received 16$ on 15$ needed, left -0.11?
  • 2004/6/30 7:01

  • alyussiu

  • Not too shy to talk

  • Posts: 119

  • Since: 2004/4/9 9


Hello bd!

I think there is still a little bug about the sum ^O^...

I've received 16$ (1+15), the 15$ with a credit card, so there is a fee (0.89$).

So, I finally receive 1+14.11=15.11...

Oki... I needed 15$ for the month, and it's wrote "Left to go : 0.11$". I think there is a little problem...

Let's go bd, I give you more work (well, I think it's just a little thing, but...).

84
intel352
Re: Received 16$ on 15$ needed, left -0.11?
  • 2004/6/30 11:25

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


did you try the fix i posted in this thread? it's a page or 2 back.

85
alyussiu
Re: Received 16$ on 15$ needed, left -0.11?
  • 2004/6/30 12:22

  • alyussiu

  • Not too shy to talk

  • Posts: 119

  • Since: 2004/4/9 9


If you talk about that: "if ($difference < 0) {" ... Yes, and it worked until this morning where I got this other donation...

I think it's just a matter of + / - ...I should have +0.11 instead of -0.11...

Thanks for taking the time to reply!

86
intel352
Re: Received 16$ on 15$ needed, left -0.11?
  • 2004/6/30 12:25

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


lol, yeah, i need to sit down and look at that. i was kinda hoping Jack would take care of it since it's his addition (hint hint jack, if you read this )

i'll look at it tonight when i get home

87
alyussiu
Re: Received 16$ on 15$ needed, left -0.11?
  • 2004/6/30 12:29

  • alyussiu

  • Not too shy to talk

  • Posts: 119

  • Since: 2004/4/9 9


jack, jack, where are you?

I think I'll become the official "little" bugs reporter, hahaha...

Thanks again!

88
intel352
Re: Received 16$ on 15$ needed, left -0.11?
  • 2004/7/7 18:48

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


okay, i *believe* i fixed it... sigh...

replace the donatometer block's code with the following:

<?php
/************************************************************************/
/* Donations - Paypal financial management module for XOOPS 2           */
/* Copyright (c) 2004 by Xoops2 Donations Module Dev Team                */
/* http://dev.xoops.org/modules/xfmod/project/?group_id=1060            */
/*                                                                      */
/************************************************************************/
/*                                                                      */
/* Based on NukeTreasury for PHP-Nuke - by Dave Lawrence AKA Thrash     */
/* NukeTreasury - Financial management for PHP-Nuke                     */
/* Copyright (c) 2004 by Dave Lawrence AKA Thrash                       */
/*                       thrash@fragnastika.com                         */
/*                       thrashn8r@hotmail.com                          */
/*                                                                      */
/************************************************************************/
/*                                                                      */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/*                                                                      */
/* This program is distributed in the hope that it will be useful, but  */
/* WITHOUT ANY WARRANTY; without even the implied warranty of           */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU     */
/* General Public License for more details.                             */
/*                                                                      */
/* You should have received a copy of the GNU General Public License    */
/* along with this program; if not, write to the Free Software          */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  */
/* USA                                                                  */
/************************************************************************/

include_once XOOPS_ROOT_PATH.'/modules/donations/includes/functions.php';

if ( 
file_exists(XOOPS_ROOT_PATH."/modules/donations/language/".$xoopsConfig['language']."/main.php") ) {
        include_once 
XOOPS_ROOT_PATH."/modules/donations/language/".$xoopsConfig['language']."/main.php";
} else {
        include_once 
XOOPS_ROOT_PATH."/modules/donations/language/english/main.php";
}

function 
b_donations_donatometer_show($options){
        global 
$xoopsDB;
        
$block = array();
        
$query_cfg "SELECT * FROM ".$xoopsDB->prefix("donations_config")." WHERE subtype = ''";
        
$cfgset $xoopsDB->query($query_cfg);

        while ( 
$cfgset && $row $xoopsDB->fetchArray($cfgset))
        {
                        
$tr_config[$row['name']] = $row['value'];
        }
        
$swingd $tr_config['swing_day'];
        if(!(
$swingd AND $swingd 32))
                
$swingd 6;
        
        
$dmshowdate $tr_config['dm_show_date'];
        
$dmshowamt $tr_config['dm_show_amt'];
        
$DM_TITLE $tr_config['dm_title'];
        
        if(!
$DM_TITLE)
                
$DM_TITLE "Help keep us going!";
                
        if(
is_numeric($tr_config['dm_num_don']) && $tr_config['dm_num_don'] > )
                
$dmlen $tr_config['dm_num_don'];
        else if (
is_numeric($dmlen) && $dmlen ==0)
                
$dmlen = -1;
        else
                
$dmlen 10;
                
        
// Check the current day against the swing day to execute the proper query
        
if( date('d') >= $swingd )
        {
                
$query_Recordset1 "SELECT count(mc_gross) AS count, sum(mc_gross) AS gross, sum("
                
."mc_gross-mc_fee) AS net, date_format( now(),'%M') AS mon, date_format( subdate( date_format( adddate("
                
."now(), INTERVAL 1 MONTH),'%Y-%c-1'), INTERVAL 1 DAY), '%b %e') AS due_by, date_format(now(),'%b') AS "
                
."mon_short FROM ".$xoopsDB->prefix("donations_transactions")." WHERE (payment_date >= date_format("
                
."now(),'%Y-%m-".$swingd."'))";
        
                
$query_Recordset3 "select custom as muser_id, option_selection1 as showname, "
                
."date_format( payment_date, '%b-%e') as date, concat('$',sum(mc_gross)) as amt "
                
."from ".$xoopsDB->prefix("donations_transactions")." where (payment_date >= date_format( "
                
."now(), '%Y-%m-".$swingd."')) group by txn_id order by payment_date desc";
        } else
        {
                
$query_Recordset1 "select count(mc_gross) as count, sum(mc_gross) as gross, sum(mc_gross -" 
                
." mc_fee) as net, date_format( subdate( now(), interval ".$swingd." day), '%M') as mon,"
                
." 'Now!' as due_by, date_format( subdate( now(), interval ".$swingd." day), '%b') as mon_short"
                
." from ".$xoopsDB->prefix("donations_transactions")." where (payment_date < date_format( now(), '%Y-%m-".$swingd."')"
                
.") and payment_date > date_format( subdate( now(), interval ".$swingd." day), '%Y-%m-".$swingd."')";

                
$query_Recordset3 "select custom as muser_id, option_selection1 as showname, "
                
."date_format( payment_date, '%b-%e') as date, concat('$', sum(mc_gross)) as amt "
                
."from ".$xoopsDB->prefix("donations_transactions")." where (payment_date < date_format(now(),"
                
." '%Y-%m-".$swingd."')) and payment_date > date_format( subdate( now(),interval ".$swingd." "
                
."day), '%Y-%m-".$swingd."') group by txn_id order by payment_date desc";
        }

        
// Get the donation totals
        
$Recordset1 $xoopsDB->query($query_Recordset1);
        
$row_Recordset1 $xoopsDB->fetchArray($Recordset1);
        
//If there are not records, then get "null" data
        
if( !$row_Recordset1 )
        {
                
$query_Recordset1 "select '0' as count, '0' as gross, '0' as net, date_format( now(),"
                
."'%M') as mon, date_format( subdate( date_format( adddate( now(), interval 1 month), '%Y-%c-1'),"
                
." interval 1 day), '%b %e') as due_by, date_format( now(), '%b') as mon_short from "
                
." ".$xoopsDB->prefix("donations_transactions")."";
                
$Recordset1 $xoopsDB->query($query_Recordset1);
                
$row_Recordset1 $xoopsDB->fetchArray($Recordset1);
        }
        
// Get the goal
        
$query_Recordset2 "SELECT * FROM ".$xoopsDB->prefix("donations_config")." WHERE name='goal' AND subtype='".$row_Recordset1['mon_short']."'";
        
$Recordset2$xoopsDB->query($query_Recordset2);
        
$row_Recordset2 $xoopsDB->fetchArray($Recordset2);
        
        
// Set our remaining template vars
        
if(!$row_Recordset1['mon']){
                
$DM_MON date('F');
        }else{
                
$DM_MON $row_Recordset1['mon'];
        }
        
$difference $row_Recordset1['net'] - $row_Recordset2['value'];
        
$DM_GOAL sprintf('$%.02f'$row_Recordset2['value']);
        
$DM_DUE $row_Recordset1['due_by'];
        
$DM_NUM $row_Recordset1['count'];
        
$DM_GROSS sprintf('$%.02f',$row_Recordset1['gross']);
        
$DM_NET sprintf('$%.02f',$row_Recordset1['net']);
        
$DM_LEFT sprintf('$%.02f'$row_Recordset2['value'] - $row_Recordset1['net']);
        
$DM_BUTTON $tr_config['dm_button'];
        
$DM_BUTT_DIMS '';
        if( 
is_numeric($tr_config['dm_img_width']) )
                
$DM_BUTT_DIMS .= 'width='.$tr_config['dm_img_width'].' ';
        if( 
is_numeric($tr_config['dm_img_height']) )
                
$DM_BUTT_DIMS .= 'height='.$tr_config['dm_img_height'].' ';
        
        
// Load the template
        
$block['DM_TITLE'] = $DM_TITLE;
        
$block['DM_BUTTON'] = $DM_BUTTON;
        
$block['DM_BUTT_DIMS'] = $DM_BUTT_DIMS;
        
$block['DM_MON'] = $DM_MON;
        
$block['DM_GOAL'] = $DM_GOAL;
        
$block['DM_DUE'] =$DM_DUE;
        
$block['DM_GROSS'] = $DM_GROSS;
        
$block['DM_NET'] = $DM_NET;
        
$block['DON_URL'] = XOOPS_URL.'/modules/donations/index.php';
        
$show_don=0;
        
// Do we want to display the donators? 
        
if(is_numeric($dmlen) && $dmlen >= )
        {
                
$show_don=1;
                
// Get the list of donators
                
$Recordset3$xoopsDB->query($query_Recordset3);
        
                  
// List all the donators
                
$i 0;
                
$var '';
                while ( (
$row_Recordset3 $xoopsDB->fetchArray($Recordset3)) && ($i != $tr_config['dm_num_don']) )
                {
                        
// Refunded transactions will show up with $0 amount
                        
if( $row_Recordset3['amt'] > "$0" )
                        {
                                
$dmalign "center";
                                
$var .= "<tr><td width="100%" align="$dmalign" colspan="2">";
                                
// Observe the user's wish regarding revealing their name
                                
$muser_id $row_Recordset3['muser_id'];
                                
$sqlm $xoopsDB->query("SELECT uid FROM ".$xoopsDB->prefix('users')." WHERE uname='$muser_id'");
                                list(
$uid) = $xoopsDB->fetchRow($sqlm);
                                if( 
strcmp($row_Recordset3['showname'],"Yes") == && ($userfoin mgetusrinfo($uid))){
                                        
$var .= "<a href='".XOOPS_URL."/userinfo.php?uid=".$userfoin->getVar('uid')."'>".$userfoin->getVar('uname')."</a>";
                                }else{
                                        
$var .= _DM_ANONYMOUS_SHORT;
                                }
                                
$var .= "&nbsp;";
                                if( 
$dmshowamt )
                                        
$var .=  "(".$row_Recordset3['amt'].")";
                                if( 
$dmshowdate )
                                        
$var .=  $row_Recordset3['date'];
                                
$var .=  "</td></tr>";
                        }
                        
$i++;
                }
        }

        if (
$difference 0) {
            
$DM_OVERAGE sprintf('$%.02f'$row_Recordset1['net'] - $row_Recordset2['value']);
            
$block['DM_LEFT2GO'] = '<tr>
                                        <td width="105" align="right"><font color="green"><b>'
._DM_SURPLUS.':</b></font></td>
                                        <td align="left"><font color="green"><b>'
.$DM_OVERAGE.'</b></font></td>
                                    </tr>'
;
        } else {
            
$block['DM_LEFT2GO'] = '<tr>
                                        <td width="105" align="right"><font color="red"><b>'
._DM_LEFT2GO.':</b></font></td>
                                        <td align="left"><font color="red"><b>'
.$DM_LEFT.'</b></font></td>
                                    </tr>'
;
        }
        
        
// Define language constants
        
$block['DM_STAT'] = _DM_STAT;
        
$block['DM_MONGOAL'] = sprintf(_DM_MONGOAL,$block['DM_MON']);
        
$block['DM_DUEDATE'] = _DM_DUEDATE;
        
$block['DM_GROSSAMT'] = _DM_GROSSAMT;
        
$block['DM_NETBAL'] = _DM_NETBAL;
        
$block['DM_DONATIONS'] = _DM_DONATIONS;
        
$block['DM_MAKEDON'] = _DM_MAKEDON;

        
// Display block
        
$block['show_don']= $show_don;
        
$block['content'] = $var;
        return 
$block;
}
?>

89
intel352
Re: Received 16$ on 15$ needed, left -0.11?
  • 2004/7/7 18:49

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


btw, boiled down to a typo, and a bad previous 'fix'

lol.

also, had deducted the goal from the gross amount, which was incorrect. changed to deduct goal from net amount.

90
alyussiu
Re: Received 16$ on 15$ needed, left -0.11?
  • 2004/7/8 5:26

  • alyussiu

  • Not too shy to talk

  • Posts: 119

  • Since: 2004/4/9 9


Thanks for your work bd ^_^...

You know what? This month balance seems to be right... I can't understand ;-( ... So, I don't know if I'll replace it with your new code ...

Anyway, I'd like to say something... Paypal take an important % on donations... When I receive $1, then, they take $0.34 (that sucks, right?)...
So, if someone upgrade to a premium account (to accept credit card payment), don't be surprised ...

By the way, do you know another serious system for donations, paypal excepted? (a system where they take less % than paypal!)...

Login

Who's Online

140 user(s) are online (98 user(s) are browsing Support Forums)


Members: 0


Guests: 140


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits