[comment] ui_template: Yes ui_template_name: leftonly [/comment] [flag type=write table=forum] [tmp page_title]Submit a forum story[/tmp] [control reset=1] [control-set] [component]search_box_small[/component] [/control-set] [control-set] [component]cart_tiny[/component] [/control-set] [control-set] [component]product_tree[/component] [/control-set] [control reset=1] [comment] Form shamelessly stolen from Slash, thanks guys. [/comment] @_LEFTONLY_TOP_@ [if cgi product] [perl tables=products] ## Set the subject if coming from product page my $desc = tag_data('products', $Config->{DescriptionField}, $Session->{arg}); $CGI->{subject} = $desc; return; [/perl] [/if] [perl tables="forum"] #code parent artid mod_time created username host score lastscore reason anon extended subject comment sub scrub { my ($value, $type) = @_; my @allowed = qw/ a b i u blockquote li ol ul em br tt p strong div /; my %v; my $db = $Db{forum} or return "Database error."; my $noscrub; if(! $type) { $value =~ s/\[/[/g; } elsif($type eq '2') { $value = $Tag->filter('text2html', $value); $value =~ s/\[/[/g; } elsif($type eq '4') { unless ($value =~ m{\s*xmp\s*>}i) { $noscrub = 1; $value =~ s/\[//g; $value = "
[restrict enable=cgi]
[cgi name=subject filter="restrict_html"] [/restrict] by [either][value fname][or]Guest user[/either] on [convert-date fmt="%A, %B %e, %Y @%H:%M"][/convert-date] |
[perl tables="forum"] return scrub($CGI->{comment}, $CGI->{commtype}); [/perl] |
This is what goes on "Read More":
[perl tables="forum"] return scrub($CGI->{additional}, $CGI->{commtype}); [/perl] |
Above is a preview of what you just entered. Use Submit to actually submit if you are satisfied. [/if] [if cgi operation eq 'Submit'] [perl tables="forum"] #code parent artid mod_time created username host score lastscore reason anon extended subject comment my %v; delete $Scratch->{tmp_code}; my $db = $Db{forum} or return "Database error."; $v{host} = $Session->{host}; $v{score} = 1; my $noscrub; if(! $CGI->{commtype}) { # do nothing } elsif($CGI->{commtype} eq '2') { $CGI->{comment} = $Tag->filter('text2html', $CGI->{comment}); } elsif($CGI->{commtype} eq '4') { unless ($CGI->{comment} =~ m{\s*xmp\s*>}i) { $noscrub = 1; $CGI->{comment} = "
[if variable FORUM_DEFAULT_THREAD] [page forum __FORUM_DEFAULT_THREAD__]__COMPANY__ forum[/page] [/if] @_LEFTONLY_BOTTOM_@