work right; specially, that I have the non-English mod installed which confused me.
What I am trying to do is to have the FLAG of each country to appear in front of that country name.
Please note that the country names are SUB CATEGORIES of the main category that is called COUNTRIES.
So, how can I proceed? or can I make the subcategory names accept images in their names. How?
Thank in advance for all your help..
Regards..
Code:
***************************************** ***************************************** ***************************************** in this file I added the following field so it appears before the category/subcategory names category.def ============
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
CatImage => [1, 'alpha', 10, 100, 0, '', ''], Name => [2, 'alpha', 40, 75, 1, '', '^[\w\d,\&\'\@/_-]+$'],
Description => [3, 'alpha', '40x3', 500, 0, '', ''],
Related => [4, 'alpha', 0, 255, 0, '', ''],
'Meta Description' => [5, 'alpha', 40, 75, 0, '', ''],
'Meta Keywords' => [6, 'alpha', 40, 75, 0, '', ''],
Header => [7, 'alpha', 40, 75, 0, '', ''],
Footer => [8, 'alpha', 40, 75, 0, '', ''],
Nonenglish => [9, 'alpha', 40, 75, 0, '', '']
);
***************************************** ***************************************** ***************************************** Since I have installed the non-english mod, then things got more diffecult to follow. I am not sure where exactly I should place the catimage!!! nph-build.cgi =============
sub build_category_pages {
# --------------------------------------------------------
# This routine builds all the category pages. Each category uses
# the same template which is defined in &site_html_category.
my $build_single = shift;
my ($cat, $url, $dir, @related, $relation, $page_num, $next_page, $numlinks);
local ($category, $links, $title_linked, $title, $total, $category_name, $category_name_escaped);
# ***************************************** nonenglish modification - begin ****************
local (
$catimage, $description, $related, $meta_name, $meta_keywords, $header, $footer, $nonenglish, $next, $prev);
# ***************************************** nonenglish modification - end ******************
# Go through each category and build the appropriate page.
CATEGORY: foreach $cat (sort keys %category) {
next CATEGORY if ($cat =~ /^\s*$/); # How'd that get in here? =)
next CATEGORY if ($build_single and ($build_single ne $cat));
$url = "$build_root_url/" . &urlencode($cat) . "/";
$use_html ?
print qq|Building Category: <A HREF="$url" TARGET="_blank">$cat</A>\n| :
print qq|Building Category: $cat\n|;
print "\tSubcategories: " . ($#{$subcategories{$cat}} + 1) . "\n";
print "\tLinks: " . (($#{$links{$cat}}+1) / ($#db_cols+1)) . "\n";
# Let's make sure the directory exists, build it if it doesn't.
$dir = &build_dir ($cat);
print "\tDirectory: $dir\n";
print "\tFilename : $dir/$build_index\n";
# We set up all the variables people can use in &site_html.pl.
# ***************************************** nonenglish modification - begin ****************
(
$catimage, $description, $related, $meta_name, $meta_keywords, $header, $footer, $nonenglish) = @{$category{$cat}}[2..9];
# ***************************************** nonenglish modification - end ******************
# Calculate the related entries and put in a <LI> list.
@related = split(/\Q$db_delim\E/, $related); $related = "";
foreach $relation (@related) {
$related .= qq|<li><a href="$build_root_url/|;
$related .= &urlencode($relation);
$related .= qq|/$build_index">|;
# ***************************************** nonenglish modification - begin ****************
$related .= &kategorie_title_mb($relation);
# ***************************************** nonenglish modification - end ******************
$related .= "</a></li>";
}
# Get the header and footer from file if it exists, otherwise assume it is html.
if ($header && (length($header) < 20) && ($header !~ /\s+/) && (-e "$db_header_path/$header")) {
open (HEAD, "<$db_header_path/$header") or &cgierr ("Unable to open header file: $db_header_path/$header. Reason: $!");
$header = "";
while (<HEAD>) {
$header .= $_;
}
close HEAD;
}
if ($footer && (length($footer) < 20) && ($footer !~ /\s+/) && (-e "$db_footer_path/$footer")) {
open (FOOT, "<$db_footer_path/$footer") or &cgierr ("Unable to open footer file: $db_footer_path/$footer. Reason: $!");
$footer = "";
while (<FOOT>) {
$footer .= $_;
}
close FOOT;
}
etc... ***************************************** ***************************************** ***************************************** In this one I am not sure on the position of catimage!! site_html_templates.pl ======================
sub site_html_category #----------------------------------
.
.
return &load_template ( 'category.html', {
date => $date,
time => $time,
CatImage => $catimage, category => $category,
links => $links,
title_linked => $title_linked,
title => $title,
total => $total,
grand_total => $grand_total,
category_name => $category_name,
category_name_escaped => $category_name_escaped,
category_clean => $category_clean,
description => $description,
meta_name => $meta_name,
meta_keywords => $meta_keywords,
header => $header,
footer => $footer,
prev => $prev,
next => $next,
related => $related,
build_links_per_page => $build_links_per_page,
%globals
} );
sub site_html_print_cat {
# --------------------------------------------------------
# This routine determines how the list of categories will look.
# We now use a table to split the category name up into two columns.
# For each category you can use the following variables:
#
# $url : The URL to go to that category
# $category_name : The category name with _ and / removed.
# $category_descriptions{$subcat}: The category description (if any).
# $numlinks : The number of links inside that category (and subcategories).
# $mod : The newest link inside of that category.
#
my (@subcat) = @_;
# ***************************************** nonenglish modification - begin ****************
my ($url, $numlinks, $mod, $subcat,
$catimage, $category_name, $description, $output, $i, $nonenglish);
# ***************************************** nonenglish modification - end ******************
my ($half) = int (($#subcat+2) / 2);
# Print Header.
$output = qq|<div class="margin"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td class="catlist" valign="top">\n|;
etc... ***************************************** ***************************************** *****************************************