Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Required payments and Gossamer Links 3.1.0

Quote Reply
Required payments and Gossamer Links 3.1.0
Just a warning to users who are about to upgrade to 3.1.0. If you have payments enabled and require payments as a global setting or per category, then you'll want to wait a few days before upgrading.

In 3.1.0, we added a feature that will allow expired links to be downgraded to free links. However, this means that free links in payment required categories should not show up (they previously did). This shouldn't be a problem if all your links have been added by users, but if your links have been added through the admin side, editor interface, or imported, then they will most likely be added as free links (as it's the default). This means that all these links will not show up in categories that require payment in 3.1.0.

We should have a fix for this issue on Monday for those who won't be using the downgrade to free links feature.

Adrian

Last edited by:

brewt: Feb 13, 2006, 3:03 PM
Quote Reply
Re: [brewt] Required payments and Gossamer Links 3.1.0 In reply to
There is now a critical update in the update system that corrects this problem by reverting the behaviour to the pre-3.1.0 behaviour. The change was causing additional problems with category counts being off, and indeed broke imported and/or upgraded links. Contrary to the post above, this fix does not preclude using the new "optional downgrade" feature, and no changes to your links are required. All users are strongly encouraged to apply this fix, which is listed as a critical update in the Updates system.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Required payments and Gossamer Links 3.1.0 In reply to
So, will paid links in "optional" payment categories be downgraded to free links when they expire?
I am a little confused because in Payment Setup, I still have...

Quote:
Change expired links to free:
This option allows you to define how Gossamer Links treats expired links in optional categories - the links can either automatically become free links, in which case they will still show up in the free listing of optional-payment categories, or they can be left as expired and consequently will not show up in optional payment categories.
Note: After changing this option, you must run the Repair Tables code (located in the Database admin menu)


Also, when performing Repair Tables, it still performs this check:
Quote:
Checking for optional, expired links to update to free...


I used to have to hack core code (3.0.1) it order to display expired links.
I have not re-applied the hack to 3.1 because it appears that the Payment Option above
is working without these old hacks. I am trying to determin If I have to keep making these
following changes in core code specific to my use which is to simply display all links
rgardless of the payment status.
Code:

============================================================================
Search.pm
Build.pm
============================================================================
Description:
This mod displays ALL links regardless of the payment status.

File: links/admin/Links/User/Search.pm
------------------------
Find:

$IN->param('ExpiryDate', '>=' . time) if $CFG->{payment}->{enabled};

Make it a comment.




File: links/admin/Links/Build.pm
sub: build_category
------------------------
Comment out the following.

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 {
$cond->add(ExpiryDate => '>=' => time);
}
}


============================================================================
SiteHTML.pm
============================================================================
Description:
This mod shows all payment tags when viewing links.

File: links/admin/SiteHTML.pm
sub: site_tags_link
------------------------
Find:

if ($rec{isLinkOwner} and $CFG->{payment}->{enabled} and $rec{ExpiryDate} != UNLIMITED and $catp->{payment_mode} != NOT_ACCEPTED) {

Replace with this:

if ($CFG->{payment}->{enabled} and $rec{ExpiryDate} != UNLIMITED and $catp->{payment_mode} != NOT_ACCEPTED) {

------------------------
You then have to change stuff in link.html:

<%if paymentsEnabled%>
rest of code here to make up the link...
<%endif%>


To this:
<%if isLinkOwner and paymentsEnabled%>
rest of code here to make up the link...
<%endif%>

Posters Note - because "ExpiryDate != UNLIMITED" is included in the code above,
this will NOT display all the information for links that have an unlimited or
"lifetime" payment applied to them.

Chris - Actually I find that links marked UNLIMITED or "Never Expire" return "false"
when asked <%if paymentsEnabled%>. This required some fancy if/else statements in
link.html to allow UNLIMITED files to display the "Play It" button.

I would obviously prefer to not have to apply these edits.
So will a link that was paid and expires become a free link?

My payment global option is "Not Accepted", and I have 1 category that
is payment mode "Optional"

Thanks for some clarification

Chris
RGB World, Inc. - Software &amp; Web Development.
rgbworld.com
Quote Reply
Re: [rgbworld] Required payments and Gossamer Links 3.1.0 In reply to
That option will only affect categories where it's set to Optional payments (whether it's explicitly set on the category or it's inherited from the global option). Once links in such categories expire, and the option is set to change the links to free links, then the link should become a free link.

Adrian