Gossamer Forum
Home : Products : Links 2.0 : Customization :

Editors pick v.2.0?

Quote Reply
Editors pick v.2.0?
There's this great new feature, detailed view, in the version 2.0. But wouldn't it be better if administrator could choose, which links would be detailed and which would not?

Then you could choose "hot sites" or something like that, which would have the detailed information submitted by the administrator (and/or visitors?).
Quote Reply
Re: Editors pick v.2.0? In reply to
What, like www.gardenbuildings.com/directory/Great_Britain/ for instance ?!

------------------
Craig Antill
10 Tenths Motorsport (1.1) - www.Ten-Tenths.com/links/
THE Directory (2.0b3) - www.gardenbuildings.com/
Quote Reply
Re: Editors pick v.2.0? In reply to
Craig, that's a nice feature you got there!
How did you do that?

John
Quote Reply
Re: Editors pick v.2.0? In reply to
 
Take a look at

http://216.169.107.32/scripts/forum/resources/Forum11/HTML/000011.html

Quote Reply
Re: Editors pick v.2.0? In reply to
Cool! Thanks.
John
Quote Reply
Re: Editors pick v.2.0? In reply to
Indeed.

Basically, you need to add a new field called Detailed which contains the word Yes, or No. Then make these changes:

In nph-build.cgi around line 465 in build_detailed_view add:

Quote:
%rec = &array_to_hash (0, @values);
next LINE unless ($rec{'Detailed'} eq 'Yes'); # Add me!

Then add this line to sub site_html_link in site_html.pl:

Quote:
if ($rec{'Detailed'} eq "Yes") { $output .= qq~ <a href="$build_detail_url/$rec{$db_key}$build_extension">Detailed Description Of Link</a> - ~; }

Hope this helps.

------------------
Craig Antill
10 Tenths Motorsport (1.1) - www.Ten-Tenths.com/links/
THE Directory (2.0b3) - www.gardenbuildings.com/
Quote Reply
Re: Editors pick v.2.0? In reply to
Hey guys,

I was playing around with this mod and have decided I was going to use the templates. So instead if using site_html.pl, Ill be using the template one. Does anyone know how that code should look.

Here's the script for the link detail.

##########################
sub site_html_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like.

my %rec = @_;

# Set new and pop to either 1 or 0 for templates.
($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});

return &load_template ('link.html', {
detailed_url => "$db_detailed_url/$rec{'ID'}$build_extension",
%rec,
%globals
});
}
###########################

IF anyone knows it would be apreciated.

Mike



Quote Reply
Re: Editors pick v.2.0? In reply to
Hey guys,

After looking at ALL The templates there are I decided to go back and use the trusty SITE HTML.pl.

I went to add the line to the build_detailed_view sub, and that sub using my NOTETAB PRO isnt until line 674.

I'n not exactly sure where to put the

%rec = &array_to_hash (0, @values);
next LINE unless ($rec{'Detailed'} eq 'Yes'); # Add me!

If you could maybe tell me between which lines to insert it. I've got everything else good to go, just need that one part.

Thanks again
Mike
Quote Reply
Re: Editors pick v.2.0? In reply to
Code:
sub build_detailed_view {
# --------------------------------------------------------
# This routine build a single page for every link.
#
my (@values, $id, %rec, $count);
if ($build_detail_path =~ m,^$build_root_path/(.*)$,) {
&build_dir ($1);
}
print "\t";
open (DB, "<$db_file_name") or &cgierr("unable to open database: $db_file_name. Reason: $!");
LINE: while (<DB> ) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp;
@values = &split_decode ($_);
$id = $values[$db_key_pos];
%rec = &array_to_hash (0, @values); next LINE unless ($rec{'Detailed'} eq 'Yes'); # Add me!
$title_linked = &build_linked_title ("$rec{'Category'}/$rec{'Title'}");
open (DETAIL, ">$build_detail_path/$id$build_extension") or &cgierr ("Unable to build detail page: $build_detail_path/$id$build_extension. Reason: $!");
print DETAIL &site_html_detailed (%rec);
close DETAIL;
$use_html ?
print qq~<a href="$build_detail_url/$id$build_extension">$id</a> ~ :
print qq~$id ~;
(++$count % 10) or print "\n\t";
}
close DB;
print "\n";
}

HTH

------------------
Craig Antill
10 Tenths Motorsport (1.1) - www.Ten-Tenths.com/links/
THE Directory (2.0b3) - www.gardenbuildings.com/


[This message has been edited by Craig Antill (edited February 16, 1999).]
Quote Reply
Re: Editors pick v.2.0? In reply to
Craig,

...and I thank you.

Mike
Quote Reply
Re: Editors pick v.2.0? In reply to
A million thanks to Graig and all the others too!

I succeeded installing my own version of this "Editors pick"! Now I'm eager to know, how could it be done to build a page, which would list all the "Full Member" links?

I took a look at the nph-build and the site_html, but it didn't open to me. I thought it could be done pretty easily by copying and modifying the parts of "build_new" or "build_popular" -codes, but I think they're more complex than is needed to this "Full Member" linklist.

[This message has been edited by Stigma (edited February 16, 1999).]