paypal.php
- Code: Select all
<?php
/**
*
* @package phpBB3
* @version $Id: paypal.php 0006 13:23 08/08/2008 kenny $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
$mode = request_var('mode', '');
// Load the appropriate paypal file
switch ($mode)
{
case 'success':
$l_title = 'Success, you have successfully donated to ' . $config['sitename'];
$template->set_filenames(array(
'body' => 'paypal/success_body.html')
);
break;
case 'cancel':
$l_title = 'Donation cancelled!';
$template->set_filenames(array(
'body' => 'paypal/cancel_body.html')
);
break;
default:
$l_title = 'Donate to ' . $config['sitename'];
$template->set_filenames(array(
'body' => 'paypal/paypal_body.html')
);
break;
}
$sitename = $config['sitename'];
// Lets build a page ...
$template->assign_vars(array(
'SITENAME' => $sitename,
'L_FAQ_TITLE' => $l_title,
'L_BACK_TO_TOP' => $user->lang['BACK_TO_TOP'])
);
page_header($l_title);
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
?>
Place the following template files inside a "paypal" folder in your templates directory.
paypal/paypal_body.html
- Code: Select all
<!-- INCLUDE overall_header.html -->
<h2>Donate to {SITENAME}</h2>
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<fieldset class="fields2">
<p>Support {SITENAME} by making a donation using PayPal.<br />
Your donations ensure that we can pay our hosting bills and are able to keep this site online for the benefit of our users.<br />
<br />If you are able to donate more than £5 it will keep us motiviated to produce Rewards for our Supporters and helps us that much more. :)
</p>
<br />
<dl>
<dt>
<!-- Replace this code with your own paypal code -->
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="image" src="https://www.paypal.com/en_GB/i/btn/x-click-but21.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="encrypted" value="----- INSERT YOUR CUSTOM PAYPAL CODE HERE || CHECK THE PAYPAL WEBSITE ON HOW TO GENERATE THIS -----
"></form>
<!-- Replace this code with your own paypal code -->
</dt>
</dl>
</fieldset>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- INCLUDE overall_footer.html -->
paypal/cancel_body.html
- Code: Select all
<!-- INCLUDE overall_header.html -->
<h2>Donation Cancelled</h2>
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<fieldset class="fields2">
<p>It seems you have decided to cancel your donation to {SITENAME}<br />
Don't worry, it's ok - but do think about donating in the future - the more donations we get, the better we can make the site :)
<br />Thanks for checking out the site none the less<br /><br />
The {SITENAME} Team</p>
</fieldset>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- INCLUDE overall_footer.html -->
paypal/success_body.html
- Code: Select all
<!-- INCLUDE overall_header.html -->
<h2>Donation Successfull</h2>
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<fieldset class="fields2">
<p>Congratulations, you have successfully donated to {SITENAME}!<br /><br />
Your donation, no matter how big or small, is very greatly appreciated and will go towards keeping the site online<br />
Hopefully in the future, we can set up a rewards system for those who have donated<br />
For now though, you have your utmost thanks<br /><br />
The {SITENAME} team.
</p>
</fieldset>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- INCLUDE overall_footer.html -->
Create a link to the paypal.php file wherever you like - easiest place is next to the FAQ / Members links in the breadcrumbs bar. Have a look at how the are created to see how you do it. Also, remember to add your custom paypal form info into the paypal_body.html file or you page won't work. There's more information on paypals website on how to generate a custom donations button



