I posted the mod to the resource center. Until it gets validated, here's the instructions. After that, I'll come back and delete them here.
Top 10 on front page mod:
Summary:
This mod will pull the top 10 by votes/ratings into the frontpage by creating a separate file from the same data that can be pulled into any page with an ssi call. It could also be inserted with nph-build.pl but that is not covered here.
You'll need to change 2 files:
nph-build.pl
site_html_templates.pl
You'll need to create 1 new template file:
rate_top_include.html
-------------------------------------------------
In nph-build.pl:
1. Go to sub build_rate_page.
2. Below the line:
Code:
$top_rated = ''; $top_votes = '';
Insert:
Code:
#rate include
$top_rated_include = ''; $top_votes_include = '';
3. Below the line that starts with "$top_votes .= qq~....."
Insert:
Code:
#rate include
$top_votes_include .= qq~<li><a href="$link{'URL'}">$link{'Title'}</a> - ($link{'Votes'} votes) Rating: $link{'Rating'} \n~;
4. Below the line that starts with "$top_rated .= qq~........"
Insert:
Code:
#rate include
$top_rated_include .= qq~<li><a href="$link{'URL'}">$link{'Title'}</a> - ($link{'Votes'} votes) Rating: $link{'Rating'} \n~;
5. Below the next section, right after " close RATE;"
Insert:
Code:
#rate include
open (RATE_INCLUDE, ">$build_ratings_path/rate_include$build_extension") or &cgierr ("unable to open top rated page: $build_ratings_path/rate_include$build_extension. Reason: $!");
print "\tVote Range: $top_votes[0] .. $top_votes[$#top_votes]\n";
print "\tRate Range: $top_rate[0] .. $top_rate[$#top_rate]\n";
print RATE_INCLUDE &site_html_ratings_include;
close RATE_INCLUDE;
-------------------------------------------------
That's it for nph-build.pl. Now on to site_html_templates.pl
-------------------------------------------------
In site_html_templates.pl:
1. Below the sub site_html_ratings,
Insert:
Code:
#rate include
sub site_html_ratings_include {
# --------------------------------------------------------
# This routine determines how the top rated page will look like.
return &load_template ( 'rate_top_include.html', {
top_rated_include => $top_rated_include,
top_votes_include => $top_votes_include,
%globals
});
}
-------------------------------------------------
That's it for site_html_templates.pl. Now on to the template.
-------------------------------------------------
1. Create a new file.
2. Insert the following:
Code:
<b>Top 10 Resources (by Rating) -- with at least 10 votes</b>
<ol>
<%top_rated_include%>
</ol>
<b>Top 10 Resources (by Votes) -- with at least 10 votes</b>
<ol>
<%top_votes_include%>
</ol>
3. Save it as "rate_top_include.html" and put it in your templates directory.
-------------------------------------------------
That's it for the template. No just pull it into your front page.
-------------------------------------------------
1. Just put the ssi call to your file somewhere on your home.html template. Something like:
Code:
<!--#include virtual="/Ratings/rate_include.shtml"-->
2. Build your pages and your top 10 should show up on your home page.
Note: This assumes that you are using the .shtml as your $build_extension (defined in links.cfg. If not, replace all occurances of .shtml with whatever you're using.
-------------------------------------------------
That's it! You're done!
-------------------------------------------------