MediaWiki > MediaWiki extensions >
A MediaWiki PayPal donations thing.
-
(date not recorded) - 1.0.1 on MediaWiki (version not recorded)
- Before 2007-05-14
- I added this to the top of my skin. See Monetizing MediaWiki - Hacking a Skin
My changes:
- Fixed the bad line wrapping
- Added the
target=_blank
- who the heck needs an item number?
-
TODO - fix the email address by using javascript, to prevent spamming?
<?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PayPal Donation WikiMedia extension. * * Firstly create a file called PayPalDonation.php and * place this in the extensions directory - copy all this * code to that file. To activate the extension, include * it from your LocalSettings.php with: * require_once 'extensions/PayPalDonation.php'; * * PHP versions 5 * * LICENSE: This source file is subject to version 3.0 of the * PHP license that is available through the world-wide-web at * the following URI: http://www.php.net/license/3_0.txt. * If you did not receive a copy of the PHP License and are * unable to obtain it through the web, please send a note to * [email protected] so we can mail you a copy immediately. * * @category Wiki * @package payPalDonation * @author Ian Warner * @copyright 2006 Triangle Solutions Ltd * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version SVN: $Id: $ * @link http://www.triangle-solutions.com/ */ /* * @todo Document */ $wgExtensionFunctions[] = 'wfPayPalDonation'; /* * Extension credits */ $wgExtensionCredits['parserhook'][] = array( 'name' => 'PayPal Donation', 'description' => 'PayPal Donation Extension', 'url' => 'http://wiki.triangle-solutions.com/index.php/Extensions', 'author' => 'Triangle Solutions Ltd', 'version' => '1.0.1'); /** * @todo Document */ function wfPayPalDonation() { global $wgParser; $wgParser->setHook('paypal', 'renderPayPalDonation'); } /** * The callback function for converting the input to HTML output * * @param string $input */ function renderPayPalDonation($input = null) { $output = '<br />' . $input; $output .= '<form action="https://www.paypal.com/cgi-bin/webscr" TARGET="_blank" method="post">'; $output .= '<input type="hidden" name="cmd" value="_xclick" />'; $output .= '<input type="hidden" name="business" value="[email protected]" />'; $output .= '<input type="hidden" name="item_name" value="example.com" />'; // $output .= '<input type="hidden" name="item_number" value="wiki" />'; $output .= '<input type="hidden" name="no_shipping" value="1" />'; $output .= '<input type="hidden" name="currency_code" value="CAD" />'; $output .= '<input type="hidden" name="tax" value="0" />'; $output .= '<input type="hidden" name="bn" value="PP-DonationsBF" />'; $output .= '<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" border="0" name="submit" alt="PayPal Donation" />'; $output .= '<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1" />'; $output .= '</form>'; return $output; } ?>
Last updated 2020-10-20 at 17:04:00
ported