I use the following codes in the
add.cgi file (which is based on the Category Select Codes that Bobsie wrote awhile ago):
1) Add the following codes in your
sub main routine in the
add.cgi file:
Code:
else {
if ($db_single_category) {
my %is_valid = map { $_ => 1 } &category_list;
$ENV{'HTTP_REFERER'} =~ s,/[^/]+\.[^/]+$,,;
$ENV{'HTTP_REFERER'} =~ m,$build_root_url/(.+?)/?$,;
if ($is_valid{$1}) {
&site_html_add_form ($1)
}
else {
&site_html_add_choose ();
}
}
else {
&site_html_add_choose ();
}
} 2) Add a new sub-routine in the
site_html_templates.pl file called
sub site_html_add_choose routine. This sub should look like the following:
Code:
sub site_html_add_choose {
# --------------------------------------------------------
# Recommend - Choose Category
&html_print_headers;
print &load_cgi_template ('add_choose.html', {
%in,
%globals
});
} 3) Create a new template file called
add_choose.html. In this file, you can include the
Category List OR
Category Redirect tags that are defined in the following FAQ/Tutorial:
http://anthrotech.com/cgi/links/faqs/catlist/ http://anthrotech.com/...links/faqs/redirect/ What this will allow you to do is the following:
1) Keep the same header and footer files in ALL your pages including the homepage.
2) Reinforce browsing of your site, so that people have to choose a category before adding their site.
Hope this helps.
Regards,
Eliot Lee