Gossamer Forum
Home : Products : Links 2.0 : Customization :

Re: Links as Voting Topsites?

Quote Reply
Re: Links as Voting Topsites? In reply to
Sorry if you are confused, but there are no variations of the Mod. The Mod was written by Jerry.

Wink

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:

Code:
top => $top,

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:

Code:
<%top%>

Hope this makes it clear.

Smile

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).]
Subject Author Views Date
Thread Links as Voting Topsites? Karl 7592 Oct 16, 1999, 7:45 PM
Post Re: Links as Voting Topsites?
widgetz 7048 Oct 16, 1999, 7:49 PM
Post Re: Links as Voting Topsites?
Karl 7068 Oct 16, 1999, 7:54 PM
Post Re: Links as Voting Topsites?
widgetz 7006 Oct 16, 1999, 8:56 PM
Post Re: Links as Voting Topsites?
Karl 7090 Oct 17, 1999, 3:58 AM
Post Re: Links as Voting Topsites?
Eliot 7061 Oct 17, 1999, 12:21 PM
Post Re: Links as Voting Topsites?
widgetz 7013 Oct 17, 1999, 12:35 PM
Post Re: Links as Voting Topsites?
Eliot 7093 Oct 17, 1999, 1:14 PM
Post Re: Links as Voting Topsites?
widgetz 7063 Oct 17, 1999, 1:33 PM
Post Re: Links as Voting Topsites?
ron4315 7069 Oct 17, 1999, 4:50 PM
Post Re: Links as Voting Topsites?
Eliot 7024 Oct 17, 1999, 5:07 PM
Thread Re: Links as Voting Topsites?
widgetz 7117 Oct 17, 1999, 5:08 PM
Post Re: Links as Voting Topsites?
wirefram 2982 Dec 11, 2000, 11:59 AM
Post Re: Links as Voting Topsites?
widgetz 7015 Oct 17, 1999, 5:09 PM
Post Re: Links as Voting Topsites?
widgetz 7035 Oct 17, 1999, 5:12 PM
Post Re: Links as Voting Topsites?
Eliot 7049 Oct 17, 1999, 5:19 PM
Post Re: Links as Voting Topsites?
ron4315 7056 Oct 17, 1999, 5:20 PM
Post Re: Links as Voting Topsites?
widgetz 7017 Oct 17, 1999, 5:24 PM
Post Re: Links as Voting Topsites?
widgetz 7057 Oct 17, 1999, 5:28 PM
Post Re: Links as Voting Topsites?
ron4315 7075 Oct 17, 1999, 5:29 PM
Post Re: Links as Voting Topsites?
widgetz 7073 Oct 17, 1999, 5:41 PM
Post Re: Links as Voting Topsites?
Eliot 7021 Oct 17, 1999, 5:51 PM
Post Re: Links as Voting Topsites?
Karl 6998 Oct 17, 1999, 8:31 PM
Post Re: Links as Voting Topsites?
Eliot 7060 Oct 18, 1999, 5:26 AM
Post Re: Links as Voting Topsites?
ron4315 7068 Oct 18, 1999, 12:24 PM
Post Re: Links as Voting Topsites?
ron4315 7056 Oct 18, 1999, 12:34 PM
Post Re: Links as Voting Topsites?
Eliot 7814 Oct 18, 1999, 3:23 PM
Post Re: Links as Voting Topsites?
Brad Richardson 7696 Oct 20, 1999, 6:53 AM
Post Re: Links as Voting Topsites?
Karl 7681 Oct 20, 1999, 7:30 AM
Post Re: Links as Voting Topsites?
socrates 7719 Oct 20, 1999, 5:05 PM
Post Re: Links as Voting Topsites?
widgetz 7684 Oct 20, 1999, 6:19 PM
Post Re: Links as Voting Topsites?
socrates 7755 Oct 21, 1999, 1:15 PM
Post Re: Links as Voting Topsites?
widgetz 7708 Oct 21, 1999, 3:51 PM
Post Re: Links as Voting Topsites?
ron4315 7724 Oct 21, 1999, 4:56 PM
Post Re: Links as Voting Topsites?
widgetz 7722 Oct 21, 1999, 5:09 PM
Post Re: Links as Voting Topsites?
socrates 7703 Oct 21, 1999, 5:47 PM
Post Re: Links as Voting Topsites?
widgetz 7693 Oct 21, 1999, 6:27 PM
Post Re: Links as Voting Topsites?
joloo 7703 Nov 9, 1999, 1:52 PM
Post Re: Links as Voting Topsites?
Eliot 7700 Nov 9, 1999, 1:57 PM
Post Re: Links as Voting Topsites?
joloo 7704 Nov 9, 1999, 4:41 PM
Post Re: Links as Voting Topsites?
Eliot 7711 Nov 9, 1999, 4:45 PM
Post Re: Links as Voting Topsites?
joloo 7709 Nov 10, 1999, 10:44 AM
Post Re: Links as Voting Topsites?
Eliot 7635 Nov 10, 1999, 5:58 PM
Post Re: Links as Voting Topsites?
joloo 7662 Nov 11, 1999, 1:58 AM
Post Re: Links as Voting Topsites?
Bmxer 7656 Nov 11, 1999, 2:27 AM
Post Re: Links as Voting Topsites?
joloo 7616 Nov 11, 1999, 3:08 PM
Post Re: Links as Voting Topsites?
Eliot 7663 Nov 11, 1999, 3:14 PM
Post Re: Links as Voting Topsites?
widgetz 7669 Nov 11, 1999, 6:15 PM
Post Re: Links as Voting Topsites?
joloo 7628 Nov 14, 1999, 12:17 PM
Post Re: Links as Voting Topsites?
Bmxer 7619 Nov 14, 1999, 12:35 PM
Post Re: Links as Voting Topsites?
joloo 7733 Nov 16, 1999, 12:47 PM
Post Re: Links as Voting Topsites?
jooloo 3411 Jan 31, 2000, 1:28 PM
Post Re: Links as Voting Topsites?
RobL 3364 May 1, 2000, 2:39 AM
Post Re: Links as Voting Topsites?
Stealth 3419 May 1, 2000, 2:41 PM
Post Re: Links as Voting Topsites?
rdm 3379 May 2, 2000, 4:01 PM
Post Re: Links as Voting Topsites?
Stealth 3375 May 2, 2000, 4:04 PM
Post Re: Links as Voting Topsites?
rdm 3414 May 2, 2000, 4:16 PM
Post Re: Links as Voting Topsites?
Stealth 3348 May 2, 2000, 4:47 PM
Post Re: Links as Voting Topsites?
doms 3166 Aug 22, 2000, 11:11 AM