Sorry if you are confused, but there are no variations of the Mod. The Mod was written by Jerry.
Here is what you need to do for templates:
1) Add the following sub-routine in your
nph-build.cgi file. This can be placed at the end of the script:
Code:
sub build_top_x {
my ($category) = @_;
my (@values, $top_cat, @topx, $topxhtml, $count);
$db_sort_links = "14";
@topx = &build_sorthit (@{$links{$category}});
$db_sort_links = "1";
$topxhtml = qq~<table cellpadding="0" cellspacing="0" border="0">\n~;
my $display = 5;
(($#topx+1) / ($#db_cols+1) >= 5) or $display = ($#topx+1)/($#db_cols+1);
for ($i = 0; $i < $display; $i++) {
%tmp = &array_to_hash ($i, @topx);
$count = $i+1;
$topxhtml .= qq~<tr><td valign="top"><$font><b>$count.</b></font> </td><td valign="top"><$font>~;
if ($tmp{'isDetailed'} eq "Yes") { $topxhtml .= qq~<a href="$build_detail_url/$tmp{$db_key}$build_extension"><b>$tmp{'Title'}</b></a>~; }
else { $topxhtml .= qq~<a href="$build_jump_url?$db_key=$tmp{$db_key}"><b>$tmp{'Title'}</b></a>~; }
$topxhtml .= qq~</font><br><$font_small>($tmp{'Hits'} Downloads)</font></td></tr>\n~;
}
$topxhtml .= qq~</table>~;
return $topxhtml;
}
2) Then add the following codes:
Code:
$top = &build_top_x ($cat);
AFTER the following codes in the
sub build_category_pages routine in the
nph-build.cgi file:
Code:
$title_linked = &build_linked_title ($cat);
$title = &build_unlinked_title ($cat);
$total = ($#{$links{$cat}} + 1) / ($#db_cols + 1);
$category_name = $cat;
$category_name_escaped = &urlencode ($cat);
$category_clean = &build_clean ($cat);
3) Add the following codes:
Code:
$t1 = time();
print "** Creating Top Sites in Categories. . .\n";
&build_top_x;
print "** Done (", time - $t1, " s)!\n\n";
AFTER the following codes:
Code:
$t1 = time();
print "** Creating What's Cool Page. . .\n";
&build_rate_page;
print "** Done (", time - $t1, " s)!\n\n";
in the
sub build_staggered routine in the
nph-build.cgi file.
4) Add the following codes:
Code:
# Create Top Sites in Categories
print "Building Top Sites in Categories . . .\n";
&build_top_x;
print "Done\n\n";
AFTER the following codes in the
sub build_all routine in
nph-build.cgi:
Code:
# Create What's Cool Page
$use_html ?
print "Building <A HREF=\"$build_ratings_url/$build_index\">What's Cool</A> Page . . .\n" :
print "Building Top Rated . . .\n";
&build_rate_page;
print "Done\n\n";
5) Add the following codes to the
sub site_html_category routine in the %load_template area:
6) Then in your
category.html template file, add the following tag to the spot in the page where you want the Top Sites located:
Hope this makes it clear.
Regards,
------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
[This message has been edited by Eliot (edited October 17, 1999).]