Get Blogged by JoKi

"The only frontiers are in your mind"
03 | 09 | 2010
Navigation
Syndication
Most Read Articles
Related Resources
Article Time Line
About me
Microsoft Most Valuable Professional 2007 & 2008

Microsoft Certified Professional

Get in contact

Recent books

  • MCTS 70-536 - .NET Framework 2.0 Application Development Foundation
  • Code-Centric: T-SQL Programming with Stored Procedures and Triggers
  • Microsoft .NET Framework-Programmierung in C#

Community

deutschsprachige FoxPro User Group

Microsoft Community Leader/Insider Program

International .NET Association

O'Reilly Verlag
Sponsoring
If you like the information on these pages, your support is highly appreciated.
Thank you very much!
Validation

Valid XHTML 1.0 Transitional
Valid CSS!

Spacer for layout formatting
Modified Ultimate Paypal Donations Module PDF
User Rating:rating blankrating blankrating blankrating blankrating blank / 0
PoorBest 
Development
Wednesday, 17 February 2010 20:00

The article describes some opinions and modifications for a Joomla! extension called Ultimate Paypal Donations Module by JoomlaSpan.

First of all I have to say that using this extension to provide any kind of PayPal donation element on your site is really easy and straight forward. You just install it, setup your parameters and mdoule location and you are done. It could not be better...

Well, it could.

Actually, my main problem with this module is about XHTML 1.0 compliance. Sadly to see that the current version (as of writing this article) does not follow the W3C rules about XHTML 1.0. Luckily, the necessary changes are very simple to realize by modfying one PHP file. Following is the modified version:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations" />
<input type="hidden" name="business" value="<?php echo $paypal_emailID; ?>" />
<input type="hidden" name="item_name" value="<?php echo $item_name; ?>" />
<?php if ($item_number)
{
echo "<input type=\"hidden\" name=\"item_number\" value=\"" . $item_number . "\" />\r\n";
}
?>
<?php if ($amount)
{
echo "<input type=\"hidden\" name=\"amount\" value=\"" . $amount . "\" />\r\n";
echo "<input type=\"hidden\" name=\"lc\" value=\"" . $location . "\" />\r\n";
}
?>
<input type="hidden" name="no_shipping" value="0" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="currency_code" value="<?php echo $currency_code; ?>" />
<input type="hidden" name="tax" value="0" />
<input type="hidden" name="bn" value="PP-DonationsBF" />
<?php if ($image_choice==1)
{
echo "<input type=\"image\" border=\"0\" src=\"" . $donate_image . "\" name=\"submit\"
alt=\"PayPal - The safer, easier way to pay online!\" />\r\n";
}else{
echo "<input type=\"image\" border=\"0\" src=\"" . $own_donate_image . "\" name=\"submit\"
alt=\"PayPal - The safer, easier way to pay online!\" />\r\n";
}
?>
</form>

Modified version of mod_paypal-j15/tmpl/default.php

Despite the tooltip description about choosing your own PayPal button for this module you do not need to specify the full URL including http:// prefix. As you can see in the PHP code any relative path is working too. For reduced number of DNS lookups you should get your preferred PayPal button on your server and change the module to use your 'own' image.

In my changes above you also see a marked if-statement in the code. Well, in the original code there are two identical statements, I just merged them together for better reading.

Add last but not least, I removed the border attribute from input tags that displays the PayPal image on your site. Style information like border attributes belong to CSS files and should not be part of the HTML code.

 
Spacer for layout formatting