Webmastersite.net
Register Log In

incrementing expire variable
at link sponsorship

Comments on incrementing expire variable

peumus
Forum Regular

Usergroup: Customer
Joined: Aug 09, 2004
Location: Chile

Total Topics: 172
Total Comments: 462
peumus
Posted Aug 29, 2006 - 6:44 PM:

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.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Aug 30, 2006 - 6:25 PM:

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');
peumus
Forum Regular

Usergroup: Customer
Joined: Aug 09, 2004
Location: Chile

Total Topics: 172
Total Comments: 462
peumus
Posted Aug 30, 2006 - 9:10 PM:

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.
peumus
Forum Regular

Usergroup: Customer
Joined: Aug 09, 2004
Location: Chile

Total Topics: 172
Total Comments: 462
peumus
Posted Nov 11, 2006 - 6:09 AM:

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.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Nov 14, 2006 - 3:28 AM:

Changed to
	  if ($_POST['option_selection2'])
{
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');
}
and inserted.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.