1
ChadK
Donations hacked for xIPB auto-add to group
  • 2004/7/28 15:36

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


This uses the Donations module and the xIPB module/hack (by bbpixel.com)

In order to have the site automatically add users who donate to the "sponsors" group I modified the ipn page that the donations module uses. My "Sponsors" group was set up in IPB and has the group ID # 9. This hack will take anyone from group 3 (members) and add them to 9 when a paypal donation is received.
Not tested but looks good and is installed on my production site.. as soon as someone donates it'll be tested :) Try it and let me know if you notice any problems.

It's not the best effort because it queries all members who've donated but it's not slow or anything so should be fine for you. If someone comes up with a better solution please share it!


In modules / donations / ipnppd.php:
Replaced:
Quote:
// We're cleared to add this record
dprt($insertSQL, _INF);
$Result1 = $xoopsDB->queryF($insertSQL);
dprt("SQL result = " . $Result1, _INF);
break;



With:Quote:
//Added 7/29/04 by CMK to grant access to Sponsors group for donators
$insertSQL="UPDATE `xoops_users` INNER JOIN `xoops_donations_transactions` ON `xoops_users`.uname = `xoops_donations_transactions`.Custom SET `xoops_users`.mgroup = '9' WHERE `xoops_users`.mgroup = '3';"
$Result1 = $xoopsDB->queryF($insertSQL);
dprt("Attempting new feature.. adding you to sponsors group. Let the site admin know if this fails! If you see this message, it probably failed.", _INF);
dprt("SQL result = " . $Result1, _INF);
//End Addition

2
koertzen
Re: Donations hacked for xIPB auto-add to group
  • 2004/7/28 15:42

  • koertzen

  • Just popping in

  • Posts: 79

  • Since: 2003/10/22


Chad,

Thanks! I was going to be approaching this next on my Donations dev to do list. You have saved me some time!

My goal is to have a configuration module that will allow you to determine a donation level that would be mapped to a group. As such, you could have a simple one group "sponsors" as you mentioned, or you could have 5 levels (for example) each with a different group of varying permissions, etc.

If implementing this proves too cumbersome for a quick job, I will be turning in just a basic version for now.

Again, thanks!

-Jeff

3
ChadK
Re: Donations hacked for xIPB auto-add to group
  • 2004/7/28 15:53

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


No problem.. ;) I've been watching your development with interest. If I can help in any way, let me know. I'm ChadK on the Module Dev Forge site as well.
This hack only works for BBPixel's IPB module and it's hardcoded with the group numbers and stuff so putting it into a config page would be even better. Hopefully your version, when ready, will allow those of us using the IPB module to use your new features as well as those using the stock forums? Perhaps use my hack as a basic template for how to add them to groups in IPB.
-- Or, do them of for the stock board and let me hack it to create an IPB version. ;)

4
koertzen
Re: Donations hacked for xIPB auto-add to group
  • 2004/7/28 16:00

  • koertzen

  • Just popping in

  • Posts: 79

  • Since: 2003/10/22


Well, I'm not the project manager, so I'll let him make those determinations :). Maybe he'll just bring you into the project to upload your configs. You would need to change the SQL queries to utilize the $xoopsDB->prefix('donations') type of structure, of course.

5
intel352
Re: Donations hacked for xIPB auto-add to group
  • 2004/7/28 17:29

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


chad, just saw your post, nice mod

if you would like to join the dev team, we'd love to have you
i'm always looking for more devs, since i usually don't have time to dedicate to the module, but i want to see it keep progressing, and i know herko really wants to use it, but is waiting for more features.


regarding your hack, if you would like, how about working with jeff to complete a xoops-groups feature for donations, and then once that is finished, add needed modifications to support phpbb and ipb (the bbpixel ports)?

xoops groups support is the primary goal, though

nice job getting it to work, i hope you decide to join. if so, just lemme know and i'll add you.

Login

Who's Online

212 user(s) are online (144 user(s) are browsing Support Forums)


Members: 0


Guests: 212


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