Hi!
I'll try... Don't kill me, if I'm wrong. I've have changed this long time ago to work with hits per day!
This first part sorts @popular by hits!
# Sort the popular list, and set the cutoff mark.
@popular = sort { $b <=> $a } @popular;
The following lines checks if $db_popular_cutoff is shorter then one.
($db_popular_cutoff < 1) ?
If it is shorter then one, then you have configured Links to show the TOP x percent as pupular. Example: If you set $db_popular_cutoff = 0.1 it now shows the 10% most viewed sites. If you have 100 sites in your db, it will show 10 TOP-sites, if you have 2000 it will show 200 TOP-sites!
($cutoff = $popular[int($db_popular_cutoff * $#popular)]) :
In the case of a $db_popular_cutoff greater 1, it now takes $db_popular_cutoff-sites as TOP-sites! If you set $db_popular_cutoff = 10 it will show always 10 top-sites, no matter how big your db is.
($cutoff = $popular[$db_popular_cutoff - 1]);
Now the $cutoff is set to the hits-count of the last page with enough hits to be popular. (If there are more then one pages with this hits-count, it will show all of this pages. This is why sometimes the top10 has 12 entrys!)
To avoid links from taking links as popular, which has less then 2 to hits, this line sets $cutoff to 2 if it is less then to:
($cutoff < 2) and ($cutoff = 2);
I hope I could be a little help to you. This code is a little bit of perl-magic. But it is less confusing the the parsing of the templates. I needed one hour to get, how links parses templates... ;-)
Bye
Tiggr