Ravens PHP Scripts: Forums


View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Post Installation Help
Author Message
New Member
New Member

Joined: Jun 01, 2007
Posts: 2

PostPosted: Fri Jun 01, 2007 8:22 pm Reply with quote

Alright. I apologize if anybody think I am a "Noob" for asking this. I am new to phpNuke....

I just installed Nuke Treasury 1.1 on phpNuke 8.0, and it donates fine. I tested it. However, i am having major issues with IPN. The goal tracking is not working, or the treasury function (Like budgeting). My site is billsarena.com, but the block is disabled until I can get it working. Can someone please provide me with a walkthrough, more or less, of what I need to do? I have tried just about everything I can think of, but it is not working. Help me!
View user's profile Send private message
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17087

PostPosted: Sun Jun 03, 2007 10:30 pm Reply with quote

Have you searched the forum for nuke treasury?
View user's profile Send private message
PostPosted: Mon Jun 04, 2007 8:11 am Reply with quote

No. I googled the issue, but couldn't find anything. Didn't think of that...

Joined: Oct 11, 2005
Posts: 65

PostPosted: Tue Jul 10, 2007 5:33 am Reply with quote

I've done a search of these and other forums and I'm certain I have nuke treasury properly installed (I can make a donation, get the emails, get an "all ok" report from the test IPN feature, etc.). I'm using Nuke Treasury version 1.1 and RavenNuke 2.10.01. The database is a separate, dedicated database with no prefixes.

I have used Nuke Treasury for several years, installed it on multiple websites with no problem and it worked every time until recently. The only change made is that I upgraded all websites using NukeTreasury to RN2.10.01 (all fresh installs BTW).

I've read these forums and tried mods/fixes suggested by Krusge and others. No change ... the emails arrive properly, the IPN is turned on with PayPal properly and the donations just don't post to the block for the Donations module or the module itself.

If you're looking for a copy of Nuke Treasury 1.1 you can find it here:
Only registered users can see links on this board! Get registered or login!
You'll also find the older version 1.0 here as well.
View user's profile Send private message
Former Moderator in Good Standing

Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Tue Jul 10, 2007 6:56 am Reply with quote

I'm using 1.0 with RN2.10.01 without any problems.

Edit: the only advice I can offer is to make sure the URL to the ipn script is correct on paypal's side. Also, make sure your host is allowing PHP socket calls with fsockopen().

Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module 
View user's profile Send private message
Former Moderator in Good Standing

Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Tue Jul 10, 2007 7:47 am Reply with quote

I'm not familiar with Nuke Treasury and don't really want to be. I have implemented an IPN based application on my own site recently however. One possible problem is that if there are any syntax errors in the IPN script, you probably won't see them because Paypal communicates back to your site "asynchronously" -- so even error reporting doesn't help much. In the "standard" IPN scripts there is an IPNlog.txt file that gets updated whenever the Paypal IPN sends you back something. You might check if that's present in your script and if so whether it is being updated. Basically, you need some diagnostics in the IPN script to tell you what it's doing. If it's being executed but you find out that the Donations table isn't being updated you could then look at the SQL for that.

My application is running on RN2.10.01 so that's not the issue.
View user's profile Send private message Visit poster's website
PostPosted: Tue Jul 10, 2007 9:32 am Reply with quote

