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 21114 Mar 13, 1999, 7:15 AM
Post Re: A how to guide for building a list of Editor's Pick page
Bobsie 20428 Mar 13, 1999, 10:30 AM
Post Re: A how to guide for building a list of Editor's Pick page
Bobsie 20424 Mar 13, 1999, 10:32 AM
Post Re: A how to guide for building a list of Editor's Pick page
socrates 20413 Mar 13, 1999, 10:36 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 20467 Mar 13, 1999, 11:21 AM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20430 Mar 13, 1999, 7:45 PM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 20437 Mar 14, 1999, 8:18 AM
Post Re: A how to guide for building a list of Editor's Pick page
Bobsie 20392 Mar 14, 1999, 2:01 PM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 20388 Mar 14, 1999, 5:08 PM
Post Re: A how to guide for building a list of Editor's Pick page
socrates 20443 Mar 14, 1999, 5:54 PM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20464 Mar 15, 1999, 2:31 PM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 20442 Mar 15, 1999, 6:59 PM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20416 Mar 15, 1999, 9:51 PM
Thread Re: A how to guide for building a list of Editor's Pick page
hellraida 20533 Mar 16, 1999, 10:38 AM
Post Re: A how to guide for building a list of Editor's Pick page
sdyson 17407 Sep 10, 2000, 11:11 AM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20506 Mar 16, 1999, 5:47 PM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20490 Mar 16, 1999, 6:30 PM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20402 Mar 18, 1999, 1:03 PM
Post Re: A how to guide for building a list of Editor's Pick page
WebKing 20429 Mar 18, 1999, 1:04 PM
Post Re: A how to guide for building a list of Editor's Pick page
sitedex 20463 Mar 18, 1999, 3:58 PM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 20477 Mar 19, 1999, 3:13 AM
Post Re: A how to guide for building a list of Editor's Pick page
sitedex 20432 Mar 19, 1999, 6:01 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 20390 Mar 19, 1999, 6:18 AM
Post Re: A how to guide for building a list of Editor's Pick page
sitedex 20476 Mar 19, 1999, 7:27 AM
Post Re: A how to guide for building a list of Editor's Pick page
sitedex 20474 Mar 19, 1999, 7:33 AM
Post Re: A how to guide for building a list of Editor's Pick page
sitedex 20428 Mar 19, 1999, 8:02 AM
Thread Re: A how to guide for building a list of Editor's Pick page
maky 17172 Mar 30, 1999, 5:51 PM
Post Re: [maky] A how to guide for building a list of Editor's Pick page
rexxx 14716 Jan 18, 2002, 10:27 AM
Post Re: A how to guide for building a list of Editor's Pick page
crisco 17050 Mar 31, 1999, 12:21 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 17024 Mar 31, 1999, 2:53 AM
Post Re: A how to guide for building a list of Editor's Pick page
crisco 17022 Mar 31, 1999, 3:54 AM
Post Re: A how to guide for building a list of Editor's Pick page
maky 17103 Mar 31, 1999, 4:21 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 17021 Mar 31, 1999, 6:27 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 17052 Mar 31, 1999, 6:32 AM
Post Re: A how to guide for building a list of Editor's Pick page
maky 17029 Mar 31, 1999, 10:09 AM
Post Re: A how to guide for building a list of Editor's Pick page
Macro 17058 May 9, 1999, 3:35 AM
Post Re: A how to guide for building a list of Editor's Pick page
Craig A 17043 May 30, 1999, 5:39 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 17072 May 30, 1999, 10:43 AM
Post Re: A how to guide for building a list of Editor's Pick page
padders 17026 Aug 22, 1999, 9:51 PM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 17198 Aug 23, 1999, 10:04 AM
Post Re: A how to guide for building a list of Editor's Pick page
padders 17183 Aug 23, 1999, 10:25 AM
Post Re: A how to guide for building a list of Editor's Pick page
hellraida 17197 Aug 23, 1999, 10:49 AM
Post Re: A how to guide for building a list of Editor's Pick page
Eliot 17239 Aug 27, 1999, 1:20 PM
Post Re: A how to guide for building a list of Editor's Pick page
dingle 17159 Nov 13, 1999, 2:50 AM
Post Re: A how to guide for building a list of Editor's Pick page
Chaiyo 17103 Apr 6, 2000, 3:55 AM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 17223 Apr 6, 2000, 6:59 AM
Post Re: A how to guide for building a list of Editor's Pick page
zevsek 17163 Apr 13, 2000, 9:00 AM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 17228 Apr 13, 2000, 4:50 PM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 17182 Apr 14, 2000, 5:57 AM
Post Re: A how to guide for building a list of Editor's Pick page
zevsek 17200 Apr 14, 2000, 6:32 AM
Post Re: A how to guide for building a list of Editor's Pick page
zevsek 17060 Apr 14, 2000, 6:37 AM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 17111 Apr 14, 2000, 7:00 AM
Post Re: A how to guide for building a list of Editor's Pick page
zevsek 18762 Apr 14, 2000, 9:09 AM
Post Re: A how to guide for building a list of Editor's Pick page
zevsek 18682 Apr 16, 2000, 7:59 PM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 18701 Apr 16, 2000, 8:02 PM
Post Re: A how to guide for building a list of Editor's Pick page
Nomada 18686 Apr 21, 2000, 4:35 PM
Thread Re: A how to guide for building a list of Editor's Pick page
Stealth 18733 Apr 21, 2000, 6:00 PM
Thread Re: A how to guide for building a list of Editor's Pick page
pagla2000 16462 Jan 14, 2001, 3:04 AM
Thread Re: A how to guide for building a list of Editor's Pick page
Stealth 16490 Jan 14, 2001, 11:25 AM
Thread Re: A how to guide for building a list of Editor's Pick page
pagla2000 16445 Jan 14, 2001, 12:20 PM
Thread Re: A how to guide for building a list of Editor's Pick page
Stealth 16401 Jan 14, 2001, 12:32 PM
Thread Re: A how to guide for building a list of Editor's Pick page
pagla2000 16393 Jan 14, 2001, 6:10 PM
Thread Re: A how to guide for building a list of Editor's Pick page
Stealth 16398 Jan 14, 2001, 6:13 PM
Thread Re: A how to guide for building a list of Editor's Pick page
pagla2000 16392 Jan 14, 2001, 6:22 PM
Thread Re: A how to guide for building a list of Editor's Pick page
pagla2000 16430 Jan 14, 2001, 10:27 PM
Thread Re: A how to guide for building a list of Editor's Pick page
Stealth 16480 Jan 14, 2001, 10:30 PM
Thread Re: A how to guide for building a list of Editor's Pick page
aznaphrodite 15205 Jul 1, 2001, 12:39 PM
Thread Re: A how to guide for building a list of Editor's Pick page
Stealth 15148 Jul 1, 2001, 12:46 PM
Thread Re: A how to guide for building a list of Editor's Pick page
aznaphrodite 15207 Jul 1, 2001, 1:28 PM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 15087 Jul 1, 2001, 3:55 PM
Thread Re: A how to guide for building a list of Editor's Pick page
esm 15220 Jul 1, 2001, 9:17 PM
Post I can't get it right
diemonde 14736 Jan 14, 2002, 2:26 AM
Post Re: A how to guide for building a list of Editor's Pick page
Stealth 18704 Apr 21, 2000, 9:57 PM
Post Re: A how to guide for building a list of Editor's Pick page
Nomada 18709 Apr 22, 2000, 6:11 AM
Post Re: A how to guide for building a list of Editor's Pick page
Manuel 18145 Jun 25, 2000, 4:14 PM
Post Re: [hellraida] A how to guide for building a list of Editor's Pick page
rexxx 6901 Jan 18, 2002, 10:41 AM
Thread Re: [hellraida] A how to guide for building a list of Editor's Pick page
astrogirl 6804 Oct 15, 2002, 4:54 AM
Thread Re: [astrogirl] A how to guide for building a list of Editor's Pick page
esm 6815 Oct 15, 2002, 5:27 PM
Thread Re: [esm] A how to guide for building a list of Editor's Pick page
astrogirl 6827 Oct 15, 2002, 6:58 PM
Post Post deleted by Mythotical
Mythotical 6475 Oct 10, 2004, 3:35 PM
Thread Re: [astrogirl] A how to guide for building a list of Editor's Pick page
Mythotical 6544 Oct 10, 2004, 6:45 PM
Thread Re: [Mythotical] A how to guide for building a list of Editor's Pick page
PerlFlunkie 6531 Oct 11, 2004, 12:30 AM
Thread Re: [PerlFlunkie] A how to guide for building a list of Editor's Pick page
Mythotical 6514 Oct 11, 2004, 11:02 AM
Thread Re: [Mythotical] A how to guide for building a list of Editor's Pick page
PerlFlunkie 6513 Oct 11, 2004, 12:25 PM
Post Re: [PerlFlunkie] A how to guide for building a list of Editor's Pick page
Mythotical 6457 Oct 11, 2004, 3:28 PM