sort order for newspro

Archive of notes and cross input on Dev versions of Coranto (1.25.1 and Older)

Moderators: Dale Ray, SrNupsen, Bluetooth, Jackanape

sort order for newspro

Postby ccunet » Fri May 10, 2002 9:45 pm

If there a way to sort the order of posts in newspro? I have someevent dats that I'd like posted in the order of the most current to the furthest away.
ex
May 10
May 26
...

Sept 9
Sept 16

Is there a way to do this

Thanks

CCUnet
ccunet
 
Posts: 182
Joined: Tue Apr 16, 2002 12:48 am

Postby l0rdphi1 » Tue May 28, 2002 1:40 pm

Not as far as I know... or remember. :D
User avatar
l0rdphi1
 
Posts: 3590
Joined: Sat Mar 09, 2002 10:03 pm
Location: Pennsylvania, United States of America

Postby Mat » Tue Jun 04, 2002 3:52 am

You could try these:

Choose the most appropriate from the following sort order subs, and add it to your ndisplay.pl file.

Then enter the name of the sub in your news profile.

# Sort alphabetically on two fields
sub NewsCatFilterAlpha {
my @NND = &NewsCatFilter(@_);
my @NNDsorted = map { $_->[0] }
sort { $b->[1] cmp $a->[1] || $b->[2] cmp $a->[2] }
map { [ $_, $_->{'newssubject'}, $_->{'otherfield'} ] } @NND;
return @NNDsorted;
}


#NewsCatFilterReverse: Uses chronological (oldest first) order.
sub NewsCatFilterReverse {
my @NND = reverse(&NewsCatFilter(@_));
return @NND;
}


#NewsCatFilterAlpha: Uses alphabetical order, by subject.
sub NewsCatFilterAlpha {
my @NND = &NewsCatFilter(@_);
my @NNDsorted = map { $_->[0] }
sort { $b->[1] cmp $a->[1] }
map { [ $_, $_->{'newssubject'} ] } @NND;
return @NNDsorted;
}

# Sort alphabetically by category and subject
sub Sort_Cat_Subject {
my @NND = &NewsCatFilter(@_);
my @NNDsorted = map { $_->[0] }
sort { $b->[1] cmp $a->[1] || $b->[2] cmp $a->[2] }
map { [ $_, $_->{'newscat'}, $_->{'newssubject'} ] } @NND;
return @NNDsorted;
}
User avatar
Mat
 
Posts: 96
Joined: Tue Apr 02, 2002 8:01 am
Location: Sunny Dubai


Return to Coranto Development Archives -- 1.25.1 and Older

Who is online

Users browsing this forum: No registered users and 1 guest

cron