Hi,
I've created a global that outputs the last 10 threads in my forums. The global works fine, problem is that the output is not correctly formated. I need it in HTML format but instead of < and > simbols I get > and < and the browser displays it 'as is' not following HTML rules. the only way I can make it work is if I replace return with print, but I get a number 1 at the end of the text. please help
[code]
sub {
my ($output,$first,$db,$sth);
my $db = $DB->table('Post');
$db->select_options ('ORDER BY post_time DESC', 'LIMIT 10');
my $first = $db->select ({ post_root_id => 0});
while (my $row = $first->fetchrow_hashref) {
$output .= "$row->{post_subject}<br>";
}
return $output;
}
[/code]
I've created a global that outputs the last 10 threads in my forums. The global works fine, problem is that the output is not correctly formated. I need it in HTML format but instead of < and > simbols I get > and < and the browser displays it 'as is' not following HTML rules. the only way I can make it work is if I replace return with print, but I get a number 1 at the end of the text. please help
[code]
sub {
my ($output,$first,$db,$sth);
my $db = $DB->table('Post');
$db->select_options ('ORDER BY post_time DESC', 'LIMIT 10');
my $first = $db->select ({ post_root_id => 0});
while (my $row = $first->fetchrow_hashref) {
$output .= "$row->{post_subject}<br>";
}
return $output;
}
[/code]