I was at one point having trouble getting the donations database updated. The Treasury script has an option to set the level of debug logging. Make sure that is maxxed out. I went and modified Treasury to add more debugging, but of course after I did that the problem never reappeared. They may be using UDP sockets so you may just see a glitch every once in a while (I'd have to check the code again).

fkelly, the Treasury script doesn't write any kind of log file like IPNlog.txt. It does attempt to log things in a database table though.

BTW, after turning notices on to debug GCalendar I have noticed Treasury 1.0 emits a ton of notices. Perhaps I will upgrade to the newer version to see if these have been fixed.

It's a good and useful module, but like most Nuke modules it is showing its age and is kind of rickety. It could stand to be cleaned up a little bit. Having some additional logging to debug IPN problems would be very helpful, judging by the number of people who post here with problems with it.
PostPosted: Tue Jul 10, 2007 11:49 am Reply with quote

I just downloaded it and took a look. You are right Gremmie, it is showing it's age. It doesn't even come close to being html 4.01 compliant -- form tags are not in quotes for instance. And it doesn't use the standard /db/mysql.php so I can't even recommend my hack to capture database errors.

It looks like the IPN file that's used is ipnppd.php that's in the treasury_menu/custompages directory. At the bottom of that program, if it encounters a SQL error it is just going to do a "die" out into cyberspace because that program is not executing under a normal userid. So you will never know that there was a SQL error.

The code in question is:


$query ="INSERT INTO $database_tag (paypal_credit,  money_check,  payment_status,  payment_date,  mc_gross,  first_name,  last_name,  payer_email,  payer_status ) VALUES ('$paypal_credit',  '$money_check',  '$payment_status',  '$payment_date',  '$mc_gross',  '$item_name',  '$last_name',  '$payer_email',  '$payer_status')";

mysql_query($query) or die('Error, insert query failed');

I would strongly recommend that anyone who wants this to work reliably go to PAYPAL and get some of their standard IPN scripts and put the IPN logging facilities into this IPNPPD.php script and also do a search in these forums for my dblog.txt hack for mysql.php and customize it to produce some kind of logging if the query fails. Without this you won't have a clue what's going on.

And of course, the larger problem with any script like this that's not actively supported is that PAYPAL is likely to change their API from time to time and of course you aren't going to have a clue when your application stops working. I'm not saying that's the case here but it is a danger.
PostPosted: Tue Jul 10, 2007 12:43 pm Reply with quote

Hasn't Raven assumed ownership of this script? Smile
PostPosted: Tue Jul 10, 2007 1:16 pm Reply with quote

Gremmie wrote:
Hasn't Raven assumed ownership of this script? Smile

That's been said several times, including by Raven himself. I've never seen any progress on it though.
PostPosted: Tue Jul 10, 2007 2:35 pm Reply with quote

I believe there is talk of including it in the next release of RN. If so, I expect we will clean it up and improve it a bit. (Yes, Raven, I am volunteering... Wink )
Site Admin

Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Wed Jul 11, 2007 6:58 am Reply with quote

Gremmie, oh good. Now we can finally get a multi-currency module! LOL... (Actually, Guardian has version 1.1 on his site that already works with GBP, so that might be a good starting point rather than the one at SourceForge, but you might just want to see what he thinks of that as I do not know the source of his version.)

Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
PostPosted: Wed Jul 11, 2007 2:17 pm Reply with quote

I think we can go one of two routes with this:

1) Take the existing 1.1 version and clean it up. Make it XHTML compliant, get rid of the notices, and perhaps do some minor code cleanup. But also add more instrumentation to the ipnppd.php file so people can figure out why donations aren't posting to the database.

2) Scrap it and write a new module using some of the ideas that fkelly suggested.

It would probably be the path of least resistance to do option 1 and I'd volunteer to do that. If we wanted to do #2 then perhaps fkelly would like to lead the charge. I didn't mean to step on his toes if that was the case.
PostPosted: Wed Jul 11, 2007 3:38 pm Reply with quote

Well this discussion is branching a bit, but recognizing that:

1. I can really see where a module like Treasury might be very useful but ... I think it's going to take a lot of maintenance and upkeep over time. I spent a bit of time in the Paypal forums recently trying to debug my own Purchase module and things are constantly changing there. They, for instance, introduced a bug into their PDT scripts (Payment Data Transfer) and their bug stopped scripts that relied on the PDT method from working properly. I don't know how an end-user who is relying on a Module like Treasury would even know when a change at the Paypal end caused the module to stop working. Perhaps if there was an active support forum for Treasury and someone constantly monitoring Paypal for problems it creates this could work. Maybe that's whats intended here.

