[comment] ui_template: Yes ui_template_name: leftonly [/comment] [flag type=write table=forum] [tmp page_title]Reply to [data table=forum col=subject key="[data session arg]"][/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] [if type=!data term="forum:code:[data session arg]"] [perl tables="forum products"] my $db = $Db{forum}; my $code = $Session->{arg}; my $desc = tag_data('products', 'description', $code); my $parent = 0; if($CGI->{subsidiary}) { $parent = $CGI->{subsidiary}; } return unless $desc; my $record = { created => $Tag->convert_date( { fmt => '%Y%m%d%H%M' }), artid => $code, subject => "Comments on $desc", username => $Session->{username}, name => "Product Manager", email => $Variable->{FORUM_EMAIL_NOTIFY} || '', score => 1, comment => "", parent => $parent, }; $db->set_slice($code, $record); return; [/perl] [/if] [/if]
[if !cgi operation] [loop list="[data session arg]" prefix=item] [if-item-data forum code]

[item-data forum subject] [if-item-data forum score](Score: [item-data forum score][if-item-data forum reason], [item-data forum reason][/if-item-data])[/if-item-data] by [forum-userlink username="[item-data forum username]" name="[item-data forum name]" anon="[item-data forum anon]" ] on [convert-date fmt="%A, %B %e, %Y @%H:%M"][item-data forum created][/convert-date]
[item-data forum comment]
[if-item-data forum additional]
[item-data forum additional]
[/if-item-data]

You are replying to the above.

[/if-item-data] [/loop] [/if] [if cgi operation eq '[L]Preview[/L]']

[cgi name=subject filter=restrict_html] by [if !session logged_in] [either]blah[or]Guest user[/either] [else] [if cgi anon] [either]__FORUM_ANON_NAME__[or]Guest user[/either] [else] [either][value handle][or][value fname][or][data session username][/either] [/else] [/if] [/else] [/if] on [convert-date fmt="%A, %B %e, %Y @%H:%M"][/convert-date]

[if cgi commtype eq 2] [cgi name=comment filter="text2html" keep=1 enable_html=1] [elsif cgi commtype eq 4]

    [cgi name=comment]

[/elsif] [else] [cgi name=comment filter="restrict_html.a.b.i.u.blockquote.li.ol.ul.em.br.tt.p.strong.div" keep=1 enable_html=1] [/else] [/if]

Above is a preview of what you just entered. Use Submit to actually submit if you are satisfied.

[/if] [if cgi operation eq '[L]Submit[/L]'] [flag type=write table=forum] [perl tables="forum"] # code parent artid mod_time created username host score # lastscore reason anon extended subject comment my @allowed = qw/ a b i u blockquote li ol ul em br tt p strong div /; 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{}i) { $noscrub = 1; $CGI->{comment} = "

    $CGI->{comment}

"; } } $v{comment} = $CGI->{comment}; my $filter = join ".", 'restrict_html', @allowed; $v{comment} = $Tag->filter($filter,$v{comment}) unless $noscrub; $v{username} = $Session->{username} || ''; $v{anon} = $CGI->{anon} ? 1 : 0; $v{created} = $v{mod_time} = $Tag->time( { body => "%Y-%m-%d %H:%M:%S" }); #Debug("mod_time $v{mod_time}"); $v{subject} = $Tag->filter('encode_entities', $CGI->{subject}, 'subject'); $v{artid} = $CGI->{artid}; $v{parent} = $CGI->{parent}; $Scratch->{tmp_code} = $db->set_slice(undef, [ keys %v ], [values %v]) or return "Error submitting reply!"; $Scratch->{tmp_code} =~ s/'//g; $Scratch->{tmp_parent} = $v{parent}; my $mrecord = $db->row_hash($v{artid}); ## This is special processing only if main article ID record ## is found if($mrecord and $mrecord->{email}) { my $cc = $mrecord->{email}; my $url = $Tag->area( { href => 'admin/flex_editor', form => " mv_data_table=forum item_id=$Scratch->{tmp_code} ", }); my $message = <<EOF; Subject: $v{subject} From: $v{name} <$v{email}> Host: $v{host} $v{comment} Edit/delete: $url EOF $Tag->email( { subject => "Posting from $v{artid} forum: $v{subject}", to => $cc, body => $message, }); } return; [/perl] [if scratch tmp_code] [bounce href="[area href=forum/display arg='[scratch tmp_parent]']"] [/if] [else] [include include/forum/reply_form] [/else] [/if]

[if variable FORUM_DEFAULT_THREAD] [page forum __FORUM_DEFAULT_THREAD__]__COMPANY__ forum[/page] [/if]

@_LEFTONLY_BOTTOM_@