hello
I found a global today, that is used for displaying editors in categories (see Utils.pm)
I try to hack the code, and now I have this:
sub load_parents {
# -------------------------------------------------------------------
# You call this tag by placing <%Links::Utils::lload_parents%> in your
# category.html template. It will then make available an <%parents%>
# tag that you can use in your template. For example:
# <%Links::Utils::load_parents%>
# <%if parents%>
# The following users are editors in this category: <%parents%>
# <%endif%>
#
my $tags = GT::Template->tags;
my $cat_id = $tags->{category_id};
my $cat_db = $DB->table('Category');
my $parents = $cat_db->parents($cat_id);
my $str = '(' . join (',', @$parents,$cat_id) . ')';
my $sth = $cat_db->select ( GT::SQL::Condition->new('ID', 'IN', \$str) );
return {} unless ($sth->rows);
# Make any formatting changes you need here.
my $output = '';
while (my $string = $sth->fetchrow_hashref) {
$output .= qq~$string->{ID}/~;
}
$output .= "";
return { parents => $output };
}
this works exactly what I need, but I need to set foreign_char to Yes, because netscape 4.7 can't handle spaces in URL's
I found a global today, that is used for displaying editors in categories (see Utils.pm)
I try to hack the code, and now I have this:
sub load_parents {
# -------------------------------------------------------------------
# You call this tag by placing <%Links::Utils::lload_parents%> in your
# category.html template. It will then make available an <%parents%>
# tag that you can use in your template. For example:
# <%Links::Utils::load_parents%>
# <%if parents%>
# The following users are editors in this category: <%parents%>
# <%endif%>
#
my $tags = GT::Template->tags;
my $cat_id = $tags->{category_id};
my $cat_db = $DB->table('Category');
my $parents = $cat_db->parents($cat_id);
my $str = '(' . join (',', @$parents,$cat_id) . ')';
my $sth = $cat_db->select ( GT::SQL::Condition->new('ID', 'IN', \$str) );
return {} unless ($sth->rows);
# Make any formatting changes you need here.
my $output = '';
while (my $string = $sth->fetchrow_hashref) {
$output .= qq~$string->{ID}/~;
}
$output .= "";
return { parents => $output };
}
this works exactly what I need, but I need to set foreign_char to Yes, because netscape 4.7 can't handle spaces in URL's