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).]
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
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
i have the same problem as sitex,
pick is not added.. and i have those codes
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");

the $db_ispick value in links.def is identical to push (@{$pick_links{$category}}, @values) if
($values[$db_ispick] eq "Yes");

it won't work for me?
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
hellraida,

This is great! I just added it and everything went smooth!

One thing that I didn't think I saw you mention was that if you are adding this to an existing database you need to add the new field into the database.

Thanks for the great mod.

crisco
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
maky,
sitedex doesn't have a problem anymore. everything that should make this mod work is in this thread.


crisco,
Quote:
One thing that I didn't think I saw you mention was that if you are adding this to an existing database you need to add the new field into the database.

the first steps were all about adding a new field...that's the only way it would work is to add a new field.

bye for now
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
hellraida,

I meant in the actual links.db file.

If you have an existing links.db file and make changes to links.def that add's a new field (in steps 1 and 2 of your how-to), and don't touch your links.db file, then load up your admin screen and check your links you'll see that they get all staggared.

That is, the first record will be all right, except for the last field, is pick, which would have the ID number in it (? maybe) of the nest record, etc, so that nothing lines up at all once you get down a few records?

Maybe, I don't know. I added the ispick field right after ispop, then adjusted my links.db by adding the new field with a default "No" in it throughout the db.

