Skip to content

Commit

Permalink
Adds public viewing of comments. Updates README
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickmj committed Jan 30, 2012
1 parent 0128adf commit 242c1d5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
18 changes: 16 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ API keys to both of these services and add them to the plugin's configuration.
** Check to display threaded comments

* ReCaptcha Keys
** These keys duplicate the fields found in the Omeka Security settings
** These keys duplicate the fields found in the Omeka Security settings. ReCaptcha challenges only appear when there
is no user logged in.

* Permissions
** Options are available to specify what roles can moderate, add, and view comments
Expand All @@ -26,6 +27,8 @@ API keys to both of these services and add them to the plugin's configuration.
* Akismet API key
** You should get an API key to the Akismet spam management service if you use public commenting

See USE CASES below for examples of configuration combinations

== DISPLAYING COMMENTS ==

Commenting will automatically add commenting options to Item and Collection show pages. To enable commenting on other
Expand Down Expand Up @@ -65,4 +68,15 @@ Keep in mind that updating themes or plugins will clobber your addition of the c
The Commenting plugin knows how to work with SimplePages and ExhibitBuilder. Due to variability
in how plugins store their data in the database, other record types and views supplied by other plugins
might or might not work out of the box. Please ask on the forums or dev list if you would like Commenting
to work with other plugins.
to work with other plugins.


== USE CASES ==

=== Limited, moderated commenting ===
An institution wants only trusted people to leave comments for anyone to read. It doesn't trust some of them enough to allow
comments to be automatically public.

The trusted people could have the Researcher role in Omeka, with commenting configured to allow Researchers to comment.
The Admin role is the only role that can moderate comments, and Public is allowed to view comments.

9 changes: 9 additions & 0 deletions config_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,16 @@
</div>
</div>

<div class='field'>
<label for='commenting_allow_public_view'>Allow Public to view comments?</label>
<div class='inputs'>
<?php echo __v()->formCheckbox('commenting_allow_public_view', null,
array('checked'=> (bool) get_option('commenting_allow_public_view') ? 'checked' : '',
)
); ?>

</div>
</div>

<div class='field'>
<label for='commenting_allow_public'>Allow Public Commenting? (This overrides all of the above limitations on commenting and viewing)</label>
Expand Down
1 change: 1 addition & 0 deletions controllers/CommentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function updatespamAction()

public function updateapprovedAction()
{
$wordPressAPIKey = get_option('commenting_wpapi_key');
$commentIds = $_POST['ids'];
$status = $_POST['approved'];
$table = $this->getTable();
Expand Down
2 changes: 1 addition & 1 deletion helpers/commenting.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

function commenting_echo_comments($options = array('approved'=>true))
{
if( (get_option('commenting_allow_public') == 1) || has_permission('Commenting_Comment', 'show') ) {
if( (get_option('commenting_allow_public') == 1) || (get_option('commenting_allow_public_view') == 1) || has_permission('Commenting_Comment', 'show') ) {
if(!isset($options['threaded'])) {
$options['threaded'] = get_option('commenting_threaded');
}
Expand Down

0 comments on commit 242c1d5

Please sign in to comment.