Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=87)
-   -   Donations in admincp (http://www.bvlist.com/showthread.php?t=1044)

Grom 23rd September 2008 10:41

Donations in admincp
 
Donations in admincp
Add sql
PHP Code:

CREATE TABLE `site_settings` (
  `
donationsint(5unsigned NOT NULL default '0',
  `
requireddonationsint(5unsigned NOT NULL default '0',
  `
donatepagelongtext collate latin1_german2_ci NOT NULL
ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci;

--
-- 
Contenu de la table `site_settings`
--

INSERT INTO `site_settingsVALUES(00'<CENTER>\r\n<IFRAME SRC="dons.html" NAME="main" HEIGHT="670" WIDTH="600"></IFRAME>\r\n</CENTER>'); 

create file called dons.html and paste your code paypal or other
create file donate.php and paste this code
This code works for me u may need to edit a few things to suit ur donation links

PHP Code:

<?
begin_block
("Donate");
print(
"<CENTER>")
?>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="your email">
<input type="hidden" name="item_name" value="Name your Site">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="bn" value="PP-DonationsBF">


Please enter the amount you would like to give.
Select a currency&nbsp;
<select name="currency_code" size="1">
<option value="USD">US dollar</option>
<option value="GBP">GB pound</option>
<option value="EUR">Euro</option>
<option value="JPY">Yen</option>
<option value="CAD">Canadian $</option>
<option value="AUD">Australian $</option>
</select>
Amount:&nbsp;
<input type="text" name="amount" value="" size="10">
<input type="submit" alt="currency" value="Donate!" class="button">
</form>
<?
end_block
();
?>

AND moneybookers
PHP Code:

<?
begin_block
("Donate");
print(
"<CENTER>")
?>
<form action="https://www.moneybookers.com/app/payment.pl" method="post" target="_blank">
<input type="hidden" name="pay_to_email" value="Your E-Mail Id Here">
<input type="hidden" name="status_url" value="Your E-mail To get Notification of Transaction">

<input type="hidden" name=\"language\" value="EN" class="ddl">Select a currency&nbsp;
<select name="currency" size="1">
<option value="USD">US dollar</option>
<option value="GBP">GB pound</option>
<option value="EUR">Euro</option>
<option value="JPY">Yen</option>
<option value="CAD">Canadian $</option>
<option value="AUD">Australian $</option>

</select>
Amount:&nbsp;
<input type="hidden" name="detail1_description" value="Donation to xxx">
<input type="hidden" name="detail1_text" value="Donation to xxx">

<input type="text" name="amount" value="" size="10">
<input type="image" name="submit" src="http://www.moneybookers.com/images/logos/additional_logos/orange_donate_with.gif" border=0></a>
</form>
<b>Donate,Help xxx Now and Get Vip Status - Send Your Transaction id to (xxx) after donation to get your status updated</b></CENTER>
<?
end_block
();
?>


xDev 28th August 2011 14:13

will this update the account-details on money sent and class and upload if not as i can see not goood
Donate,Help xxx Now and Get Vip Status - Send Your Transaction id to (xxx) after donation to get your status updated

joeroberts 28th August 2011 15:00

he did not post paypal.php so I would have to so it dose not notify you on any thing.
It relly's on the user to do that.

xDev 28th August 2011 21:55

Quote:

Originally Posted by joeroberts (Post 29734)
he did not post paypal.php so I would have to so it dose not notify you on any thing.
It relly's on the user to do that.

i have this not working at all update the account-details

PHP Code:

if ($payment_amount == || $payment_amount == 10 || $payment_amount == 20 || $payment_amount == 30 || $payment_amount == 40 || $payment_amount == 50 ) {
if (
$class <= 4){
    
$class 4;
}
  
$query "UPDATE users SET donated = donated + '$payment_amount', class=$class, warned ='no', invites = invites + $invites, uploaded = uploaded + $donb where id='$clid'";
  
$result mysql_query($query);
}
}


}
else if (
strcmp ($res"INVALID") == 0) {
header("Refresh: 4;url=account-details.php?id=$clid");
}
}
fclose ($fp);
}
?> 


joeroberts 28th August 2011 22:26

you would need something like this and you need to setup IPN in your paypal
this is a code from my phpMyBitTorrent
PHP Code:

<?php
// read the post from PayPal system and add 'cmd'
$req 'cmd=_notify-validate';

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

// post back to PayPal system to validate
$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";
$fp fsockopen ('www.paypal.com'80$errno$errstr30);

// assign posted variables to local variables
$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'];
$receiver_email $_POST['receiver_email'];
$payer_email $_POST['payer_email'];

if (!
$fp) {
// HTTP ERROR
} else {
fputs ($fp$header $req);
while (!
feof($fp)) {
$res fgets ($fp1024);
if (
strcmp ($res"VERIFIED") == 0) {
if (
$receiver_email == $paypal_email){
 
# $query = "UPDATE ".$db_prefix."_users SET donated = donated + '$payment_amount' where id='$clid'";
 # $result = mysql_query($query);
  
$query "UPDATE ".$db_prefix."_paypal SET reseaved_donations = reseaved_donations + '$payment_amount' ";
  
$result mysql_query($query);
}


header("Location: ".$siteurl."");
}
else if (
strcmp ($res"INVALID") == 0) {
}
}
fclose ($fp);
}
?>


