Gossamer Forum
Quote Reply
Category Menu Everywhere
Hello all,

The mod below is for Links 2.0, but how to convert the mod for using with Links SQL? Please help.






This will give a list/menu of top level categories anywhere on your templates:

sub menu {
# --------------------------------------------------------
#
my (%c, @fields);
open (DB, "<$db_category_name") or &cgierr("unable to open $db_file_name. Reason: $!");
if ($db_use_flock) { flock(DB, 1); }
LINE: while (<DB>) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
@fields = &split_decode ($_);

$c{$fields[$db_main_category]}++;
}
close DB;

foreach $field (sort keys %c) {

if ($field =~ m,^([^/]*)$,) {
$field2 = &build_clean($field);
$category_list .= qq|<a href= "$build_root_url/$field">$field2</a>
|;
}
}

return $category_list;
}


Subject Author Views Date
Thread Category Menu Everywhere reenee 14462 Dec 31, 2001, 4:43 AM
Thread Re: [reenee] Category Menu Everywhere
pugdog 14102 Dec 31, 2001, 7:06 AM
Thread Re: [pugdog] Category Menu Everywhere
Paul 14036 Dec 31, 2001, 8:48 AM
Thread Re: [RedRum] Category Menu Everywhere
pugdog 14053 Dec 31, 2001, 9:54 AM
Thread Re: [pugdog] Category Menu Everywhere
Paul 13999 Dec 31, 2001, 10:01 AM
Post Re: [RedRum] Category Menu Everywhere
reenee 13942 Dec 31, 2001, 10:51 AM
Thread Re: [reenee] Category Menu Everywhere
Alex 13985 Dec 31, 2001, 11:09 AM
Thread Re: [Alex] Category Menu Everywhere
reenee 13977 Dec 31, 2001, 11:19 AM
Thread Re: [reenee] Category Menu Everywhere
reenee 13902 Dec 31, 2001, 11:57 AM
Thread Re: [reenee] Category Menu Everywhere
pugdog 14052 Dec 31, 2001, 12:04 PM
Thread Re: [pugdog] Category Menu Everywhere
Alex 14048 Dec 31, 2001, 12:05 PM
Thread Re: [Alex] Category Menu Everywhere
Paul 14022 Dec 31, 2001, 12:07 PM
Thread Re: [RedRum] Category Menu Everywhere
reenee 13925 Dec 31, 2001, 1:11 PM
Thread Re: [reenee] Category Menu Everywhere
Alex 13931 Dec 31, 2001, 1:44 PM
Thread Re: [Alex] Category Menu Everywhere
reenee 13963 Dec 31, 2001, 2:28 PM
Thread Re: [reenee] Category Menu Everywhere
reenee 13905 Dec 31, 2001, 3:39 PM
Thread Re: [reenee] Category Menu Everywhere
Alex 13885 Dec 31, 2001, 3:45 PM
Thread Re: [Alex] Category Menu Everywhere
reenee 13900 Jan 1, 2002, 6:58 PM
Thread Re: [reenee] Category Menu Everywhere
Alex 13871 Jan 2, 2002, 8:49 AM
Thread Re: [Alex] Category Menu Everywhere
macbethgr 13797 Apr 18, 2002, 4:53 PM
Thread Re: [macbethgr] Category Menu Everywhere
macbethgr 13733 Apr 19, 2002, 7:47 AM
Thread Re: [macbethgr] Category Menu Everywhere
pugdog 13618 Apr 19, 2002, 12:04 PM
Thread Re: [pugdog] Category Menu Everywhere
Nosmada 13336 Jul 24, 2003, 6:29 PM
Thread Re: [Nosmada] Category Menu Everywhere
ryel01 13197 Mar 14, 2004, 2:07 AM
Thread Re: [ryel01] Category Menu Everywhere
Mark2 12813 Feb 15, 2006, 9:27 AM
Thread Re: [Mark2] Category Menu Everywhere
afinlr 4117 Feb 16, 2006, 10:03 AM
Thread Re: [afinlr] Category Menu Everywhere
Mark2 4036 Feb 17, 2006, 8:10 AM
Thread Re: [Mark2] Category Menu Everywhere
afinlr 3984 Feb 17, 2006, 10:44 AM
Post Re: [afinlr] Category Menu Everywhere
Mark2 3961 Feb 17, 2006, 1:51 PM
Thread Re: [Mark2] Category Menu Everywhere
HopeForYou 3809 Jun 1, 2009, 7:57 PM
Post Re: [HopeForYou] Category Menu Everywhere
Andy 3778 Jun 1, 2009, 11:51 PM