Gossamer Forum
Home : Products : Links 2.0 : Customization :

A how to guide for building a list of Editor's Pick page

Quote Reply
A how to guide for building a list of Editor's Pick page
Ok this will show you how to build a list of editor's pick on a separate page sort of like the what's cool page. After you specify the link as an editor's pick it will build this page w/ the list of links. Remember to back up all files that you make changes to...so that if you fail in your attempt to make this modification you can easily go back to your normal ways. Smile
ok here goes.

1. Add this to links.cfg
Code:
use vars qw(%category %subcategories @links @new_links @cool_links %stats $grand_total $use_html $nph $date $time);
and replace it w/ this:
Code:
use vars qw(%category %subcategories @links @new_links @cool_links @pick_links %stats $grand_total $use_html $nph $date $time);

7. Find this section:
Code:
%category = ();
%subcategories = ();
@links = ();
@new_links = ();
@cool_links = ();
%stats = ();
$grand_total = 0;
my $t1 = time();

and replace it with this:
Code:
%category = ();
%subcategories = ();
@links = ();
@new_links = ();
@cool_links = ();
@pick_links = ();
%stats = ();
$grand_total = 0;
my $t1 = time();

8. Find the step 4 section of the staggered build and add this:
Code:
$t1 = time();
print "** Creating Editor's Picks Page. . .\n";
&build_pick_page;
print "** Done (", time - $t1, " s)!\n\n";
underneath
Code:
$t1 = time();
print "** Creating What's New Pages . . .\n";
&build_new_page;
print "** Done (", time - $t1, " s)!\n\n";

