Ok below is my hack to get a renew link to appear when a user has logged in when their account has expired. please excuse my convention of coding there is probably a better way of putting things I'm still a newbie to mambo and php right enough of the excuses. I used user id's in URL which is probably not a good way. would like to use sessions at a later date.
your gona need to change 3 files
login.validate.php can be found in the administrator/components/com_acctexp/includes
acctexp.php can be found in /components/com_acctexp
acctexp.html.php can be found in /components/com_acctexp
in
login.validate.phpreplace the mosredirect line with
mosRedirect( "index.php?option=com_acctexp&item_number=".$usr->id."&user=" . $username . "&expiration=" . strftime(_ACCT_DATE_FORMAT, $expstamp));this is adding a user id to the link so it can be used within the paypal payment function
in
acctexp.html.phpadd $userid to the function
Code:
function expired($option, $user, $expiration,$userid)
under the following table row
Code:
<tr>
<td align="center">
<?php echo _EXPIRED . $expiration; ?>
</td>
</tr>
add this row
Renew Subscription
|
The userid is required in the function in order for it be placed into the link in the table row
The above hack creates the renew subscription link.
The link contains a
item number which is the
user id and Ive added to the task variable a
updatesub value.
This task variable will tell the next page to display the payment function.
Also i have added the
user name. this will be required in the paypal function
in
acctexp.phpbelow the following line
Code:
$expiration = trim( mosGetParam( $_REQUEST, 'expiration', '' ) );
add this
Code:
$idfromlogin = trim( mosGetParam( $_REQUEST, 'item_number', '' ) );
if (empty($idfromlogin ))
{
global $my;
$userid = ($my->id);
}
else
{
$userid =$idfromlogin;
$name=$user;
}
bit further on down is a case statement add this any where in it
Code:
case "updatesub":
payForm( $option,$userid, $username, $name);
break;
just before the case statement finishes
replace the default
Code:
default:
expired($option, $user, $expiration);
break;
with
Code:
default:
expired($option, $user, $expiration,$userid);
break;
just under the case statement is function called expired
Code:
function expired($option, $user, $expiration) {
HTML_frontEnd::expired($option, $user, $expiration);
}
replace this with
Code:
function expired($option, $user, $expiration,$userid) {
HTML_frontEnd::expired($option, $user, $expiration,$userid);
}
you just adding in the userid
and thats it i think

Ive tested it many times and it works well. i hope i haven't missed anything out. let me know you get any problems.
apologise if i haven't explained well