forum.coppermine-gallery.net
No Support => Modifications/Add-Ons/Hacks => Mods: Selling pictures => Topic started by: artistsinhawaii on October 15, 2005, 02:43:04 am
-
I've seen a lot of posts for this so I'm adding this to the mod section. This is a very basic paypal subscription mod. Not much to it.
Place this javascript in your theme's template.html <head> section.
<script type="text/javascript">
<!--//hide from xhtml verifiers
function Dollar (val) { // take str or num, return str
var str,pos,rnd=0;
if (val < .995) rnd = 1; // for old Netscape browsers
str = escape (val*1.0 + 0.005001 + rnd); // float, round, escape
pos = str.indexOf ("."); // should be one
if (pos > 0) str = str.substring (rnd, pos + 3);
return str; // return valid PayPal dollar string
}
function ReadForm (obj1, tst) { // process un-named selects
var pos,val,txt,des,ary;
if (tst && (obj1.a3.value == "")) {
alert ("Make a subscription selection!");
return;
}
des = obj1.basedes.value; // base description
pos = obj1.sub.selectedIndex; // subscription selected
txt = obj1.sub.options[pos].text; // select text data
val = obj1.sub.options[pos].value; // select value data
ary = val.split (","); // isolate items in array
obj1.t3.value = ary[0].toUpperCase ();
obj1.p3.value = ary[1];
obj1.a3.value = Dollar (ary[2] * ary[1]);
obj1.src.value = ary[3];
obj1.sra.value = ary[4];
obj1.item_name.value = des;
obj1.item_number.value = val.toUpperCase ();
}
//-->
</script>
Next place this in either your template.html or your anycontent.php file.
<h3>Basic recurring subscription - Sorry, no free trials.</h3>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"
onsubmit="this.target='paypal';
return ReadForm (this, true);">
<p>
<input type="hidden" name="cmd" value="_xclick-subscriptions" />
<input type="hidden" name="business" value="test@paypal.com" />
<input type="hidden" name="item_name" value="" />
<input type="hidden" name="item_number" value="" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="basedes" value="Test Item" />
Description of item - Subscribe now!
<br /><br />
<select name="sub" onchange="ReadForm (this.form, false);">
<option>Subscription type</option>
<option value="d,1,2.00,1,1">Daily ($2.00/day)</option>
<option value="w,1,10.00,1,1">Weekly ($10/week)</option>
<option value="m,1,40.00,1,1">Monthly ($40/month)</option>
<option value="m,3,35.00,1,1">Quarterly ($35/month)</option>
<option value="m,6,30.00,1,1">Biannually ($30/month)</option>
<option value="y,1,300.00,1,1">Yearly ($25/month)</option>
<option value="y,3,240.00,0,1">3 Years ($20/month)</option>
</select>
<br /><br />
<input type="image" src="http://www.paypal.com/images/x-click-but20.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
<input type="hidden" name="a3" value="" />
<input type="hidden" name="p3" value="" />
<input type="hidden" name="t3" value="" />
<input type="hidden" name="src" value="" />
<input type="hidden" name="sra" value="" />
</p>
</form>
<hr />
Change the values as needed. Change the email address as well.
Please don't ask me design questions. How you might design your layout is very different from me or anyone else.
Dennis
-
How do I link this mod/hack up to my pay pal account ;D
-
Change this line:
<input type="hidden" name="business" value="test@paypal.com" />
Dennis
-
Hey, Ive been looking for a mod like this but would like to automatically place the member into a different group when that member subscribes and back out off that group when they un-subscribe.
Would this mod do this? if not what would I need to do this?
-
Hey, Ive been looking for a mod like this but would like to automatically place the member into a different group when that member subscribes and back out off that group when they un-subscribe.
Would this mod do this? if not what would I need to do this?
I don't know of any automatic way of doing the above. You could create a paypal return form (see paypal for instructions on this) and on that page you would have a username and password with instructions for the user to change and how to change their username and password as soon as they have logged in. Inform them that the assigned username and password is temporary and will be disabled shortly. You should change these regularly.
You subscriber after payment will be directed to this page and see the information.
Removing users from the group, I'm afraid will have to be manual. I can't think of any way of reading paypal's database against your coppermine's database. It's the part of earning money that's called "work", I suppose.
Dennis
-
Thanks for your promt Reply Dennis, I'll take a look at the paypal site and see whats involved with doing the above. Many Thanks
-
Thanks for your promt Reply Dennis, I'll take a look at the paypal site and see whats involved with doing the above. Many Thanks
Have you come up with a solution?
-
As it stands this MOD would not support moving your members from one group to another upon signup...
Can it be done, Yes it can, via PayPal IPN. You have to set this up via your PayPal account options.
Then in the form as it is psted above you would have to add this line
<input type="hidden" name="notify_url" value="http://www.YOURSITE.com/SCRIPT_TO_RUN_COMMANDS.php">
PayPal would then send an HTTP Post back to that address and your SCRIPT_TO_RUN_COMMANDS.php would have to know what to do depending on what PayPal was telling it...Did they Subscribe do this...Did the cancel do this blah blah blah....
Sorry I am currently doing this for my site, and its a HUGE pain in the rear...even more so becuase I am not a CPG standalone site, HELP!!! LMAO ;D
Anyway hope that helps at least a little...is this somthing that is stell really needed? Or has someone finally done this?
-
But would this work for say coppermine bridged with phpbb forum??
-
I couldn't see a reason why it shouldn't work. Easiest way to find out (instead of posting the question and waiting for others to find your answers) is by trying yourself and posting feedback.
-
I couldn't see a reason why it shouldn't work. Easiest way to find out (instead of posting the question and waiting for others to find your answers) is by trying yourself and posting feedback.
Yep, thats the best way. Hack at it until it works LOL.
When I have more time on my hands, if someone hasnt already given it a go and gotten it to work, maybe I will give this one a go.
-
I am really interested in this MOD to be full stand alone and not have to go into paypal and check status and change user status accordingly. Just messin. I also want it to work with credit cards but that is a whole different storry.
-
I am really interested in this MOD to be full stand alone and not have to go into paypal and check status and change user status accordingly. Just messin. I also want it to work with credit cards but that is a whole different storry.
Thats exactly what it would do...your site would receive a transmission from paypal behind the scenes and take care of everything for you. Paypal = Credit Cards processing so I have no idea what you are on about?
-
Sorry the just messin part should not be there. I was making a joke and decided to delete it but forgot to delete that part. I have the paypal setup on coppermine as well as CC and have to do all the changes to accounts manuely. I gets to be a pain in but when you have over 3k members and about to implement it on a site with 80k people. I will not be able to keep up manuely with requests. So has someone programed the file to auto change everything? Any status on it or has anyone started it? If nobody has I will take a crack at it once I am done with a few other things on site.
-
Sorry the just messin part should not be there. I was making a joke and decided to delete it but forgot to delete that part. I have the paypal setup on coppermine as well as CC and have to do all the changes to accounts manuely. I gets to be a pain in but when you have over 3k members and about to implement it on a site with 80k people. I will not be able to keep up manuely with requests. So has someone programed the file to auto change everything? Any status on it or has anyone started it? If nobody has I will take a crack at it once I am done with a few other things on site.
No one has yet that I am aware of.
-
I will work on the code right after I finish the bridge for nuke
-
Has anyone got any further with this yet??
I'm looking for a mod that will change a members CPG Group upon payment of a Paypal Subscription (and change it back once that subscription expires).
Has any progress been made with such a mod.
Thanks,
Al.
-
Don't request different mods on this thread. In fact, don't do this on any mod thread. It only clutters the thread. Start a new thread on the support board that deals with your version, or post on the paid help section if you're ready to actually pay/sponsor a mod.
-
Sorry.... But I was only asking if any progress had been made with this modification as discussed earlier in this thread. I thought it was better to keep the information all in one place rather than start another thread about the same thing.... But if those are the rules I shall start another thread about this elsewhere.
Cheers.
Al.
-
you can incorporate the paypal IPN feature using PHPcoin (www.phpcoin.com) It's totally cost free and there is no advertising, takes a little setting up though :)
-
Sorry, forgot to ad that to incorporate the gallery access you just needs to add the link/html for the secure members only page & add it to 'auxpages' in phpcoin, it will only give users access with valid subscriptions.