Gossamer Forum
Quote Reply
Simple Sort by Title
Why can't I sort my links simply by Title?

Every time I do an update I have to worry about whether or not "Build.pm" gets updated or not.

You would think (at least I would) that specifying 'Title' for build_sort_order_category
would actually sort the links by Title, but it doesn't. It incorporates ExpiryDate somehow.

So everytime there is an update to Build.pm, I have to make the following changes:
This mod displays ALL links regardless of the payment status.

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

$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("LIMIT $opts->{mh} OFFSET $offset");
$optional_sth = $catlink_db->select('Links.*', $paycond);

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

Any chance GT could fix this permanently? Or give us an option or something?

FYI, I use payments, but I still want my links just sorted by Title.
Is it just me that wants to sort links by Title? because frankly this is a PITA. Wink

RGB World, Inc. - Software &amp; Web Development.
Quote Reply
Re: [rgbworld] Simple Sort by Title In reply to

What about if you go with plugin for this, and just define your custom interpretation on these functions?


Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [rgbworld] Simple Sort by Title In reply to
I agree that this should be an option. I also have some paid links and don't want these appearing above the free ones - but I don't think I have this problem yet as I haven't upgraded (because I have too many changes to the core code!)
Quote Reply
Re: [rgbworld] Simple Sort by Title In reply to
Yeah, there were a few hacks to the system, and file uploads were one, payments were another. The code is overly complex, and far from robust. I've been removing it as I go along by rewriting segments of the modules. I figure I can add it back in, in a more well thought out manner later.

Maybe in the next update, it will be simplified.

I've been writing my own "VIEWALBE" type routines, using the prototype for "VIEWABLE"

This is something I actually talked with Alex about 3 or 4 years ago, but is a more modern, oop method of doing it.

If you take the concept of what VIEWABLE does, and apply it to a set of configuration flags, you create your own criteria for what is or is not allowed to display for a link (or any attached tables). The "payments enabled" should be part of the VIEWABLE process, not in other parts of the templates (except the user and management areas).

This would allow changes to a single routine to be used by the search (database select) system to apply across the whole system in a manner similar to the concept of "hooks."

Maybe in a future release.

PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.