Kopland |
09-26-2006 01:58 AM |
I wanted to be able to display this as a block on my vbPortal front page, so I took some of the code from the billspaypal.php file and did the following.
- In the vbPortal Control Panel, expand the "Block Layouts" tab and click on "Default Side Blocks".
- Click on the "Add New Block" button, choose PHP block type. I put in "Online Donation" for my Block Title, "Right" for my Default Column, and "Yes" for Templates.
- Add the following code to the Content box:
PHP Code:
$DonationMsg="Thank you for donating. Every little bit helps to maintain the site and its upkeep costs."; $navbits = construct_navbits(array('' => 'Donations')); $country = $vbulletin->options['billspp_currency']; $email = $vbulletin->options['billspp_email']; $payfor = $vbulletin->options['billspp_payfor']." From: ". $vbulletin->userinfo['username']; $buttontype = $vbulletin->options['billspp_showverify'];
if ($country == "0") {$currency = "AUD"; $currencylong = "Australian Dollars"; $cursym = "$";} if ($country == "1") {$currency = "CAD"; $currencylong = "Canadian Dollars"; $cursym = "$";} if ($country == "2") {$currency = "EUR"; $currencylong = "Euro"; $cursym = "€";} if ($country == "3") {$currency = "GBP"; $currencylong = "Pounds Sterling"; $cursym = "?";} if ($country == "4") {$currency = "JPY"; $currencylong = "Japanese Yen"; $cursym = "?";} if ($country == "5") {$currency = "USD"; $currencylong = "U.S. Dollars"; $cursym = "$";}
if ($buttontype == "2") {$buttontype = "$stylevar[imgdir_misc]/paypal_verified_donate.gif";} else {$buttontype = "$stylevar[imgdir_misc]/paypal_donate.gif";}
echo $DonationMsg;
echo "<br /><br /> <form action=\"https://www.paypal.com/cgi-bin/webscr\" target=\"_blank\" method=\"post\"> <div align=\"left\"> <strong>Currency</strong>: $currency - $currencylong<br /><br /> <strong>Amount</strong>: $cursym <input type=\"text\" name=\"amount\" size=\"6\" value=\"$vboptions[billspp_defaultamount]\" /> <input type=\"hidden\" name=\"cmd\" value=\"_xclick\" /> <input type=\"hidden\" name=\"business\" value=\"$email\" /> <input type=\"hidden\" name=\"item_name\" value=\"$payfor\" /> <input type=\"hidden\" name=\"no_note\" value=\"1\" /> <input type=\"hidden\" name=\"currency_code\" value=\"$currency\" /> <input type=\"hidden\" name=\"tax\" value=\"0\" /> <input type=\"hidden\" name=\"return\" value=\"$vboptions[bburl]/billspaypal_donated.php\" /> </div> <br /> <div align=\"left\"> <span class=\"smallfont\">Please enter your donation amount above, then click on the Donate button below.</span></div> <br /> <div align=\"center\"><input type=\"image\" src=\"$buttontype\" alt=\"Give Securely With Any Major Credit Card Through PayPal!\" title=\"Give Securely With Any Major Credit Card Through PayPal!\" /> <br /> <br /> </div> </form> ";
- Click Save
Voil?! The block has been created! Now all you have to do is insert the block into your desired module and your Donations block should show up beautifully! I'm pretty new at this, so I don't know if all the code that is in there is required, but that worked for me. You can see it at www.kopland.net (new site, not sure what I'll do with it yet, lol)
Billspaintball, if I need to add anything to the top to help give credit to you, just lemme know what I need to add and I'll make sure to do it. :)
|