( did this with a script from bobsie, see http://www.gossamer-threads.com/...um3/HTML/001090.html )

When I loaded up the admin everything was set and everything was set to "No" in the ispick field.

Again I think this *might* only be a problem with existing databases. Not sure though.

But again, everything worked great for me when I made the adjustment to my links.db file. I didn't even try it without doing the adjustment.

crisco

Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
i duno why i get
Unkown Tag: build_pick_url
error
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
add this
Quote:
%rec,

before %globals

in the site_html_pick routine
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
crisco,

i understand what you mean now
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
ok i got it to work now, but another problem comes out after i added the mod.. I cannot add sites using IE, after i fill out the forms for adding, it just refresh the window and the data is not added, however netscape works but takes a long time tho, i am not sure if it's this mod cause it like that? it just occurs after i added the mod.. any ideas?
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
now...what a simple mind like myself would like, is if someone would be so kind to summarise what changed or what didn't by posting a new *full* step-by-step on this.

Perhaps I'm too lazy :-), but I feel more comfortable when it's tested, stepped and working.

I appreciate the efforts to make links and mods very highly btw, and I am thankful for whatever help I get. Keep up the good work.
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
Great mod, but how do I alter it to sort the links by something other than category ? Say date or title order ?

Anyone ?

------------------
Craig Antill
10 Tenths Motorsport (1.1) - www.Ten-Tenths.com/links/
THE Directory (2.0b3) - www.gardenbuildings.com/
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
sorry no info for you on that one.

Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
I might be being silly here but did bobsie's first question ever get answered:

what is it you add to %db_def? You don't show anything.

and also the 2nd question:

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?


sorry if these have been answered but i am unsure what to do. Thanks for any help





------------------
-------------------------
http://www.freeontheweb.com/
Reviewed and rated resources for webmasters
-------------------------
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
everything to make it work is in my original post (any spelling errors or incorrect use of words were edited in that original post), ignore bobsie's post because i corrected it after he pointed it out w/ the following.
Quote:
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

and yes you do need the yes | no option.
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
I thought i was being silly.... thank you veru much for clearing that up for me.. it looks like a great mod.


------------------
-------------------------
http://www.freeontheweb.com/
Reviewed and rated resources for webmasters
-------------------------
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
no problemo
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
I was wondering if this great mod can be further modified to reflect a similar build as "What's New". I intend on using this mod for a "Site of the Month" Award. I would like to create spanning pages based on an additional variable,"AwardDate", which is NOT autogenerated via the &get_date routine.
This variable is manually inputted.

I was just wondering if an adjustment could be made to this mod to create spanning pages based on this added variable.

Thanks in advance.

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
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
Hello,

I`m very new here!!!! I love this board! You all have it together!!!!!
I have gotten links running with no problem! But I tried to modify it a little by adding the above mod! What I have ran into is and error after I build!CGI ERROR
==========================================
Error Message : fatal error: Undefined subroutine &main::site_html_pick called at /data1/hypermart.net/pocketlint/cgi-bin/links/admin/nph-build.cgi line 1057.

==========================================

I went to line 1057 and it is the following.

==========================================
print PICK &site_html_pick(@pick_links);

==========================================

What am i missing? I followed the Instuctions to the " T " . ( well I thnk I did! ) If any one could help it would really be appricated!!!!!!




------------------
Thanks
Dingle
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
How to make span page.
Thanks for advance
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
I asked this question awhile back (if you look at the Eliot Reply) and no answer has been presented.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
How can I change the script to select 'No' in isPick section when validating new links? Everithyng works well but this...

I have upgraded the links.db file with new field (I have added at the end of every record a '|No').
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
 
Code:
isPick => 'No'

in your %add_system_fields hash.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
It should...try adding a link again.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
I am sorry...when I try to add a new link (nr. 1242, for example), I have the following in the validating form:

<tr>
<td align=right valign=top width=20%><font face="verdana,arial,helvetica" size="2">Votes:</font></td>
<td width=80%><input type=text name="Votes-1242" value="0" size="10" maxlength="10"></td>
</tr>
<tr>
<td align=right valign=top width=20%>
<font face="verdana,arial,helvetica" size="2">ReceiveMail:</font></td>
<td width=80%><SELECT NAME="ReceiveMail-1242" SIZE=1><OPTION>---<OPTION SELECTED>Yes
<OPTION>No</SELECT></td>
</tr>
<tr>
<td align=right valign=top width=20%><font face="verdana,arial,helvetica" size="2">isPick:</font></td>
<td width=80%><SELECT NAME="isPick-1242" SIZE=1><OPTION>---<OPTION>Yes<OPTION>No</SELECT></td>
</tr>

In the isPick field the only thing which is "selected" is the option "---".
Everithyng else works well...and I am going to be crazy because of this error.

Maybe I can help you with this data:
After validating the new record, I have in my validate.db the following:

1242|Aba|http://www.com|14-aprila-2000|Domace_strani/Osebne|sksk|jsdjd|hfhf@gg.com|0|No|No|0|0|Yes|

But after validating this record (and after selecting "Yes" or "No" in the isPick section), the record becomes "larger", with the following outlook:

1242|Aba|http://www.com|14-aprila-2000|Domace_strani/Osebne|sksk|jsdjd|hfhf@gg.com|0|No|No|0|0|Yes|No

Any suggestion?

Thanks in advance,

zevsek
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
Ahm...before and after validating a new record....sorry my english...:\

Before validating (in validate.db):
1242|Aba|http://www.com|14-aprila-2000|Domace_strani/Osebne|sksk|jsdjd|hfhf@gg.com|0|No|No|0|0|Yes|

After validating (in links.db):
1242|Aba|http://www.com|14-aprila-2000|Domace_strani/Osebne|sksk|jsdjd|hfhf@gg.com|0|No|No|0|0|Yes|No

Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
You also have to add hidden fields in your add forms in the add.html and add_failure.html files:

Code:
<input type="hidden" name="isPick" value="No">

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
In my links.cfg I have this situation:

# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 40, 150, 1, 'http://', '^http|news|mailto|ftp'],
Date => [3, 'date', 17, 17, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
Description => [5, 'alpha', '40x3', 500, 0, '', ''],
'Contact Name' => [6, 'alpha', 40, 75, 1, '', ''],
'Contact Email' => [7, 'alpha', 40, 75, 1, '', '.+@.+\..+'],
Hits => [8, 'numer', 10, 10, 1, '0', '\d+'],
isNew => [9, 'alpha', 0, 5, 0, 'No', ''],
isPopular => [10, 'alpha', 0, 5, 0, 'No', ''],
Rating => [11, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [12, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [13, 'alpha', 10, 10, 1, 'Yes', 'No|Yes'],
isPick => [14, 'alpha', 0, 5, 0, 'No', 'No|Yes']
);

# Field Number of some important fields. The number is from %db_def above
# where the first field equals 0.
$db_category = 4; $db_modified = 3; $db_url = 2;
$db_hits = 8; $db_isnew = 9; $db_ispop = 10;
$db_contact_name = 6; $db_contact_email = 7; $db_title = 1;
$db_votes = 12; $db_rating = 11; $db_mail = 13;
$db_ispick = 14;

%add_system_fields = (
isNew => 'No',
isPopular => 'No',
Hits => '0',
Rating => 0,
Votes => 0,
ReceiveMail => 'Yes',
isPick => 'No'
);


%db_select_fields = (
isNew => 'Yes,No',
isPopular => 'Yes,No',
ReceiveMail => 'Yes,No',
isPick => 'Yes,No'
);

But it still do not work. What's wrong?
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
It works! Thanks, Eliot!
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
You're welcome.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
Have I installed the mod and doesn't one eat to make it work. What should I make to transform it into Site of the Month? Why in nph_build.pl appears:

Code:
Building Site Publishing of Pick. . .
Editor's Picks: 0

Thank you in advance.

Carlos
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
You have to choose "Yes" for a site that you want to be the Site of the Month.

And another adaption to this Mod you will have to make is add another field called 'Award Date'. This field should look like the following:

Code:
'Award Date' => [18, 'alpha', 30, 30, 0, '', '']

Change 18 so that this is the last field number in your %db_def section of your links.def file. Also follow the instructions for adding a field to your links.def and existing links.db files in the FAQ in the Resource Center.

Then fill in a Date, like April 2000 in the admin.cgi file for the Site you are choosing to be the Site of the Month.

Then in the pick.html template file, add the following tag:

Code:
<%Award Date%>

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
As I mentioned to you before...this is an ADMINISTRATOR Mod that allows the SITE ADMINISTRATOR to select the site of the Month award! I mentioned this twice before. Why don't you read my Replies carefully!??!?

*sigh*

I believe the step you are missing is adding the following codes in your site_html_link sub-routine in the site_html_templates.pl file:

Code:
($rec{'isPick'} eq 'Yes') ? ($rec{'isPick'} = 1) : (delete $rec{'isPick'});

Double check the insructions posted in the first Posting in this Topic.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
I have put YES and when I go to the page of the Editor Pick that web appears...

But the problem is that I don't understand like it should work. In the first place I don't understand so that the Editor Pick Mod utility, but neither I understand like I can transform it into a mod of Site of the Month, so that people vote like in Antrotech.com
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
Hi,
I installed this mod but for an unknown reason I'm receiving this error message when trying to build the pages:


Cannot find server or DNS Error

The path to nph-build is ok. Other administrative functions seem to work ok also , but this message puzzles me.

Any ideas as to what I should look at?

Manuel

Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
Thanks very much for this amazing mod, especially for giving instructions for non-template users. This is a very valuable mod so you should consider compiling it into a nicely written mod.

Simon Dyson

Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
 
Hi Eliot,

Sorry for bringing up this old thread.

I did exactly what you said but no Award Date is showing. What is wrong?

In links.def I have

'Award Date' => [20, 'alpha', 30, 30, 0, '', '']


and


$db_award_date = 20;

In site_html_templates.pl I have


sub site_html_pick {
# --------------------------------------------------------
# This routine will build a editor's pick page.
return &load_template ('pick.html', {
total => $total,
grand_total => $grand_total,
link_results => $link_results,
title_linked => $title_linked,

award_date => $award_date,

%globals
} );
}



In pick.html I have


<%total%>

<%Award Date%>

<%link_results%>


Could you tell me what am I missing?

Thank you.


Regards,
Pagla


Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
Uh, that is because you DID NOT DEFINE the $award_date in your site_html_pick routine.

And also, you need to use <%award_date%> NOT <%AwardDate%>[/b] in the pick.html template file.

RE - READ MY EARLIER SUGGESTIONS!

Regards,

Eliot Lee
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
 
Thanks for replying.
In Reply To:
Uh, that is because you DID NOT DEFINE the $award_date in your site_html_pick routine.
What did you mean by that?


Regards,
Pagla

Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
If you search for award_date, you will find what I mean. Wink

Regards,

Eliot Lee
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
I think you are talking about the folowing thread

http://


I tried that but still no date is showing.


Regards,
Pagla


Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
Well...I would recommend removing the award_date => $award_date in the sub.

And then simply use <%AwardDate%>. And make sure that you actually have dates in the AwardDate field. If not, then of course, the value will not appear. And the AwardDate field should be in the SAME format as the Date field.

Regards,

Eliot Lee
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
In Reply To:
And the AwardDate field should be in the SAME format as the Date field.
Something like this?


AwardDate => [20, 'date', 15, 15, 1, \&get_date, '']



Thanks.


Regards,
Pagla

Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
 

Do I have to define anything in nph-build.cgi?


Regards,
Pagla

Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
NO...other than adding the subroutine that builds the "award" or "editor pick" page. AGAIN...please refer to the MOD instructions and bug fixes ALREADY posted in this forum.

Regards,

Eliot Lee
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
Hi. I'm having problems with installing this mod into an existing database. Everything seems to work fine in regards to the Picks but now the script marks EVERY site as "new" and "pop" in the listings, even though in the admin both are set to "No". My site is here:

http://www.moonprincess.com/senshi

Any suggestions on what I did wrong? I have carefully read all three pages of this thread and made corrections accordingly so I can't think of what could be wrong.

Thanks!
Rebecca

Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
1) You need to UPDATE your existing database file (links.db). Search this forum for upgrade.pl.

2) You also need to RE-NUMBER the IMPORTANT FIELDS section in the links.def (as mentioned in this thread and other Threads in this forum).

3) You also need to make sure that you have followed ALL the instructions in this Thread...and applied the bug fixes.

Bye...

Regards,

Eliot Lee
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
I have already manually editted my existing database (links.db). I have also numbered my new field 14 on links.def (when I number it 16, it doesn't work).

Any other suggestions?

Thanks!
Rebecca

Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
Did you ALSO re-number ALL the other IMPORTANT FIELDS??? (in the links.def).

Also, manually updating your links.db leads to corruption and is NOT recommended!

Regards,

Eliot Lee
Quote Reply
Re: A how to guide for building a list of Editor's Pick page In reply to
Didn't follow this thread but you might want to check the following

http://gossamer-threads.com/...ew=&sb=&vc=1

Gene
Quote Reply
I can't get it right In reply to
Hi,

hope someone is still readin this one :-)

I can't find the firest thing (use var...) that's needed to replace. Where is it located? I searched in all the files but it can't find any part of the string nowhere.

Please help, thnx,

DieMonde
Quote Reply
Re: [maky] A how to guide for building a list of Editor's Pick page In reply to
PirateI just don't understand! Is there a full detail information on the Editor's Pick List. The post I look at just jump all over and don't tell you everything. Please help
rexxx webmaster
Quote Reply
Re: [hellraida] A how to guide for building a list of Editor's Pick page In reply to
FrownAre you sure that this goes in this file???? It doen't follow the layout of the page. Please help!
rexxx webmaster
Quote Reply
Re: [hellraida] A how to guide for building a list of Editor's Pick page In reply to
Hi

Just a little confused... is this mod still current? The instructions say for step 1, to add some code in the links.cfg.. but I get the impression I should be replacing it. However, this code does not appear in my links.cfg.. is this the correct file to edit?

Also, the instructions skip from step 1, to step 7. Are there steps missing? or are steps 2-6 no longer necessary?

tia
Astrogirl <~~ confused
Quote Reply
Re: [astrogirl] A how to guide for building a list of Editor's Pick page In reply to
check out th efollowing

http://www.gossamer-threads.com/...g=editor%27s;#140567


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] A how to guide for building a list of Editor's Pick page In reply to
thanks! just tried it and it works great. Smile
Post deleted by Mythotical In reply to
Quote Reply
Re: [astrogirl] A how to guide for building a list of Editor's Pick page In reply to
Ok I have done everything right down to the last fix.

I go to Build All to update everything and it won't build, it says Page cannot be displayed. Cannot find server or DNS error. The rest of the admin area works just find, just Build All, Staggered, Staggered Auto don't work.

here is the link to my nph-build file, I might have entered something wrong.

http://www.worldwiderpg.com/nph-build.txt

Any help much appreciated. Everything as far as I can tell works. Yes you will notice pick_links and pc_links, I am adding my own Picks page.

Thanks in advance
Steve

Last edited by:

Mythotical: Oct 10, 2004, 7:10 PM
Quote Reply
Re: [Mythotical] A how to guide for building a list of Editor's Pick page In reply to
Look at the build-staggered routine, note the typos:

$t1 = time();
print "** Creating Reviewer's Pick Pages...\n";
&build_pick_page
pring "** Done (", time - $t1, " s)!\n\n";

$t1 = time();
print "** Creating People's Choice Pages...\n";
&build_pc_page
pring "** Done (", time - $t1, " s)!\n\n";


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] A how to guide for building a list of Editor's Pick page In reply to
Thanks alot, that got it, didn't think it would be a spelling error. LOL

Now I get this error:
Code:

CGI ERROR ==========================================
Error Message : fatal error: Undefined subroutine &main::site_html_pc called at
nph-build.cgi line 1103.
Script Location : nph-build.cgi
Perl Version : 5.008


This is what I have on line 1103:
Code:

print PC &site_html_pc(@pc_links);


Any help with that would be great. I am currently trying to fix it but if not, I will still post it here just in case.

Steve

Last edited by:

Mythotical: Oct 11, 2004, 11:04 AM
Quote Reply
Re: [Mythotical] A how to guide for building a list of Editor's Pick page In reply to
Do you have a routine in either site_html.pl or site_html_templates.pl for the pc page, like the one you must have made for the pick page? The error says there is not such a routine. Make sure you used the same spelling and capitalization...

&site_html_pc

sub site_html_pc


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] A how to guide for building a list of Editor's Pick page In reply to
Thanks, found the problem. It was spaced wrong for my sub site_html_pc, I had it just spaced wrong, I took out spaces and it worked perfect. Thanks, now I just gotta add the review mod so it will work with my PC Category.

If you have suggestions for getting that to work, please do tell.

Thanks again
Steve