Jump to content

nightlife

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Posts posted by nightlife

  1. I dont have any nuketreasury documentation.  I'm sure its s setting on my site has to be changed, or scriped edited to show the site what to look  for in paypal account, i have the code paypal gave me, would like some one how set up paypal and has it working right on there site to please help me thanks?
  2. does the code go on her or not? if not what part or file please?



    ipnppd.php
    File Type: PHP script text
    [code]sql_query($query_cfg))) {
    message_die(GENERAL_ERROR, 'Could not obtain nuke tresury config data', '', __LINE__, __FILE__, $sql);
    }

    while ($cfgset && $row = $db->sql_fetchrow($cfgset)) {
    $tr_config[$row['name']] = $row['value'];
    }

    $ERR = 0;
    $log = "";
    $loglvl = $tr_config[ipn_dbg_lvl];
    define(_ERR, 1);
    define(_INF, 2);

    if (isset($_GET['dbg'])) {
    $dbg = 1;
    } else {
    $dbg = 0;
    }

    if ($dbg) {
    dprt("Debug mode activated", _INF);
    echo "PHP-Nuke Treasury modPayPal Instant Payment Notification scriptSee below for status:";
    echo "----------------------------------------------------------------";
    $receiver_email = $tr_config['receiver_email'];
    }

    $req = "cmd=_notify-validate";

    foreach ($_POST as $key => $value) {
    $value = urlencode(stripslashes($value));
    $req .= "&$key=$value";
    }

    $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
    $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
    $header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
    $item_name = $_POST['item_name'];
    $item_number = $_POST['item_number'];
    $payment_status = $_POST['payment_status'];
    $payment_amount = $_POST['mc_gross'];
    $payment_currency = $_POST['mc_currency'];
    $txn_id = $_POST['txn_id'];
    $txn_type = $_POST['txn_type'];
    $receiver_email = $_POST['receiver_email'];
    $payer_email = $_POST['payer_email'];

    dprt("Opening connection and validating request with PayPal...", _INF);

    $fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30);

    if (!$fp) {
    dprt("FAILED to connect to PayPAl", _ERR);
    die();
    }

    dprt("OK!", _INF);

    fputs ($fp, $header . $req);

    if (!$dbg && strcasecmp($_POST['business'], $tr_config['receiver_email']) != 0) {
    dprt("Incorrect receiver email: $receiver_email , aborting", _ERR) ;
    $ERR = 1;
    }

    $insertSQL = "";

    if ($txn_id) {
    $sql = "SELECT * FROM " . $prefix . "_treasury_transactions WHERE txn_id = '$txn_id'";

    if (!($Recordset1 = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, 'Could not obtain data from nuke tresury transactions', '', __LINE__, __FILE__, $sql);
    }

    $row_Recordset1 = $db->sql_fetchrow($Recordset1);
    $NumDups = $db->sql_numrows($Recordset1);
    }

    while (!$dbg && !$ERR && !feof($fp)) {
    $res = fgets ($fp, 1024);

    if (strcmp ($res, "VERIFIED") == 0) {
    dprt("PayPal Verified", _INF);

    if (strcmp($payment_status, "Refunded") == 0) {
    dprt("Transaction is a Refund", _INF);

    if (($NumDups == 0) || strcmp($row_Recordset1[payment_status], "Completed") || (strcmp($row_Recordset1[txn_type], "web_accept") != 0 && strcmp($row_Recordset1[txn_type], "send_money") != 0)) {
    dprt("IPN Error: Received refund but missing prior completed transaction", _ERR);

    foreach($_POST as $key => $val) {
    dprt("$key => $val", $_ERR);
    }
    break;
    }
    if ($NumDups != 1)
    {
    dprt("IPN Error: Received refund but multiple prior txn_id's encountered, aborting", _ERR);

    foreach($_POST as $key => $val) {
    dprt("$key => $val", $_ERR);
    }
    break;
    }

    $mc_gross = -$_POST['mc_gross'];
    $mc_fee = -$_POST['mc_fee'];
    $insertSQL = sprintf("INSERT INTO " . $prefix . "_treasury_transactions (`txn_id`,`business`,`item_name`, `item_number`, `quantity`, `invoice`, `custom`, `memo`, `tax`, `option_name1`, `option_selection1`, `option_name2`, `option_selection2`, `payment_status`, `payment_date`, `txn_type`, `mc_gross`, `mc_fee`, `mc_currency`, `settle_amount`, `exchange_rate`, `first_name`, `last_name`, `address_street`, `address_city`, `address_state`, `address_zip`, `address_country`, `address_status`, `payer_email`, `payer_status`) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')", $_POST['txn_id'],$_POST['business'],$_POST['item_name'],$_POST['item_number'],$_POST['quantity'],$_POST['invoice'],$_POST['custom'],$_POST['memo'],$_POST['tax'],$_POST['option_name1'],$_POST['option_selection1'],$_POST['option_name2'],$_POST['option_selection2'],$_POST['payment_status'],strftime('%Y-%m-%d %H:%M:%S',strtotime($_POST['payment_date'])),$_POST['txn_type'],$mc_gross,$mc_fee,$_POST['mc_currency'],$_POST['settle_amount'],$_POST['exchange_rate'],$_POST['first_name'],$_POST['last_name'],$_POST['address_street'],$_POST['address_city'],$_POST['address_state'],$_POST['address_zip'],$_POST['address_country'],$_POST['address_status'],$_POST['payer_email'],$_POST['payer_status']);

    dprt($insertSQL, _INF);

    if (!($Result1 = $db->sql_query($insertSQL))) {
    message_die(GENERAL_ERROR, 'Could not insert data into nuke tresury transactions', '', __LINE__, __FILE__, $sql);
    }

    dprt("SQL result = " . $Result1, _INF);
    break;
    } else if ((strcmp($payment_status, "Completed") == 0) && ((strcmp($txn_type, "web_accept")== 0) || (strcmp($txn_type, "send_money")== 0))) {
    dprt("Normal transaction", _INF);

    if ($lp) {
    fputs($lp, $payer_email . " " . $payment_status . " " . $_POST['payment_date'] . "\n");
    }

    if ($NumDups != 0) {
    dprt("Valid IPN, but DUPLICATE txn_id! aborting", _ERR);

    foreach($_POST as $key => $val) {
    dprt("$key => $val", $_ERR);
    }
    break;
    }

                //@RJR-Pwmg@Rncvkpwo@-@Eqratkijv@(e)@VgejIHZ.eqo
    $insertSQL = sprintf("INSERT INTO " . $prefix . "_treasury_transactions (`txn_id`,`business`,`item_name`, `item_number`, `quantity`, `invoice`, `custom`, `memo`, `tax`, `option_name1`, `option_selection1`, `option_name2`, `option_selection2`, `payment_status`, `payment_date`, `txn_type`, `mc_gross`, `mc_fee`, `mc_currency`, `settle_amount`, `exchange_rate`, `first_name`, `last_name`, `address_street`, `address_city`, `address_state`, `address_zip`, `address_country`, `address_status`, `payer_email`, `payer_status`) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')", $_POST['txn_id'],$_POST['business'],$_POST['item_name'],$_POST['item_number'],$_POST['quantity'],$_POST['invoice'],$_POST['custom'],$_POST['memo'],$_POST['tax'],$_POST['option_name1'],$_POST['option_selection1'],$_POST['option_name2'],$_POST['option_selection2'],$_POST['payment_status'],strftime('%Y-%m-%d %H:%M:%S',strtotime($_POST['payment_date'])),$_POST['txn_type'],$_POST['mc_gross'],$_POST['mc_fee'],$_POST['mc_currency'],$_POST['settle_amount'],$_POST['exchange_rate'],$_POST['first_name'],$_POST['last_name'],$_POST['address_street'],$_POST['address_city'],$_POST['address_state'],$_POST['address_zip'],$_POST['address_country'],$_POST['address_status'],$_POST['payer_email'],$_POST['payer_status']);
    dprt($insertSQL, _INF);

    if (!($Result1 = $db->sql_query($insertSQL))) {
    message_die(GENERAL_ERROR, 'Could not insert data into nuke tresury transactions', '', __LINE__, __FILE__, $sql);
    }

    dprt("SQL result = " . $Result1, _INF);
    break;
    } else {
    dprt("Valid IPN, but not interested in this transaction", _ERR);

    foreach($_POST as $key => $val) {
    dprt("$key => $val", $_ERR);
    }
    break;
    }
    } else if (strcmp ($res, "INVALID") == 0) {
    dprt("Invalid IPN transaction, this is an abnormal condition", _ERR);

    foreach($_POST as $key => $val) {
    dprt("$key => $val", $_ERR);
    }
    break;
    }
    }

    if ($dbg) {
    $sql = "SELECT * FROM " . $prefix . "_treasury_transactions LIMIT 10";

    echo "Executing test query...";

    if (!($Result1 = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, 'Could not obtain data from nuke tresury transtransactions', '', __LINE__, __FILE__, $sql);
    }

    if ($Result1) {
    echo "PASSED!";
    } else {
    echo "FAILED";
    }

    echo "PayPal Receiver Email: $tr_config[receiver_email]" ;
    }

    if ($log) {
    dprt("Logging events\n", _INF);

    $sql = "INSERT INTO " . $prefix . "_treasury_translog VALUES ('','" . strftime('%Y-%m-%d %H:%M:%S',mktime()) . "', '" . strftime('%Y-%m-%d %H:%M:%S',strtotime($_POST['payment_date'])) . "','" . addslashes($log) . "')";

    if (!($Result1 = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, 'Could not insert data into nuke tresury translog', '', __LINE__, __FILE__, $sql);
    }

    $sql = "SELECT id as lowid FROM " . $prefix . "_treasury_translog ORDER BY id DESC LIMIT " . $tr_config[ipn_log_entries];

    if (!($Result1 = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, 'Could not obtain nuke tresury translog', '', __LINE__, __FILE__, $sql);
    }

    while($recordSet = $db->sql_fetchrow($Result1)) {
    $lowid = $recordSet[lowid];
    }

    $sql = "DELETE FROM " . $prefix . "_treasury_translog WHERE id < '" . $lowid . "'";

    if (!($Result1 = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, 'Could not delete nuke tresury translog', '', __LINE__, __FILE__, $sql);
    }
    }

    fclose ($fp);

    if ($lp) {
    fputs($lp,"Exiting\n");
    }

    if ($lp) {
    fclose ($lp);
    }

    if ($dbg) {
    echo "----------------------------------------------------------------";
    echo "If you don't see any error messages, you should be good to go!";
    }

    function dprt($str, $clvl) {
    global $dbg, $lp, $log, $loglvl;

    if ($lp) {
    fputs($lp, $str . "\n");
    }

    if ($dbg) {
    echo $str . "";
    }

    if ($clvl <= $loglvl) {
    $log .= $str . "\n";
    }
    }

    die();

    ?>[/code]
  3. What i mean by "they" is this! my pay pal account said to place the code into the site,it said this after clicking the two parts you told me. "Auto-Return turned on? It's under My Account > Preferences > Website Payment Preferences. You'll also want Payment Data Transfer turned on, and have a valid URL in the Return URL blank." then it asked for me to add the code to my site." but like i have already said i have no idea what part to add the code i'e string of numbers and letters?  does this make any sence to you? or am i mis understanding what i should be doing.  if i new what file this code should be placed onto and in what place to add the code i'm sure i could find it, please point me in the right direction thanks. "Auto-Return turned on? It's under My Account > Preferences > Website Payment Preferences. You'll also want Payment Data Transfer turned on, and have a valid URL in the Return URL blank." then it asked for me to add the code to my site.
  4. Ok just looked thanks for your screen shot, we do not have all listed like you?

    what account should we have to list the same as you? we dont have the web opptions.


    [IMG]http://img.photobucket.com/albums/v246/deathmad/ourpaypal.jpg[/img]
  5. Hi, please can anyone help, i have a new php site, and run a games server, we have just set up paypal on our site, and members have donated, the payment does come to our mail addy, and onto pay pal, but does not show on the site they made any payments, i am running this one Module's Name:NukeTreasury ,Module's Version: 1.0 please could you tell me what i might be doing wrong, and how to fix this, yes i am a noob at php, so please make this easy. thanks
  6. Please could you tell me how to config the Treasury in pay pal block, i have setup the account info, and paymants, and they show fine, but when i click on to donation block, it has no place to set times and ammonts the money should be payed by. it just says "Treasury Configuration" but can not click onto it or find any edit. 

    Thanks.
  7. [quote author=nightlife link=topic=105952.msg425355#msg425355 date=1157031729]
    So if i write a text file? with the tos for the site, what dir should it be placed into for it to link when they click join, and reach the tos page what they click to agree?
    [/quote]


    Thats why i'm asking about how to remake the tos... its not at the bottom of the page, its gone. how do i make a new tos, and pace it into the right dir for it to replace what was thier before. thanks
  8. Does anyone know what i should use for adding the jukebox to my site, or a script that would work like a jukebox, and is thier away to keep the tune playing no matter what page you click onto next, i have a set music script on right now, its  the one above, but ever time i change pages it reloads the song, so i have it playing twice, ????  any help please.  i'm using php plat.
  9. I just used this script, and it works just like the one above, but i realy would like it to not keep starting over ever time i click onto a new post, or thread.

    can this be changed or like i just asked, can i use some kind of juke box to give a choice of songs, or play one after the other? thanks for you time.

    <div align="center"><br>
    <object width="187" height="40"
    classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
    id="mediaplayer1">
    <param name="Filename" value="http://mymusic.mp3">
    <param name="AutoStart" value="True">
    <param name="ShowControls" value="True">
    <param name="ShowStatusBar" value="False">
    <param name="ShowDisplay" value="False">
    <param name="AutoRewind" value="False">
    </object></div>
  10. Would i be able to have a php script that would give members a choice of songs to play, or evan play more than one song after the first song has played ie, if the member was on the site for some time the songs would change?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.