TinyPortal

General => Chit chat => Topic started by: joesdomain on March 02, 2005, 02:24:51 PM

Title: How to add a PayPal button?
Post by: joesdomain on March 02, 2005, 02:24:51 PM
I am running the SMF 1.0.2 with the Simplicity theme. My site is used as a Community Trading Post. I would like to add a PayPal button to the mainpage so users can make donations. If anyone knows how this is done using the Simplicity theme, i would sure appreciate the assistance.

Thanks

Joe
Title: Re: How to add a PayPal button?
Post by: redone on March 02, 2005, 03:39:41 PM
Use the html block in the tpadmin section. Insert the html code from your paypal account page.

Title: Re: How to add a PayPal button?
Post by: joesdomain on March 02, 2005, 03:43:37 PM
I found in the admin screen under " Theme Settings - Simplicity" , Modify the index template. (the main template)

Is this the file that I am supposed to edit? If so, where exactly is the PayPal html code inserted?

Joe
Title: Re: How to add a PayPal button?
Post by: Bjørn on March 02, 2005, 05:38:14 PM
You need to manually edit that file, yes. Currently the theme has no special box for inserting html code, like for instance Themis theme or Helios theme.

Even if the theme resembles TinyPortal its not the same - and currently no conversion to make simplicity work in TP has been made.
Title: Re: How to add a PayPal button?
Post by: joesdomain on March 02, 2005, 07:12:20 PM
Do you know exactly where in that file the PayPal code goes?

Joe
Title: Re: How to add a PayPal button?
Post by: Bjørn on March 02, 2005, 07:16:30 PM
It depends on where you want it? on top or at the bottom perhaps?
Title: Re: How to add a PayPal button?
Post by: joesdomain on March 02, 2005, 07:25:41 PM
If you look on my site, www.joesdomain.ca/forums I would like it under User Tools. The button first then, Home,Help etc underneath the button

joe
Title: Re: How to add a PayPal button?
Post by: Bjørn on March 02, 2005, 10:08:55 PM
Find this code in index.template.php:

      template_menu();
      echo '</span>';

And just add you html code right above that and enclosed like this:

echo 'yourhtmlcodehere';
echo '<br />';


Title: Re: How to add a PayPal button?
Post by: joesdomain on March 03, 2005, 04:11:03 AM
I edited the file and inserted the code where you mentioned and I got the following error:

Template Parse Error!
There was a problem loading the /Themes/simplicity/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Joe
Title: Re: How to add a PayPal button?
Post by: Bjørn on March 03, 2005, 07:53:02 AM
Could you post what you inserted? and 2-3 lines before and after it?
Title: Re: How to add a PayPal button?
Post by: danfaz on October 23, 2005, 03:54:56 AM
I know this is an old topic, but thought I'd post, since I just added a paypal button to my index template. I'm using the Neptune theme on 1.1 Beta 3.

In the // leftblocks
function leftbar()
section, I added sidebartop('Donations');

Then this code:

?><script type="text/javascript">
function gopaypal() {
ÂÃ,  ÂÃ, document.paypalinfo.submit();
}
</script>

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="your paypal ID">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="bn" value="PP-DonationsBF">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but11.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" style="margin: 2px 0;"ÂÃ,  border="0" onclick="gopaypal();"/>
</form>ÂÃ,  ÂÃ, 
<?

Works perfectly :)