Gossamer Forum
Home : Products : Links 2.0 : Customization :

get rid of pop and new

Quote Reply
get rid of pop and new
Hello,
Please is there a way to get rid of the pop and new links in a list.. because it's always the same pop at the beginning of a listing and it gets very annoying. Thank you

Quote Reply
Re: get rid of pop and new In reply to
Hi,

The tags are in your link.html (e.g. <%if isNew%>...<%endif%>



Until next time...

Ryan

http://links.innovationstudios.com/
Quote Reply
Re: get rid of pop and new In reply to
Hello, thank you for the feeback. unfortunately that doesnt resole my problem. It's always the same link at the first position.
http://www.thebritneymania.com/Pictures/

Quote Reply
Re: get rid of pop and new In reply to
I assume you want to change the way your links are sorted. Take a look at the sub build_sorthit in db_utils.pl. You could also search the forum, there's plenty of info on sorting.

Thomas
http://www.japanreference.com
Quote Reply
Re: get rid of pop and new In reply to
To alphabetize links in the categories....

Replace your sub build_sorthit routine in the db_utils.pl file with the following codes:

--------------------------------------------------------------------------------

sub build_sorthit {
# --------------------------------------------------------
# Alphabetical sorting routine.
my (@unsorted) = @_;
my ($num) = ($#unsorted+1) / ($#db_cols+1);
my (%sortby, %priority, $hit, $i, @sorted);
for ($i = 0; $i < $num; $i++) {
$sortby{$i} = $unsorted[$db_sort_links + ($i * ($#db_cols+1))];
($unsorted[$db_priority + ($i * ($#db_cols+1))] eq "Yes") and ($priority{$i} = 1);
}
foreach $hit (sort {
($priority{$b} and !$priority{$a}) and return 1;
($priority{$a} and !$priority{$b}) and return -1;
($priority{$a} and $priority{$b}) and return lc($sortby{$a}) cmp lc($sortby{$b});
return lc($sortby{$a}) cmp lc($sortby{$b});
} (keys %sortby)) {
$first = ($hit * $#db_cols) + $hit;
$last = ($hit * $#db_cols) + $#db_cols + $hit;
push (@sorted, @unsorted[$first .. $last]);
}
return @sorted;
}

--------------------------------------------------------------------------------


Mapo
Links Installer
http://www.youthresources.com/services/index.html
Quote Reply
Re: get rid of pop and new In reply to
If just going to alphabetize links the code using the priority field is not needed.

Good Luck!

Glenn
Host Links
http://cgi-resource.co.uk/links
Quote Reply
Re: get rid of pop and new In reply to
Actually to alphabetize by title you could use this code I modded :)

sub build_sorthit {
# --------------------------------------------------------
# This function sorts a list of links. It has been modified to sort
# new links first, then cool links, then the rest alphabetically. By modifying
# the sort function below, you can sort the links however you like (by date,
# or random, etc.).
#
my (@unsorted) = @_;
my ($num) = ($#unsorted 1) / ($#db_cols 1);
my (%sortby, %isnew, %iscool, $hit, $i, @sorted);

for ($i = 0; $i < $num; $i ) {
$sortby{$i} = $unsorted[$db_sort_links ($i * ($#db_cols 1))];
($unsorted[$db_title]);
}
foreach $hit (sort {
($title{$a} and !$title{$b}) and return 1;
($title{$b} and !$title{$a}) and return -1;
($title{$a} and $title{$b}) and return lc($sortby{$a}) cmp lc($sortby{$b});
return lc($sortby{$a}) cmp lc($sortby{$b});
} (keys %sortby)) {
$first = ($hit * $#db_cols) $hit;
$last = ($hit * $#db_cols) $#db_cols $hit;
push (@sorted, @unsorted[$first .. $last]);
}
return @sorted;
}

Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/