2. I think it might be a lot more reliable and simpler to just develop the shell or template for a module that individuals could then "fill out" to meet their own needs. But people would still need to program their own forms and develop their own table designs to keep track of purchased items and know what to do with the information that Paypal "posts back" after a payment is completed. They'd have to write the SQL to update those tables after validating the incoming Paypal information.

I used the scripts from Nukescripts as kind of a template for myself only to find out later that almost the same scripts, only updated, were available right on the Paypal site. In front of these you need to write a form or forms to let people pick the items to purchase and then forward the amount and items and other information to Paypal, then have a completion screen for users to return to and probably some kind of IPN program to work "asynchronously" in the background to validate the completed information that Paypal sends back. In my case, I pre-populated the screens that the user sees on the Paypal site with basic information: name, phone, address, zip because I needed to collect that anyway and I couldn't get it from PDT because that wasn't working. Unfortunately, unless the user reads thru the Paypal documentation and variable listings and descriptions he/she will never even know that pre-population is a possibility.

I also had to write an administrative part to the module to let the administrator file maintain the table that was generated from the Paypal process. We're registering people for a bike ride and their information could change before the ride or their could be mistakes so we need some way for the admin to get in there without using PHPmyadmin. Also, the type of MYSQL table that I'd need to keep information on bike ride registrants is very different from what I'd need it I was just selling T-Shirts. Maybe Treasury accounts for that, but I'd doubt it.

So: maybe what we'd have would be:

1. Module template
2. Template for one or more forms for the user to select what he's purchasing or donating. Complexity to be determined by the user.
3. Directions and a shell for validating the form (I'm using the methods we recently discussed in the thread on filtering
3. Directions for posting the form information to the Paypal form
4. Directions for validating thru IPN and a shell for updating whatever table you are updating.
5. A list of paypal links to get more information on the setup there.

That said, if the decision is to go with Treasury I'll be glad to help where I can. For instance, I have the code for the pp_formgen re-written to be xhtml compliant and could contribute that. In the current Treasury code that non-compliant code is in Treasury_main_menu.php -- look at the form down around line 254.
PostPosted: Wed Jul 11, 2007 4:54 pm Reply with quote

That sounds very cool, but most users just want a simple module to receive donations from Paypal. Treasury is really just a simple one-trick pony. Providing a shell like that would really attract people wanting to build an e-commerce site though!
PostPosted: Wed Jul 11, 2007 5:24 pm Reply with quote

LOL. I guess I fall somewhere between a one-trick pony and a full-fledged e-commerce site then. I think I will install Treasury on my Ravennuke test site and get a better sense of what's involved. Just very quickly looking over the downloaded files it looks to me like it must be a pretty complicated trick it's doing. There's one way to find out.
PostPosted: Wed Jul 11, 2007 5:49 pm Reply with quote

All it really does is receive the Paypal IPN callback and populate a database table with the results really. It has a block and module interface for displaying the latest users who donated. Oh and it likes to generate a lot of warnings and notices too along the way. Wink
PostPosted: Mon Jul 16, 2007 7:06 pm Reply with quote

Hey fkelly, I finally took a look at those IPN scripts that Paypal is handing out that you mentioned, and it looks like the treasury mod used an early version of one of those for its ipnppd.php script. They look similar, but not quite the same. Someone should probably look at the differences to see if something has changed.
PostPosted: Mon Jul 16, 2007 7:27 pm Reply with quote

Yeah Gremmie and besides that there are the Nukescripts versions of IPN scripts. I know those are not compliant and I based my changes to make them compliant off of those. But I'm not sure I did a line by line comparison with the Paypal scripts, nor am I sure whether the Paypal scripts are compliant. I will take a look at that.

One problem, which is what I was referring to earlier in the thread, is that the Paypal scripts are just a suggested starting point. There is a huge variables reference over on the Paypal site. And, for instance, if you want to pre-populate the Paypal screens with your user's name, address, etc. then you need to read the variable reference and use specific variables for that. Also, the Paypal scripts have areas of comments that basically say "insert validation here" and the script owner at the individual site has to decide what he/she wants to do. I'm not sure how a package handles that.
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Post Installation Help

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
Forums ©