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 20986 Mar 13, 1999, 7:15 AM
Post Re: A how to guide for building a list of Editor's Pick page
Bobsie 20302 Mar 13, 1999, 10:30 AM
Post Re: A how to guide for building a list of Editor's Pick page
Bobsie 20298 Mar 13, 1999, 10:32 AM
Post Re: A how to guide for building a list of Editor's Pick page
socrates 20287 Mar 13, 1999, 10:36 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 20341 Mar 13, 1999, 11:21 AM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20304 Mar 13, 1999, 7:45 PM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 20311 Mar 14, 1999, 8:18 AM
Post Re: A how to guide for building a list of Editor's Pick page
Bobsie 20266 Mar 14, 1999, 2:01 PM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 20262 Mar 14, 1999, 5:08 PM
Post Re: A how to guide for building a list of Editor's Pick page
socrates 20317 Mar 14, 1999, 5:54 PM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20338 Mar 15, 1999, 2:31 PM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 20316 Mar 15, 1999, 6:59 PM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20290 Mar 15, 1999, 9:51 PM
Thread Re: A how to guide for building a list of Editor's Pick page
hellraida 20407 Mar 16, 1999, 10:38 AM
Post Re: A how to guide for building a list of Editor's Pick page
sdyson 17296 Sep 10, 2000, 11:11 AM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20380 Mar 16, 1999, 5:47 PM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20364 Mar 16, 1999, 6:30 PM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20276 Mar 18, 1999, 1:03 PM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20303 Mar 18, 1999, 1:04 PM
Post Re: A how to guide for building a list of Editor's Pick page
sitedex 20337 Mar 18, 1999, 3:58 PM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 20351 Mar 19, 1999, 3:13 AM
Post Re: A how to guide for building a list of Editor's Pick page
sitedex 20306 Mar 19, 1999, 6:01 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 20264 Mar 19, 1999, 6:18 AM
Post Re: A how to guide for building a list of Editor's Pick page
sitedex 20350 Mar 19, 1999, 7:27 AM
Post Re: A how to guide for building a list of Editor's Pick page
sitedex 20348 Mar 19, 1999, 7:33 AM
Post Re: A how to guide for building a list of Editor's Pick page
sitedex 20302 Mar 19, 1999, 8:02 AM
Thread Re: A how to guide for building a list of Editor's Pick page
maky 17052 Mar 30, 1999, 5:51 PM
Post Re: [maky] A how to guide for building a list of Editor's Pick page
rexxx 14605 Jan 18, 2002, 10:27 AM
Post Re: A how to guide for building a list of Editor's Pick page
crisco 16930 Mar 31, 1999, 12:21 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 16904 Mar 31, 1999, 2:53 AM
Post Re: A how to guide for building a list of Editor's Pick page
crisco 16902 Mar 31, 1999, 3:54 AM
Post Re: A how to guide for building a list of Editor's Pick page
maky 16983 Mar 31, 1999, 4:21 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 16901 Mar 31, 1999, 6:27 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 16932 Mar 31, 1999, 6:32 AM
Post Re: A how to guide for building a list of Editor's Pick page
maky 16909 Mar 31, 1999, 10:09 AM
Post Re: A how to guide for building a list of Editor's Pick page
Macro 16938 May 9, 1999, 3:35 AM
Post Re: A how to guide for building a list of Editor's Pick page
Craig A 16923 May 30, 1999, 5:39 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 16952 May 30, 1999, 10:43 AM
Post Re: A how to guide for building a list of Editor's Pick page
padders 16906 Aug 22, 1999, 9:51 PM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 17078 Aug 23, 1999, 10:04 AM
Post Re: A how to guide for building a list of Editor's Pick page
padders 17063 Aug 23, 1999, 10:25 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 17077 Aug 23, 1999, 10:49 AM
Post Re: A how to guide for building a list of Editor's Pick page
Eliot 17119 Aug 27, 1999, 1:20 PM
Post Re: A how to guide for building a list of Editor's Pick page
dingle 17039 Nov 13, 1999, 2:50 AM
Post Re: A how to guide for building a list of Editor's Pick page
Chaiyo 16983 Apr 6, 2000, 3:55 AM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 17103 Apr 6, 2000, 6:59 AM
Post Re: A how to guide for building a list of Editor's Pick page
zevsek 17043 Apr 13, 2000, 9:00 AM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 17108 Apr 13, 2000, 4:50 PM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 17062 Apr 14, 2000, 5:57 AM
Post Re: A how to guide for building a list of Editor's Pick page
zevsek 17080 Apr 14, 2000, 6:32 AM
Post Re: A how to guide for building a list of Editor's Pick page
zevsek 16940 Apr 14, 2000, 6:37 AM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 16991 Apr 14, 2000, 7:00 AM
Post Re: A how to guide for building a list of Editor's Pick page
zevsek 18651 Apr 14, 2000, 9:09 AM
Post Re: A how to guide for building a list of Editor's Pick page
zevsek 18571 Apr 16, 2000, 7:59 PM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 18590 Apr 16, 2000, 8:02 PM
Post Re: A how to guide for building a list of Editor's Pick page
Nomada 18575 Apr 21, 2000, 4:35 PM
Thread Re: A how to guide for building a list of Editor's Pick page
Stealth 18622 Apr 21, 2000, 6:00 PM
Thread Re: A how to guide for building a list of Editor's Pick page
pagla2000 16351 Jan 14, 2001, 3:04 AM
Thread Re: A how to guide for building a list of Editor's Pick page
Stealth 16379 Jan 14, 2001, 11:25 AM
Thread Re: A how to guide for building a list of Editor's Pick page
pagla2000 16334 Jan 14, 2001, 12:20 PM
Thread Re: A how to guide for building a list of Editor's Pick page
Stealth 16290 Jan 14, 2001, 12:32 PM
Thread Re: A how to guide for building a list of Editor's Pick page
pagla2000 16282 Jan 14, 2001, 6:10 PM
Thread Re: A how to guide for building a list of Editor's Pick page
Stealth 16287 Jan 14, 2001, 6:13 PM
Thread Re: A how to guide for building a list of Editor's Pick page
pagla2000 16281 Jan 14, 2001, 6:22 PM
Thread Re: A how to guide for building a list of Editor's Pick page
pagla2000 16319 Jan 14, 2001, 10:27 PM
Thread Re: A how to guide for building a list of Editor's Pick page
Stealth 16369 Jan 14, 2001, 10:30 PM
Thread Re: A how to guide for building a list of Editor's Pick page
aznaphrodite 15094 Jul 1, 2001, 12:39 PM
Thread Re: A how to guide for building a list of Editor's Pick page
Stealth 15037 Jul 1, 2001, 12:46 PM
Thread Re: A how to guide for building a list of Editor's Pick page
aznaphrodite 15096 Jul 1, 2001, 1:28 PM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 14976 Jul 1, 2001, 3:55 PM
Thread Re: A how to guide for building a list of Editor's Pick page
esm 15109 Jul 1, 2001, 9:17 PM
Post I can't get it right
diemonde 14625 Jan 14, 2002, 2:26 AM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 18593 Apr 21, 2000, 9:57 PM
Post Re: A how to guide for building a list of Editor's Pick page
Nomada 18598 Apr 22, 2000, 6:11 AM
Post Re: A how to guide for building a list of Editor's Pick page
Manuel 18034 Jun 25, 2000, 4:14 PM
Post Re: [hellraida] A how to guide for building a list of Editor's Pick page
rexxx 6843 Jan 18, 2002, 10:41 AM
Thread Re: [hellraida] A how to guide for building a list of Editor's Pick page
astrogirl 6746 Oct 15, 2002, 4:54 AM
Thread Re: [astrogirl] A how to guide for building a list of Editor's Pick page
esm 6757 Oct 15, 2002, 5:27 PM
Thread Re: [esm] A how to guide for building a list of Editor's Pick page
astrogirl 6769 Oct 15, 2002, 6:58 PM
Post Post deleted by Mythotical
Mythotical 6417 Oct 10, 2004, 3:35 PM
Thread Re: [astrogirl] A how to guide for building a list of Editor's Pick page
Mythotical 6486 Oct 10, 2004, 6:45 PM
Thread Re: [Mythotical] A how to guide for building a list of Editor's Pick page
PerlFlunkie 6473 Oct 11, 2004, 12:30 AM
Thread Re: [PerlFlunkie] A how to guide for building a list of Editor's Pick page
Mythotical 6456 Oct 11, 2004, 11:02 AM
Thread Re: [Mythotical] A how to guide for building a list of Editor's Pick page
PerlFlunkie 6455 Oct 11, 2004, 12:25 PM
Post Re: [PerlFlunkie] A how to guide for building a list of Editor's Pick page
Mythotical 6399 Oct 11, 2004, 3:28 PM