You are here

public function AuthcacheCommentNumNewSetting::get in Authenticated User Page Caching (Authcache) 7.2

Number of new comments for given nids.

Overrides AuthcacheP13nSettingInterface::get

File

modules/authcache_comment/includes/AuthcacheCommentNumNewSetting.inc, line 18
Defines a personalization setting for retrieving the number of new comments on a node.

Class

AuthcacheCommentNumNewSetting
Personalization setting for retrieving the number of new comments on a node.

Code

public function get($params, $context) {
  include_once DRUPAL_ROOT . '/modules/node/node.module';
  include_once DRUPAL_ROOT . '/modules/comment/comment.module';
  $result = array();
  foreach ($params as $nid) {
    $result[$nid] = (int) comment_num_new($nid);
  }
  return array_filter($result);
}