where {LINKEXPIREDAYS_SPONSOR1} is the days I will be adding to the original expiration date.
Now I will need to catch the "on1" and "os1" variables comming from paypal.com at paypap.php and to increment the value of the 'expire' variable of the link in the corresponding days.
If possible, could you please advice what would be the code to insert at paypal.php
Since on0 seems to correspond to option_selection1 I guess on1 would be option_selection2, so at line 95: $thelink->expire += 60 * 60* 24 * $_POST['option_selection2']; $thelink->update('expire');
At line 95 I do have: $thelink = new onelink('id', $linkid); so I have inserted the code you have indicated just after this line and for the first trials it seems to be working perfectly increasing the expire value of the link.
Comments on incrementing expire variable
Forum Regular
Usergroup: Customer
Joined: Aug 09, 2004
Location: Chile
Total Topics: 172
Total Comments: 462
I would like to combine the expiration feature with link sponsorship,
I would like to increment the "expire" variable when buying a specific amount of funds with paypal,
I understand I will need to include the following at the form to paypal in the sponsor.tpl:
<input type="hidden" name="on1" value="expire">
<input type="hidden" name="os1" value="{LINKEXPIREDAYS_SPONSOR1}">
where {LINKEXPIREDAYS_SPONSOR1} is the days I will be adding to the original expiration date.
Now I will need to catch the "on1" and "os1" variables comming from paypal.com at paypap.php and to increment the value of the 'expire' variable of the link in the corresponding days.
If possible, could you please advice what would be the code to insert at paypal.php
Thanks.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Since on0 seems to correspond to option_selection1 I guess on1 would be option_selection2, so at line 95:
$thelink->expire += 60 * 60* 24 * $_POST['option_selection2'];
$thelink->update('expire');
Forum Regular
Usergroup: Customer
Joined: Aug 09, 2004
Location: Chile
Total Topics: 172
Total Comments: 462
At line 95 I do have: $thelink = new onelink('id', $linkid);
so I have inserted the code you have indicated just after this line and for the first trials it seems to be working perfectly increasing the expire value of the link.
Forum Regular
Usergroup: Customer
Joined: Aug 09, 2004
Location: Chile
Total Topics: 172
Total Comments: 462
Paul,
a)
I have added a conditional for renewing already expired links and it seems working ok as:
if ( $thelink->expire >= time() )
{
$thelink->expire += 60 * 60* 24 * $_POST['option_selection2'];
}
else
{
$thelink->expire = (time()+ 60 * 60* 24 * $_POST['option_selection2']);
}
$thelink->update('expire');
b) Could you please have this code commented at paypal.php in order not to have it deleted when upgrading.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Changed to and inserted.