add a button to prefs page for comment moderation
parent
9a5085e512
commit
7a7e28c55f
|
@ -26,6 +26,7 @@ sub import {
|
||||||
hook(type => "htmlize", id => "_comment", call => \&htmlize);
|
hook(type => "htmlize", id => "_comment", call => \&htmlize);
|
||||||
hook(type => "pagetemplate", id => "comments", call => \&pagetemplate);
|
hook(type => "pagetemplate", id => "comments", call => \&pagetemplate);
|
||||||
hook(type => "cgi", id => "comments", call => \&linkcgi);
|
hook(type => "cgi", id => "comments", call => \&linkcgi);
|
||||||
|
hook(type => "formbuilder_setup", id => "comments", call => \&formbuilder_setup);
|
||||||
IkiWiki::loadplugin("inline");
|
IkiWiki::loadplugin("inline");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -618,6 +619,18 @@ sub commentmoderation ($$) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub formbuilder_setup (@) {
|
||||||
|
my %params=@_;
|
||||||
|
|
||||||
|
my $form=$params{form};
|
||||||
|
if ($form->title eq "preferences") {
|
||||||
|
push @{$params{buttons}}, "Comment Moderation";
|
||||||
|
if ($form->submitted && $form->submitted eq "Comment Moderation") {
|
||||||
|
commentmoderation($params{cgi}, $params{session});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub comments_pending () {
|
sub comments_pending () {
|
||||||
my $dir="$config{wikistatedir}/comments_pending/";
|
my $dir="$config{wikistatedir}/comments_pending/";
|
||||||
return unless -d $dir;
|
return unless -d $dir;
|
||||||
|
|
|
@ -45,6 +45,8 @@ There are some global options for the setup file:
|
||||||
## comment moderation
|
## comment moderation
|
||||||
|
|
||||||
If you enable the [[blogspam]] plugin, comments that appear spammy will be
|
If you enable the [[blogspam]] plugin, comments that appear spammy will be
|
||||||
held for moderation. These comments are stored in
|
held for moderation. Wiki admins can access the comment moderation queue
|
||||||
`.ikiwiki/comments_pending/`, and can be deleted, or moved into the
|
via a button on their Preferences page.
|
||||||
wiki's srcdir to be posted.
|
|
||||||
|
The comments are stored in `.ikiwiki/comments_pending/`, and can be
|
||||||
|
deleted, or moved into the wiki's srcdir to be posted.
|
||||||
|
|
|
@ -33,6 +33,8 @@ located in /usr/share/ikiwiki/templates by default.
|
||||||
by the [[plugins/comments]] plugin.
|
by the [[plugins/comments]] plugin.
|
||||||
* `editcomment.tmpl` - This template is the comment post form for the
|
* `editcomment.tmpl` - This template is the comment post form for the
|
||||||
[[plugins/comments]] plugin.
|
[[plugins/comments]] plugin.
|
||||||
|
* `commentmoderation.tmpl` - This template is used to produce the comment
|
||||||
|
moderation form.
|
||||||
|
|
||||||
The [[plugins/pagetemplate]] plugin can allow individual pages to use a
|
The [[plugins/pagetemplate]] plugin can allow individual pages to use a
|
||||||
different template than `page.tmpl`.
|
different template than `page.tmpl`.
|
||||||
|
|
Loading…
Reference in New Issue