Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

Anyone, help!!!! YAHOO v2.1

Quote Reply
Anyone, help!!!! YAHOO v2.1
Frown I'm trying to add the SUBCATEGORIES LIKE YAHOO v2.1on links 2.0 and have performed all the necessary modifications listed on the instructions, read all the threads on the forum and at this point I still cannot get them to work.

I believe I inserted all the code snipplets in the right places but when I build the pages all I see is this:

http://dream2reality.com/pages/

I'm sooooooo lost!!! what causes this and what I'm doing wrong here?????




Here are the snipplets I inserted into links 2.0: (please double check for me)

CATEGORIES.DEF

# -------------
# Links
# -------------
# Links Manager
#
# File: category.def
# Description: Contains the database definition for categories.
# Author: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 2.01
#
# (c) 1998 Gossamer Threads Inc.
#
# This script is not freeware! Please read the README for full details
# on registration and terms of use.
# =====================================================================

# Database Definition: CATEGORIES
# --------------------------------------------------------
# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Name => [1, 'alpha', 40, 75, 1, '', '^[\w\d/_-]+$'],
Description => [2, 'alpha', '40x3', 500, 0, '', ''],
Related => [3, 'alpha', 0, 255, 0, '', ''],
'Meta Description' => [4, 'alpha', 40, 75, 0, '', ''],
'Meta Keywords' => [5, 'alpha', 40, 75, 0, '', ''],
Header => [6, 'alpha', 40, 75, 0, '', ''],
Footer => [7, 'alpha', 40, 75, 0, '', ''],
SubCatStyle => [8, 'alpha' ,40, 100, 0, '(ALL)1', '']





site_html_templates.pl

# Print Header.
$output = qq|<div class="margin"><table width="80%" border="0" cellspacing="0" cellpadding="0"><tr><td class="catlist" valign="top">\n|;

foreach $subcat (sort @subcat) {
($description) = @{$category{$subcat}}[2];
($subcatstyle) = @{$category{$subcat}}[8];



NEXT CODE SNIPPLET:

# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<a class="catlist" href="$url">$description</a> <font class="catlist">($numlinks)</font> |;
$output .= qq|<small><sup class="new">new</sup></small>| if (&days_old($mod) < $db_new_cutoff);
$output .= qq|<BR>|;


if ($subcatstyle =~ m,^\(([^\)]+)\)(\d)$, && $#{$subcategories{$subcat}} >= 0) {
($subcatstyle, $style) = ($1, $2);
$s = 0;
@subcatsub = split (/\|/, $subcatstyle);
$output .= qq~&nbsp;&nbsp;&nbsp;&nbsp;~ if ($style eq "1");
foreach $category_name (@subcatsub) {
foreach (sort @{$subcategories{$subcat}}) {
($subcatstyle eq "ALL" && $#subcatsub == 0) ?
($_ =~ m,.*/([^/]+)$, and $category_name = &build_clean($1)) :
($_ eq "$subcat/$category_name" or next);
if ($style eq "1") {
$length += length($category_name);
($length > $subcat_length) and last;
}
if ($s > 0) {
$output .= qq~, ~ and $length += 2 if ($style eq "1");
$output .= qq~ ~ if ($style eq "2");
}
$url = "$build_root_url/" . &urlencode($_) . "/";
$output .= qq~<LI>~ if ($style eq "2");
$output .= qq~<a class="subcat" href="$url">$category_name</a>~;
$s++;
last if ($subcatstyle ne "ALL" && $#subcatsub > 0);
}
}
undef $length;
if ($s < $#{$subcategories{$subcat}}) {
$output .= qq~...~ if ($style eq "1");
}
$output .= qq~<BR>~;
}
else { }}


# Don't forget to end the table..
$output .= "</td></tr></table></div>\n";
return $output;
}


1;




links.cfg


# Site Title, the default title to use. You should really spend some time customizing
# the directory though!
$build_site_title = 'Links Portal Proj ';
# Subcategory Length, the maximum length of the subcategories added into Links.


$subcat_length = '30';




categories.db

Added a | to the end of each record in the database.




That's all...Please advise.

Thank you very much! Let me know if you need access the the site.

Last edited by:

Andy: Oct 16, 2003, 2:58 AM
Quote Reply
Re: [nova3470] Anyone, help!!!! YAHOO v2.1 In reply to
In Reply To:
Frown I'm trying to add the SUBCATEGORIES LIKE YAHOO v2.1on links 2.0 and have performed all the necessary modifications listed on the instructions, read all the threads on the forum and at this point I still cannot get them to work.