9. Go to this section:
Code:
sub build_all {
# --------------------------------------------------------
# Rebuild the entire directory.

and add this:
Code:
# Create Editor's Pick Page
$use_html ?
print "Building <A HREF=\"$build_pick_url/$build_index\">Editor's Pick</A> Page . . .\n" :
print "Building Editor's Pick Page . . .\n";
&build_pick_page;
print "Done\n\n";

preferably underneath:
Code:
# Create What's New Page
$use_html ?
print "Building <A HREF=\"$build_new_url/$build_index\">What's New</A> Page . . .\n" :
print "Building What's New Page . . .\n";
&build_new_page;
print "Done\n\n";

10. Find sub build_stats {
add this:
Code:
# Add the link to the list of editor's pick links if it is pick.
push (@{$pick_links{$category}}, @values) if ($values[$db_ispick] eq "Yes");

preferably underneath:
Code:
# Add the link to the list of cool links if it is popular.
push (@{$cool_links{$category}}, @values) if ($values[$db_ispop] eq "Yes");
.

11. Find this sub: sub build_cool_page {
DIRECTLY ABOVE THAT add this:

Code:
sub build_pick_page {
# --------------------------------------------------------
# Creates a "Editor's Pick" page.

local ($total, $link_results, $title_linked);
my (%link_output, $category_clean);

if ($build_pick_path =~ m,^$build_root_path/(.*)$,) {
&build_dir ($1);
}

$total = 0;
CATEGORY: foreach $category (sort keys %pick_links) {
LINK: for ($i = 0; $i < ($#{$pick_links{$category}}+1) / ($#db_cols + 1); $i++) {
$total++;
%tmp = &array_to_hash ($i, @{$pick_links{$category}});
$link_output{$category} .= &site_html_link (%tmp) . "\n";
}
}
foreach $category (sort keys %pick_links) {
$category_clean = &build_clean ($category);
$link_results .= qq|<P><A HREF="$build_root_url/$category/$build_index">$category_clean</A>\n|;
$link_results .= $link_output{$category};
}
$title_linked = &build_linked_title ("Picks");
open (PICK, ">$build_pick_path/$build_index") or cgierr ("unable to open editor's picks page: $build_pick_path/$build_index. Reason: $!");
print "\tEditor's Picks: $total\n";
print PICK &site_html_pick(@pick_links);
close PICK;
}

12. This one is optional. If you want an editor's pick image or something to say it's editor's pick in that links listing. just add something like this in the link.html template.
Quote:
<%if isPick%>
<img src="/images/pick.gif" width="35" height="14" align="absmiddle" alt="Editor's Pick">
<%endif%>

13. Now you can add a link to your editor's pick page in your templates. add something similar to this: <A HREF="<%build_pick_url%>Editor's Picks</A>

That's all folks.


[This message has been edited by hellraida (edited March 13, 1999).]

[This message has been edited by hellraida (edited March 14, 1999).]
Subject Author Views Date
Thread A how to guide for building a list of Editor's Pick page hellraida 21082 Mar 13, 1999, 7:15 AM
Post Re: A how to guide for building a list of Editor's Pick page
Bobsie 20397 Mar 13, 1999, 10:30 AM
Post Re: A how to guide for building a list of Editor's Pick page
Bobsie 20393 Mar 13, 1999, 10:32 AM
Post Re: A how to guide for building a list of Editor's Pick page
socrates 20382 Mar 13, 1999, 10:36 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 20436 Mar 13, 1999, 11:21 AM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20399 Mar 13, 1999, 7:45 PM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 20406 Mar 14, 1999, 8:18 AM
Post Re: A how to guide for building a list of Editor's Pick page
Bobsie 20361 Mar 14, 1999, 2:01 PM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 20357 Mar 14, 1999, 5:08 PM
Post Re: A how to guide for building a list of Editor's Pick page
socrates 20412 Mar 14, 1999, 5:54 PM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20433 Mar 15, 1999, 2:31 PM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 20411 Mar 15, 1999, 6:59 PM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20385 Mar 15, 1999, 9:51 PM
Thread Re: A how to guide for building a list of Editor's Pick page
hellraida 20502 Mar 16, 1999, 10:38 AM
Post Re: A how to guide for building a list of Editor's Pick page
sdyson 17379 Sep 10, 2000, 11:11 AM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20475 Mar 16, 1999, 5:47 PM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20459 Mar 16, 1999, 6:30 PM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20371 Mar 18, 1999, 1:03 PM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20398 Mar 18, 1999, 1:04 PM
Post Re: A how to guide for building a list of Editor's Pick page
sitedex 20432 Mar 18, 1999, 3:58 PM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 20446 Mar 19, 1999, 3:13 AM
Post Re: A how to guide for building a list of Editor's Pick page
sitedex 20401 Mar 19, 1999, 6:01 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 20359 Mar 19, 1999, 6:18 AM
Post Re: A how to guide for building a list of Editor's Pick page
sitedex 20445 Mar 19, 1999, 7:27 AM
Post Re: A how to guide for building a list of Editor's Pick page
sitedex 20443 Mar 19, 1999, 7:33 AM
Post Re: A how to guide for building a list of Editor's Pick page
sitedex 20397 Mar 19, 1999, 8:02 AM
Thread Re: A how to guide for building a list of Editor's Pick page
maky 17140 Mar 30, 1999, 5:51 PM
Post Re: [maky] A how to guide for building a list of Editor's Pick page
rexxx 14688 Jan 18, 2002, 10:27 AM
Post Re: A how to guide for building a list of Editor's Pick page
crisco 17018 Mar 31, 1999, 12:21 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 16992 Mar 31, 1999, 2:53 AM
Post Re: A how to guide for building a list of Editor's Pick page
crisco 16990 Mar 31, 1999, 3:54 AM
Post Re: A how to guide for building a list of Editor's Pick page
maky 17071 Mar 31, 1999, 4:21 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 16989 Mar 31, 1999, 6:27 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 17020 Mar 31, 1999, 6:32 AM
Post Re: A how to guide for building a list of Editor's Pick page
maky 16997 Mar 31, 1999, 10:09 AM
Post Re: A how to guide for building a list of Editor's Pick page
Macro 17026 May 9, 1999, 3:35 AM
Post Re: A how to guide for building a list of Editor's Pick page
Craig A 17011 May 30, 1999, 5:39 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 17040 May 30, 1999, 10:43 AM
Post Re: A how to guide for building a list of Editor's Pick page
padders 16994 Aug 22, 1999, 9:51 PM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 17166 Aug 23, 1999, 10:04 AM
Post Re: A how to guide for building a list of Editor's Pick page
padders 17151 Aug 23, 1999, 10:25 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 17165 Aug 23, 1999, 10:49 AM
Post Re: A how to guide for building a list of Editor's Pick page
Eliot 17207 Aug 27, 1999, 1:20 PM
Post Re: A how to guide for building a list of Editor's Pick page
dingle 17127 Nov 13, 1999, 2:50 AM
Post Re: A how to guide for building a list of Editor's Pick page
Chaiyo 17071 Apr 6, 2000, 3:55 AM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 17191 Apr 6, 2000, 6:59 AM
Post Re: A how to guide for building a list of Editor's Pick page
zevsek 17131 Apr 13, 2000, 9:00 AM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 17196 Apr 13, 2000, 4:50 PM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 17150 Apr 14, 2000, 5:57 AM
Post Re: A how to guide for building a list of Editor's Pick page
zevsek 17168 Apr 14, 2000, 6:32 AM
Post Re: A how to guide for building a list of Editor's Pick page
zevsek 17028 Apr 14, 2000, 6:37 AM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 17079 Apr 14, 2000, 7:00 AM
Post Re: A how to guide for building a list of Editor's Pick page
zevsek 18734 Apr 14, 2000, 9:09 AM
Post Re: A how to guide for building a list of Editor's Pick page
zevsek 18654 Apr 16, 2000, 7:59 PM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 18673 Apr 16, 2000, 8:02 PM
Post Re: A how to guide for building a list of Editor's Pick page
Nomada 18658 Apr 21, 2000, 4:35 PM
Thread Re: A how to guide for building a list of Editor's Pick page
Stealth 18705 Apr 21, 2000, 6:00 PM
Thread Re: A how to guide for building a list of Editor's Pick page
pagla2000 16434 Jan 14, 2001, 3:04 AM
Thread Re: A how to guide for building a list of Editor's Pick page
Stealth 16462 Jan 14, 2001, 11:25 AM
Thread Re: A how to guide for building a list of Editor's Pick page
pagla2000 16417 Jan 14, 2001, 12:20 PM
Thread Re: A how to guide for building a list of Editor's Pick page
Stealth 16373 Jan 14, 2001, 12:32 PM
Thread Re: A how to guide for building a list of Editor's Pick page
pagla2000 16365 Jan 14, 2001, 6:10 PM
Thread Re: A how to guide for building a list of Editor's Pick page
Stealth 16370 Jan 14, 2001, 6:13 PM
Thread Re: A how to guide for building a list of Editor's Pick page
pagla2000 16364 Jan 14, 2001, 6:22 PM
Thread Re: A how to guide for building a list of Editor's Pick page
pagla2000 16402 Jan 14, 2001, 10:27 PM
Thread Re: A how to guide for building a list of Editor's Pick page
Stealth 16452 Jan 14, 2001, 10:30 PM
Thread Re: A how to guide for building a list of Editor's Pick page
aznaphrodite 15177 Jul 1, 2001, 12:39 PM
Thread Re: A how to guide for building a list of Editor's Pick page
Stealth 15120 Jul 1, 2001, 12:46 PM
Thread Re: A how to guide for building a list of Editor's Pick page
aznaphrodite 15179 Jul 1, 2001, 1:28 PM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 15059 Jul 1, 2001, 3:55 PM
Thread Re: A how to guide for building a list of Editor's Pick page
esm 15192 Jul 1, 2001, 9:17 PM
Post I can't get it right
diemonde 14708 Jan 14, 2002, 2:26 AM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 18676 Apr 21, 2000, 9:57 PM
Post Re: A how to guide for building a list of Editor's Pick page
Nomada 18681 Apr 22, 2000, 6:11 AM
Post Re: A how to guide for building a list of Editor's Pick page
Manuel 18117 Jun 25, 2000, 4:14 PM
Post Re: [hellraida] A how to guide for building a list of Editor's Pick page
rexxx 6889 Jan 18, 2002, 10:41 AM
Thread Re: [hellraida] A how to guide for building a list of Editor's Pick page
astrogirl 6792 Oct 15, 2002, 4:54 AM
Thread Re: [astrogirl] A how to guide for building a list of Editor's Pick page
esm 6803 Oct 15, 2002, 5:27 PM
Thread Re: [esm] A how to guide for building a list of Editor's Pick page
astrogirl 6815 Oct 15, 2002, 6:58 PM
Post Post deleted by Mythotical
Mythotical 6463 Oct 10, 2004, 3:35 PM
Thread Re: [astrogirl] A how to guide for building a list of Editor's Pick page
Mythotical 6532 Oct 10, 2004, 6:45 PM
Thread Re: [Mythotical] A how to guide for building a list of Editor's Pick page
PerlFlunkie 6519 Oct 11, 2004, 12:30 AM
Thread Re: [PerlFlunkie] A how to guide for building a list of Editor's Pick page
Mythotical 6502 Oct 11, 2004, 11:02 AM
Thread Re: [Mythotical] A how to guide for building a list of Editor's Pick page
PerlFlunkie 6501 Oct 11, 2004, 12:25 PM
Post Re: [PerlFlunkie] A how to guide for building a list of Editor's Pick page
Mythotical 6445 Oct 11, 2004, 3:28 PM