Gossamer Forum
Home : Products : Links 2.0 : Customization :

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

(Page 1 of 4)
> >
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).]
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
Oops, see next message.

[This message has been edited by Bobsie (edited March 13, 1999).]
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
 
Quote:
1. Add this to links.cfg

quote:

# Database Definition: LINKS
# --------------------------------------------------------
# Definition of your database file.
%db_def = (

Shouldn't that be links.def? And, what is it you add to %db_def? You don't show anything.
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
Bobsie,

You are right. Also, it is necessary to create an 'yes,no' option, in order to select the editor's picks in the admin - right?
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
Thanks for pointing that out..i didn't leave it out in the message composition..it was because i incorrectly used ubb code and that part didn't show up that was supposed to be in the links.cfg and the links.def sections (steps 1 and 2) repsectively. I did forget the instructions about the yes or no field though..thanks to both of you for pointing those out to me.

bye for now.

[This message has been edited by hellraida (edited March 13, 1999).]
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
This One Is Really Confused Me... Is ther anyone Please REPHRASE and give FULL Explanation STEP by STEP on this ONE..

Thanks MILLIONSSSSSSSSSSSSSSS

------------------
WebKing
WebKing@trisoft.net
http://www.trisoft.net
My ICQ # 25356171
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
what don't u understand?
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
I think, based on what I have seen in other messages, WebKing is trying to apply modificationz for Links v2 into Links v1. This brings up a good point. When posting mods, it should be clearly stated, right at the top, which version of Links the mod is for. Avoids a lot of confusion for both the poster of the mod and the people trying to apply it.
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
 
Quote:
3. Open site_html_templates.pl

I would think that step 3 would automatically rule out site_html.pl. I even use the word template in step 5. i guess i will say 2.0 from now on.

Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
Bobsie said,
====
When posting mods, it should be clearly stated, right at the top, which version of Links the mod is for.
====

Thanks for bringing that up again, Bobsie. I have already suggested once before and so have a few other people, that now that the full version of Links2.0 is available, I believe that there should be a seperate forum for 2.0 mod discusslions.
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
V 2.0
========================

I m using Site_template.pl
NOT Site_html_template.pl


Please State VERY Cleary?.. about which part should be modified, like BOB did about Security Part!... Copy the whole part that should be modified and copy the New part which is inserted in that part..

Thanks!

------------------
WebKing
WebKing@trisoft.net
http://www.trisoft.net
My ICQ # 25356171
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
hopefully someone who is using site_html.pl can help you out..i don't think it would be that hard...it's getting kinda late for me right now..i will attempt a site_html.pl version for you probably tomorrow.

bye for now

[This message has been edited by hellraida (edited March 15, 1999).]
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
It would be EXTREMELY HELPFUL if you help me how to Modify into Editor Picks... Page.

I would appreciate Very MUCH from you!

Thank You In Advance!


------------------
WebKing
WebKing@trisoft.net
http://www.trisoft.net
My ICQ # 25356171
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
Ok
add this in site_html.pl (you can edit it to fit your layout it doesn't have to stay this way):

Quote:
sub site_html_pick {
# --------------------------------------------------------
# This routine will build a what's new page. You can use the following
# variables
#
# $time : The current time.
# $date : The current date.
# $total : The total number of new links.
# $grand_total : The total number of links.
# $link_results : The list of cool links.
#

# Your Title and Header.
$output = qq~
<html>

<head>
<title>$site_title: Editor's Picks</title>
<style type="text/css">

</style>

</head>

<$site_body>

<center>
<table border="0" width="600">
<tr><td valign="top">
<P><hr size=1 width=600>
<$font_subtitle><strong>$site_title: Editor's Picks</strong></font><BR>
<$font><strong>$title_linked</strong></font><BR>
<hr size=1 width=600>
$site_menu
<hr size=1 width=600>
<center>
<table border=0 bgcolor="#66ccff" width="80%">
<tr><td>
<$font_subtitle><strong><center>$total Picks:</center></strong></font>

<$font_category>$link_results</font>
</table>
</center>
$site_footer
</td></tr>
</table>
</center>
</body>
</html>
~;

return $output;
}


instead of step 13 for template users..u can add something like this at the top of site_html.pl in the $site_menu definition:
Quote:
<A HREF="$build_pick_url">Picks</A>

If u are not using templates u only need to do the following steps from my original instructions..to go along w/ this bit here.
steps:
1,2,6,7,8,9,10,11

I also e-mailed you a copy of my build script. cause it seems like you don't get the steps about editing nph-build.cgi if anyone else has a problem editing it and want a copy e-mail me.

bye for now.

[This message has been edited by hellraida (edited March 16, 1999).]
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
I wanna to Add Image using Site_Html.pl

I DONT USE Templates

Tell me please!

Thanks

------------------
WebKing
WebKing@trisoft.net
http://www.trisoft.net
My ICQ # 25356171
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
hellraida:

After I modified and Worked so well

http://www.trisoft.net/cgi-bin/yahoo/

Just a temporary name Yahoo Dir. So I wont get mix up w/ other Dir. Later will move to another Mechine...

uhmm ONE MORE THING!

After I modified, Why My TEXT are BOLDed??

It wasn't before.. Try to click on one of the Category... then you ll see on your TOP RIGHT Corner.. "Add URL" "Modify URL" " Check Mail" are NOT BOLD

Why Others are BOLD?

Thanks



------------------
WebKing
WebKing@trisoft.net
http://www.trisoft.net
My ICQ # 25356171
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
I have finised editing to make EDITOR's PICKS page. But when I try to search some name and LINKS returned w/ the URLs ,BUT from the top list goes down to the end of the list results, ULRs and Description get Smaller and smaller. Also the results are CENTERED. Tell me what s the problem?

I prefer the OLD style of LINKS 1.11 because the word CATEGORY stays on the LEFT then categories listed in ordered AND the word LINKS is also stays on the left and URLs are listed i order from 1 to 10

Please HELP me to fix this problem..

THANKS FOR EVERYTHING!




------------------
WebKing
WebKing@trisoft.net
http://www.trisoft.net
My ICQ # 25356171
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
Try to sEARCH my site at:

http://www.trisoft.net/cgi-bin/yahoo

Thanks

------------------
WebKing
WebKing@trisoft.net
http://www.trisoft.net
My ICQ # 25356171
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
hellraida, Bobsie, Anyone
After I added a link with Editor's Pick, then I "Build All" I found there is no link generated.
-----------------------------------
Building Editor's Pick Page . . . Editor's Picks: 0
-----------------------------------
When check individual link, "Editor's Pick"'s image was fine and next to other images (new and pop) that I added. It works but cannot add link to the Pick.html page.

Any suggestions would be appreciated.
Thanks for your help,

Sitedex



[This message has been edited by sitedex (edited March 18, 1999).]
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
 
Quote:
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");

make sure you have that part..that's the part that adds the links that are selected as editor's pick to the page.

bye for now.
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
hellraida,
This code is already in nph-build.cgi
-----------------------------------------
# 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");
-----------------------------------------

quote:
"make sure you have that part..that's the part that adds the links that are selected as editor's pick to the page."

Please clarify, I don't understand.
Thanks for your help,

Sitedex



[This message has been edited by sitedex (edited March 19, 1999).]
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
make sure that in this section of links.def:
Quote:
# Field Number of some important fields. The number is from %db_def above
# where the first field equals 0.
that you have this : $db_ispick it has to be the same value as the ispick variable in:
Quote:
# 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");

bye for now


[This message has been edited by hellraida (edited March 19, 1999).]
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
  

[This message has been edited by sitedex (edited March 20, 1999).]
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
It works now!

Thanks so much

Sitedex

[This message has been edited by sitedex (edited March 19, 1999).]
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
Alex,
Please delete the above script (nph-build.cgi). I couldn't edit that file. Maybe it's too big. Sorry for the inconvience.

Thanks
Sitedex
> >