use warnings FATAL => 'all';
use CGI qw{:standard};
require Exporter;
+use BBCode::Parser;
our @ISA = qw/Exporter/;
sub parseMarkup {
my ($text) = @_;
- $text =~ s{\n}{\n<br/>}g;
- $text =~ s{\[B\](.*?)\[/B\]}{<b>$1</b>}gi;
- $text =~ s{\[I\](.*?)\[/I\]}{<i>$1</i>}gi;
- $text =~ s{\[url\](.*?)\[/url\]}{<a href="$1">$1</a>}gi;
- return $text;
+ #$text =~ s{\n}{\n<br/>}g;
+ #$text =~ s{\[B\](.*?)\[/B\]}{<b>$1</b>}gi;
+ #$text =~ s{\[I\](.*?)\[/I\]}{<i>$1</i>}gi;
+ #$text =~ s{\[url\](.*?)\[/url\]}{<a href="$1">$1</a>}gi;
+ #$text =~ s{\[PRE\](.*?)\[/PRE\]}{<pre>$1</pre>}sgi;
+ #$text =~ s{\[PRE\](.*?)\[/PRE\]}{<pre>$1</pre>}sgi;
+ #$1 =~ s{<br/>}{}g;
+
+ my $tree = BBCode::Parser->DEFAULT->parse($text);
+
+ return scalar $tree->bodyHTML;;
}
while (my $category = $categories->fetchrow_hashref){
$boards->execute($category->{id},$ND::UID) or $ND::ERROR .= p($DBH->errstr);
#TODO: really need to do this outside, so you don't need moderate access
- if ($category->{id} == $board->{fcid}){
- $BODY->param(Category => $category->{category});
- }
my @boards;
while (my $b = $boards->fetchrow_hashref){
}
$BODY->param(Categories => \@categories);
}
+ my ($category) = $DBH->selectrow_array(q{SELECT category FROM forum_categories WHERE fcid = $1}
+ ,undef,$board->{fcid}) or $ND::ERROR .= p($DBH->errstr);
}else{ #List boards
$BODY->param(Overview => 1);
use GD::Graph::lines;
+use BBCode::Parser;
+
use ND;
use ND::DB;
use ND::Include;
</TMPL_IF>
<fieldset class="forum-post">
<legend class="unread:<TMPL_VAR NAME=Unread>"><b><TMPL_VAR NAME=Username></b> : <TMPL_VAR NAME=Time></legend>
-<TMPL_VAR NAME=Message>
+ <TMPL_VAR NAME=Message>
</fieldset>
</TMPL_LOOP>
<TMPL_IF Post>