Gossamer Forum
Quote Reply
How would I go about putting the top 10 rated links on the home.html template?

Quote Reply
Re: Ratings In reply to
Look at the code for generating the top rated links in page.cgi. Add that code to the routine to build the home page. Put the results of the top 10 routine in a variable called $top_10_ratings (or something like that) and pass that value to the home page building routine.

If the next version of links doesn't have it, I will release (I have to make it at least a little user friendly) a mod that puts the the top "x" links, or whatever you want into another table, and you can call the value up from any routine, as long as you first fill in the table.

This is a semi-persistant mechanism as opposed to the way I've done it in the released top keywords code, of using a variable in the HTML_Templates.pm file.

It's an extension of some stuff I'm doing to allow user preferences and profiles.

As always, I'll release the code when it's done -- but I'm really waiting on two things. One, is the new version of links, since i'd rather release code that uses as much of the links internals as possible (for support and compatibility reason) and TWO, is, the code still isn't flexible enough for general use.

There is a lot of pent-up programming energy in the members of this forum, and when the next version finally makes it's appearance, I'm sure the first mods will hit the forum within hours.

PS: You can always just do it the way I did the top keyword searches... put the code in the HTML_Templates.pm file, and call it from inside the home page routine, but for some reason that wasn't my first inclination to do it that way. I think you'll have better luck doing it from inside the nph-build.cgi routines.

FAQ: http://www.postcards.com/FAQ/LinkSQL/