I believe I inserted all the code snipplets in the right places but when I build the pages all I see is this:

http://dream2reality.com/pages/

I'm sooooooo lost!!! what causes this and what I'm doing wrong here?????




Here are the snipplets I inserted into links 2.0: (please double check for me)

CATEGORIES.DEF

# -------------
# Links
# -------------
# Links Manager
#
# File: category.def
# Description: Contains the database definition for categories.
# Author: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 2.01
#
# (c) 1998 Gossamer Threads Inc.
#
# This script is not freeware! Please read the README for full details
# on registration and terms of use.
# =====================================================================

# Database Definition: CATEGORIES
# --------------------------------------------------------
# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Name => [1, 'alpha', 40, 75, 1, '', '^[\w\d/_-]+$'],
Description => [2, 'alpha', '40x3', 500, 0, '', ''],
Related => [3, 'alpha', 0, 255, 0, '', ''],
'Meta Description' => [4, 'alpha', 40, 75, 0, '', ''],
'Meta Keywords' => [5, 'alpha', 40, 75, 0, '', ''],
Header => [6, 'alpha', 40, 75, 0, '', ''],
Footer => [7, 'alpha', 40, 75, 0, '', ''],
SubCatStyle => [8, 'alpha' ,40, 100, 0, '(ALL)1', '']





site_html_templates.pl

# Print Header.
$output = qq|<div class="margin"><table width="80%" border="0" cellspacing="0" cellpadding="0"><tr><td class="catlist" valign="top">\n|;

foreach $subcat (sort @subcat) {
($description) = @{$category{$subcat}}[2];
($subcatstyle) = @{$category{$subcat}}[8];



NEXT CODE SNIPPLET:

# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<a class="catlist" href="$url">$description</a> <font class="catlist">($numlinks)</font> |;
$output .= qq|<small><sup class="new">new</sup></small>| if (&days_old($mod) < $db_new_cutoff);
$output .= qq|<BR>|;


if ($subcatstyle =~ m,^\(([^\)]+)\)(\d)$, && $#{$subcategories{$subcat}} >= 0) {
($subcatstyle, $style) = ($1, $2);
$s = 0;
@subcatsub = split (/\|/, $subcatstyle);
$output .= qq~&nbsp;&nbsp;&nbsp;&nbsp;~ if ($style eq "1");
foreach $category_name (@subcatsub) {
foreach (sort @{$subcategories{$subcat}}) {
($subcatstyle eq "ALL" && $#subcatsub == 0) ?
($_ =~ m,.*/([^/]+)$, and $category_name = &build_clean($1)) :
($_ eq "$subcat/$category_name" or next);
if ($style eq "1") {
$length += length($category_name);
($length > $subcat_length) and last;
}
if ($s > 0) {
$output .= qq~, ~ and $length += 2 if ($style eq "1");
$output .= qq~ ~ if ($style eq "2");
}
$url = "$build_root_url/" . &urlencode($_) . "/";
$output .= qq~<LI>~ if ($style eq "2");
$output .= qq~<a class="subcat" href="$url">$category_name</a>~;
$s++;
last if ($subcatstyle ne "ALL" && $#subcatsub > 0);
}
}
undef $length;
if ($s < $#{$subcategories{$subcat}}) {
$output .= qq~...~ if ($style eq "1");
}
$output .= qq~<BR>~;
}
else { }}


# Don't forget to end the table..
$output .= "</td></tr></table></div>\n";
return $output;
}


1;




links.cfg


# Site Title, the default title to use. You should really spend some time customizing
# the directory though!
$build_site_title = 'Links Portal Proj ';
# Subcategory Length, the maximum length of the subcategories added into Links.


$subcat_length = '30';




categories.db

Added a | to the end of each record in the database.




That's all...Please advise.

Thank you very much! Let me know if you need access the the site.
Quote Reply
Re: [nova3470] Anyone, help!!!! YAHOO v2.1 In reply to
Do you have more than the one category? You will need sub-categories under the main cat to get anything to show up...

/car/

/car/fast/

/car/slow/

should show up as:

Car

Fast, Slow


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Anyone, help!!!! YAHOO v2.1 In reply to
I have communicated with nova3470 via IM, and we have resolved the problem. We all learn together...Angelic


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Anyone, help!!!! YAHOO v2.1 In reply to
Holly cow!!! Sly I 'cant believe I spent 4 days fiddling with these scripts and you just came along out of no where and worked out my problem in a flash. How could I ever thank you.

I'm trying to use links to dedicate it to the people in my little town back in my country (Colombia) and I wanted to create a link repository for them to see.

God Bless You, Leonard!
John