Gossamer Forum
Home : Products : Gossamer Links : Discussions :

displaying unpaid links

Quote Reply
displaying unpaid links
I want to make it so unpaid links are displayed in a category listing even when they are not paid for (if they don't pay initially, I'll require them to pay later when they want to modify their link). Except for the fact the link doesn't appear in the category page Crazy it works perfectly, and don't want payments to be optional (or, at least, appear optional) during submission.

In Build.pm I commented out the following lines (which separates out free and paid links) but still get the unpaid links removed. It seems to me this last bit could be edited to do what I want, but I'm not sure:

$cond->add(ExpiryDate => '>=' => time);

I wish there were control of the link display at the template level, but understand the concept of paid vs. unpaid is deeply rooted into the code.

best,
squillo

# Load payment info if payment is enabled. Change sort order by paid links
# first then free links if payment for this category is optional. If payment
# is required, we need to remove unpaid links

# hack as described gossamer-threads.com/perl/gforum/gforum.cgi?post=292632
# if ($CFG->{payment}->{enabled}) {
# require Links::Payment;
# my $payment_info = Links::Payment::cat_payment_info($opts->{id});
#
# if ($payment_info->{mode} == OPTIONAL) {
# my $paycond = GT::SQL::Condition->new($cond);
# $paycond->add(ExpiryDate => '>=' => time, ExpiryDate => '<=' => UNLIMITED);
#
# my $offset = ($opts->{nh} - 1) * $opts->{mh};
# $catlink_db->select_options(@select_options);
# $catlink_db->select_options("LIMIT $opts->{mh} OFFSET $offset");
# $optional_sth = $catlink_db->select('Links.*', $paycond);
#
# $cond->add(ExpiryDate => '=' => FREE);
# }
# else {
# 1) This is an else (instead of elsif ($payment_info->{mode} == REQUIRED)) because the
# run-time count updating code cannot efficiently take category settings into account
# as doing so requires either subselects (which older MySQL doesn't support), or a fair
# bit of Perl code; a single fast count to determine whether the check is necessary
# won't work. The end result is that counts would be off.
# 2) Even if this was an elsif, we can't include ExpiryDate <= UNLIMITED (to exclude
# free links) because links being free is the default for imported, upgraded, and
# admin-added links, which we don't want to exclude from REQUIRED categories.
# $cond->add(ExpiryDate => '>=' => time);
# }
# }

Subject Author Views Date
Thread displaying unpaid links squillo 2794 Feb 2, 2007, 2:06 PM
Thread Re: [squillo] displaying unpaid links
squillo 2717 Feb 3, 2007, 2:56 PM
Thread Re: [squillo] displaying unpaid links
squillo 2702 Feb 6, 2007, 10:03 AM
Post Re: [squillo] displaying unpaid links
squillo 2693 Feb 7, 2007, 7:42 PM