this has nothing to do with relations pugdog..
i haven't modded 1.11 to do this.. so i might as well do it now...
in site_html_print_cat
add:
Code:
my $db = new Links
::DBSQL "$LINKS{admin_root_path}/defs/Category.def";
my $sth = $db->prepare ("SELECT ID, Name, Has_New_Links, Number_Of_Links, Description FROM Category WHERE Name = ?");
above:
change:
Code:
# Get the URL and the Category name.
$category_url = $LINKS{build_root_url} . "/" . &build_clean_name ($cat_r->{Name}) . "/";
($cat_r->{Name} =~ m,.*/([^/]+)$,) ? ($category_name = $1) : ($category_name = $cat_r->{Name});
$cat_r->{Short_Name} = $category_name;
$cat_r->{URL} = $category_url;
to:
Code:
$cat_r = $subcat->{$cat};
($cat_r->{Name} =~ m,.*/([^/]+)$,) ? ($category_name = $1) : ($category_name = $cat_r->{Name});
if ($cat_r->{Name} =~ m,\@$,) {
$sth->execute($cat_r->{Description}) or die $DBI::errstr;
$cat_r = $sth->fetchrow_hashref;
chop $category_name;
}
$cat_r->{Short_Name} = $category_name; $cat_r->{URL} = $LINKS{build_root_url} . "/" . &build_clean_name($cat_r->{Name}) . "/";
remove the bolded if you want the alias categories to actually have the @ sign at the end... i took it out..
plus.. you have to change the validation for Name in the Category table..
well... i guess this is only for people that use the english language.. or maybe not. anyway.. change it to:
^[\w\d/_-]+\@?$
if you want.. i'm not..
anyways.. to use.. just make a category that ends with @.. in the categories description.. you want to put the name of the category you are linking to.. like for example.. i want Software/Games/Handheld
to link to
Hardware/Games
i make..
Name: Software/Games/Handheld@
Description: Hardware/Games
additional things to put in nph-build.cgi..
in build_category_pages..
under
Code:
$category_r = $CATDB->array_to_hash ($category_r);
add:
Code:
next if ($category_r->{'Name'} =~ m,\@$,);
there was an easier way to do this.. but it was in Links SQL 1.02 when that query was still plain text.. not a DBSQL query.. but this way seems to go faster.. ??
you might want to add something to build_stats too..
like "AND NAME NOT LIKE '%@'"
but i don't know about that..
jerry
[This message has been edited by widgetz (edited December 30, 1999).]