Gossamer Forum
Home : Products : Gossamer Links : Discussions :

paymentsEnabled

Quote Reply
paymentsEnabled
i have enabled payments on my site but <%paymentsEnabled%> does not work.
please help
Quote Reply
Re: [ajiimd] paymentsEnabled In reply to
Where are you using the tag? The tag is only defined in certain places.

Adrian
Quote Reply
Re: [brewt] paymentsEnabled In reply to
on link.html , it work in modify select but not search results page

Last edited by:

ajiimd: Nov 19, 2004, 3:39 PM
Quote Reply
Re: [ajiimd] paymentsEnabled In reply to
Looking at the code, paymentsEnabled probably isn't what you think it is. paymentsEnabled is a per link setting (so you can only use it in link.html, which you are), and is only true if the current user is the linkOwner, payments is enabled and it isn't an unlimited link.

Adrian
Quote Reply
Re: [brewt] paymentsEnabled In reply to
thanks for your help so far. i see tha paymentsEnabled is not what i thought it was
i did not realize that you hae to be logged in inorder for it to work.what I would like to do is have my paid linksshowed differently from the search results page than free links. Obviously, I'm not able to use this set up:

<%if paymentsEnabled and isFree%>
<%linkfree.html%>
<%elseif paymentsEnabled and not isFree%>
<%linkpremium.html%>
<%endif%>

how do you suggest I go about this task.
thanks in advance
Quote Reply
Re: [ajiimd] paymentsEnabled In reply to
here is the anwser
<%payment_tags%>
sub {
my $tags = GT::Template->tags;
if ($CFG->{payment}->{enabled}) {
my $expiry_date = $tags->{ExpiryDate};
my $rec;
$rec->{paymentsEnabled} = 1;
$rec->{isUnpaid} = $expiry_date == UNPAID;
$rec->{isFree} = $expiry_date == FREE;
$rec->{isExpired} = ($expiry_date > UNPAID and $expiry_date < time);
return $rec;
}
}