How about comments hiding?

code17 - July 20, 2008 - 08:49
Project:Premium
Version:HEAD
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:by design
Description

First of all, thanks for the premium module. Your great contribution is very helpful in our websites.

Here is one suggestion: I think it make sense to have some option to hide comments of premium contents from non-premium members.

We hide premium content as teasers mainly for protecting the interests of premium members, however

* if a post is short, its content is all in teaser --- that's fine. We can say since it's short, it doesn't worth to protect
* and all the comments are also exposed to the guest, which can help a great deal to understand the content even if some parts of it are hidden

then, we have almost nothing to protect.

Simply disabling guests' comment access doesn't work, since for non-premium content, we would wish both its content and comment are accessible for guest, otherwise it can lead to confusion.

Since comments are usually short, I would suggest to hide the full content of comments (affiliated to premium nodes) rather than producing teasers, whereas the titles of comments should still be shown with some hints saying the content is premium-only.

What do you think?

Thanks again.

#1

code17 - July 25, 2008 - 19:32

Well, I add the following code to premium.module to have the plain functionality (no configuration options available):

function premium_comment(&$a1, $op) {
  $a1->premium = _premium_node(node_load($a1->nid));                
  if ($op == 'view') {
   if (!$a1->premium || user_access('access premium content')) {
      return;
   };
   $a1->comment = t(variable_get('premium_message', 'Full text available to premium subscribers only'));
  };

Since I know nothing about php and drupal, it's likely to be buggy, use at your own risk.

#2

Allie Micka - August 4, 2008 - 21:31
Status:active» by design

FWIW, it's now possible to effect this through a module other than premium.

All nodes should have a $node->premium and a $node->premium_access variable. "premium" indicates whether a node is premium, and "premium_access" indicates whether the user can view it.

A module other than premium might be able to remove comments based on the value for $node->premium_access

I'm reticent to bake this functionality directly into premium, but am contemplating more flexible ways of dealing with how premium and (un)available content appears.

 
 

Drupal is a registered trademark of Dries Buytaert.