xDev 28th August 2011 23:09

Quote:

Originally Posted by joeroberts (Post 29737)
you would need something like this and you need to setup IPN in your paypal
this is a code from my phpMyBitTorrent
PHP Code:

<?php
// read the post from PayPal system and add 'cmd'
$req 'cmd=_notify-validate';

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

// post back to PayPal system to validate
$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";
$fp fsockopen ('www.paypal.com'80$errno$errstr30);

// assign posted variables to local variables
$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'];
$receiver_email $_POST['receiver_email'];
$payer_email $_POST['payer_email'];

if (!
$fp) {
// HTTP ERROR
} else {
fputs ($fp$header $req);
while (!
feof($fp)) {
$res fgets ($fp1024);
if (
strcmp ($res"VERIFIED") == 0) {
if (
$receiver_email == $paypal_email){
 
# $query = "UPDATE ".$db_prefix."_users SET donated = donated + '$payment_amount' where id='$clid'";
 # $result = mysql_query($query);
  
$query "UPDATE ".$db_prefix."_paypal SET reseaved_donations = reseaved_donations + '$payment_amount' ";
  
$result mysql_query($query);
}


header("Location: ".$siteurl."");
}
else if (
strcmp ($res"INVALID") == 0) {
}
}
fclose ($fp);
}
?>



PHP Code:

<?
require "backend/functions.php";
dbconn(true);

// read the post from PayPal system and add 'cmd'
$req 'cmd=_notify-validate';

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

// post back to PayPal system to validate
$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";
$fp fsockopen ('www.paypal.com'80$errno$errstr30);

// assign posted variables to local variables
$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'];
$receiver_email $_POST['receiver_email'];
$payer_email $_POST['payer_email'];
$paypal_email $site_config['PAYPALEMAIL']; 
$clid $_POST['custom'];

if (!
$fp) {
// HTTP ERROR
} else {
fputs ($fp$header $req);
while (!
feof($fp)) {
$res fgets ($fp1024);
if (
strcmp ($res"VERIFIED") == 0) {



if (
$receiver_email == $paypal_email && $payment_status == "Completed"){
if (
$payment_amount == 5)
{
$donb 5368709120; }
elseif (
$payment_amount == 10)
{
$donb 10737418240; }
elseif (
$payment_amount == 20)
{
$donb 21474836480; }
elseif (
$payment_amount == 30)
{
$donb 32212254720; }
elseif (
$payment_amount == 40)
{
$donb 42949672960; }
elseif (
$payment_amount == 50)
{
$donb 53687091200; }
elseif (
$payment_amount == 100)
{
$donb 161061273600; }
else {
$donb 1073741824*$payment_amount;}

//Set User Invites
if ($payment_amount == 5){
    
$invites 1;
}
elseif (
$payment_amount == 10){
    
$invites 1;
}
elseif (
$payment_amount == 20){
    
$invites 2;
}
elseif (
$payment_amount == 30){
    
$invites 3;
}
elseif (
$payment_amount == 40){
    
$invites 4;
}
elseif (
$payment_amount == 50){
    
$invites 5;
}
elseif (
$payment_amount == 100){
    
$invites 10;
}
else {
$invites 0;
}
if (
$payment_amount == || $payment_amount == 10 || $payment_amount == 20 || $payment_amount == 30 || $payment_amount == 40 || $payment_amount == 50 ) {
if (
$class <= 4){
    
$class 4;
}
  
$query "UPDATE users SET donated = donated + '$payment_amount', class=$class, warned ='no', invites = invites + $invites, uploaded = uploaded + $donb where id='$clid'";
  
$result mysql_query($query);
}
}


}
else if (
strcmp ($res"INVALID") == 0) {
header("Refresh: 4;url=account-details.php?id=$clid");
}
}
fclose ($fp);
}
?>

this $db_prefix i do not have joe

joeroberts 29th August 2011 00:12

of course you don't your using TT witch don't use a data base prefix :lol:
I would say you need to make sure you have IPN active in your paypal and make sure it is pointing to the right location.

xDev 29th August 2011 00:26

Quote:

Originally Posted by joeroberts (Post 29740)
of course you don't your using TT witch don't use a data base prefix :lol:
I would say you need to make sure you have IPN active in your paypal and make sure it is pointing to the right location.

ok im in there now
Notification URL would you tell me what i need to put in is it my site link ? joe
or is it paypal link i have in site_config ?

joeroberts 29th August 2011 01:03

Quote:

Originally Posted by Developer (Post 29741)
ok im in there now
Notification URL would you tell me what i need to put in is it my site link ? joe
or is it paypal link i have in site_config ?

it is the link to the paypal.php on your site
Quote:

yoursite.com/paypal.php

xDev 29th August 2011 01:24

Quote:

Originally Posted by joeroberts (Post 29742)
it is the link to the paypal.php on your site

many thanks done:drink:


All times are GMT +2. The time now is 22:47.

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