Recent Topics

1 Apr 22, 2009 10:40    

My b2evolution Version: 1.8.x

I am trying to put a PayPal button in a post, but b2evolution can’t do this without problems. I have tried everything except rewriting the php code. Does anybody know how to correctly post a PayPal button in b2evolution?

3 Apr 23, 2009 15:12

you might want to consider a plugin for that.

What I've done in the past, is take the video plugin and tweak it to prompt you for your product/price/info and then display that inside your posts.

Someone here at b2evo might be able to write it for you - there's a professional services area... I think on the main page.

4 Apr 23, 2009 19:53

That'd be a neat idea. Maybe I'll do a "paypal in post" plugin just for kicks. Maybe add it to the "embed lyrics" plugin and call the whole thing "embed stuff that doesn't deserve it's own toolbar but isn't a video but gets embedded so there you go" plugin. Or is that not a clear enough name?

5 Apr 25, 2009 02:41

Below is the code for a PayPal button. It will display properly in the right column as is, but not in a post. The problems that arise when posting are: Numerous lines of space under the button and visible 'form' code.

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="4980749">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynow_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

Removing the spaces from the code as shown below results in the removal of the lines of space under the button, in the post. The visible 'form' code is removed by adding </input></input></input></form> at the end of the PayPal 'form' code. For each input 'type' an </input> is required.

<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="4980749"><input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynow_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" /></input></input></input></form>

6 Apr 25, 2009 03:33

Thanks. I'm thinking this should be a plugin without a toolbar. Like, you give the plugin your code from paypal and let it rip it into pieces. Then when you want a paypal thingie in a post you type [paypal] or maybe <!-- paypal --> and check the box for that renderer. It then does it's thing.

In other words what would a button on a toolbar actually do, given that you get the code and that's that. Or am I missing something?

I guess it would have to be something each user would do on their profile instead of on the plugin's settings page?

7 Apr 25, 2009 05:31

You are welcome;

b2evolution has some pretty good programming because it tried to fix the code. That’s how I figured this out. I saw that an </input> had been inserted when I posted. I added two more and put them all at the end of the ‘form’ and it worked.

8 Apr 25, 2009 20:15

Try this instead : /inc/_core/_param.funcs.php ( approx 1838 ) - change it to look like this

			// Push if not img or br or hr
			if($tag != 'br' && $tag != 'img' && $tag != 'hr' && $tag != 'param' && $tag != 'input' )
			{
				$stacksize = array_push ($tagstack, $tag);
				$closing = '>';
			}

¥

9 Apr 26, 2009 09:07

Thank you for the ultimate solution

The addition of && $tag != 'input' makes the posts work like the side bar. One still must back out the spaces between the code, but that is very easy to do. Most importantly, it's no longer necessary and probably no longer possible to insert numerous </input> at the end of each form.

I was amazed to see upon uploading some newly constructed PayPal buttons that not only did they work perfectly, but the numerous </input> codes I had used on the other buttons was automatically removed!


Form is loading...