![]() |
Paypal button per member
I want someones help. I`ve added a profilefield in vB, where a user can add his paypal email.Now I want to display a Donate button in the users postbit ( doesn`t matter : legacy or new ), so if a browsing member goes on the forum, he can donate to that user. I`ve tried to use $post[fieldx], but when I click on the button, it doesn`t work. I think this is similar to vBulletins hack, for hack posting coders. I would need something like that, or at least this small thing. How can I use a value from a field ? Can forms be used in templates directly ?
Regards |
Try using bbuserinfo instead of post. i.e.
Hello, my email address is $bbuserinfo['field1']. |
Trying it now. One moment..
Nope. When I click the button it redirects me to : You did not select any posts to which the action you picked can be applied. I have vbSEO installed. Would that cause this. ? Ok, the text is getting parsed, I can see the email in the source code, but it`s not redirecting me to paypal. :( |
Anyone ?
|
How to use forms in templates ?
|
can you show the code that you are currently using
|
<if condition="$post['field5']">
<input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="$bbuserinfo[field5]"> <input type="hidden" name="page_style" value="PayPal"> <input type="hidden" name="no_shipping" value="2"> <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-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form> </if> I added that in the postbit template, so I can show a paypal donate button. My problem is that when I click the button it`s taking me to a page : inlinemod.php If I look in the source code, I can see the field being change with my option, but it`s not redirecting me to the right page. |
There's no opening tag for the form if that's the exact code you're using, so it's probably merging with the inlinemod form.
|
Sorry, I posted that before the td cell. Even if I add it, still doesn`t work.
|
So what's the full code, including the opening form tag?
|
This is the postbit. You can see there the paypal. That generates a button, but when I click it, I`m redirected to the inline mod.
PHP Code:
|
If you use $bbuserinfo[field5], that will be the value for the user CURRENTLY logged in and viewing the post. You need to use $post[field5].
|
Even if I use that value, the system still doesn`t send me to paypal !
PS. Thanks for the info though. So what should I add so when a user posts a thread, the email would be taken from his profile ? Like using $post[musername] to take a field value from the user ? |
Yes, that would be the username of the poster.
|
Ok, but how can I get a field value from a user ?
The profile value of the poster...I have field5 created...how can I get that value from the user ? |
$post[field5] should be doing exactly that. Try changing it to $post['field5']? :confused:
|
It`s like this, users make posts, and in each postbit, I would get under the poster, a paypal donate button, with the email taken from the posters profile..I tried the $post with ''
Quote:
|
I have been trying the same thing on my forum. I have been getting the same thing you have for a week now. Have you had anymore luck with it?
|
Hm. The thought just occurred to me that the values aren't processed until the paypal site (since that's where the form submit is) and that by the time you get to that stage any post value is meaningless since you've left the forum.
Perhaps? |
Yes that is a good point. I can get this to work in IE but not Fire Fox. In IE it lets you goto the paypal site but it does not have the paypal email any more and throws up an error.
So any ideas on how we could do this? |
The following was tested on Internet Explorer, FireFox, and Opera: worked on all three.
Code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> |
So you were able to make a donation and go all the way through with it on all 3 browsers?
I just tried your code above and still the same thing. So back to the drawing board. :) Thanks for the input. |
Code works when I`m not logged in, LOL, it didn`t cross my mind it would work like this. I need to try now to make some dummy users, and see if this code takes their email, or just the last posters email.
|
I guess I just don't understand why this wouldn't work. When I look at the source of the page, everyone's email address is correct. Why would it change upon clicking submit? That doesn't make any sense.
I'm willing to bet that it's on PayPal's end. In any case, the code that I posted works perfectly for me. However, the code I took from your post does not work for me. I honestly have no explination either... |
Yeah. I wish we could come up with this and get it working. I am sure allot of people would love to have this hack.
|
It makes no sense to me. The following is taken directly from what vBulletin.org uses:
Code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> This bothers me and I'm sure I'll continue toying with it for awhile. >_<; |
Well no luck on my end yet. I have asked a coder that has more experience in coding than I but no response yet from them. Fingers crossed.
|
The fact is, this works for me, only when I log out. If I`m logged in, and click the button generated, I get redirected to the inline mod. A bug in vB maybe, something not validating/using forms as it should be ? Session variables ?
|
I have found a way to make this work. We were using the wrong code all together. I have decided to make a hack for this so users can add this to there postbit if they want. This is only my 3rd hack and so far it is working great. I just have a couple things left before it is done. I am working on making it so the user can show if they are paypal verified or not.
If you are still wanting this let me know. OK it is finished. Here is a screen shot of it. http://img292.imageshack.us/img292/4...stbitsswr0.gif |
OMG. WOW. Yes yes, please do it :D
|
Here is the link to it. Click install and help a brother out. LOL
https://vborg.vbsupport.ru/showthread.php?t=139552 I hope it does what you want. |
Man, hat down. ;) Everything works like a charm ;)
|
Thanks bud. It is only my third hack. So I was hoping it worked how you wanted.
|
Works perfectly, the only suggestion that I`d have is uploading the paypal images, they`re a bit hard to find for some people.
|
You can change the images used by just getting new images and renaming them the same name as the images I used. Then just upload them. One of the images I used is a Paypal small icon. The other is one I had on my PC.
|
Yes, I know. I got the images, paypal and verified from vBulletin`s donate thing LOL. Anyway, keep up the good work :)
|
If I mis understood the question please explain more. It has been a log day and my brain is worn down. I hope to do more with this hack. So I am open to suggestions.
|
All times are GMT. The time now is 12:54 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|