i hope this is the right place to ask this... im not good in english language so please i hope you understand

this notice is popping up for my non members browsing contents on forums.
please i need help on this, i dont want to show them the
home/XXXXXXXXXXXXXXX/public_html/sites/all/modules/user_badges/user_badges.module

all my requests here are ignored i just wish someone will help me here please,,, thanks in advance.

Comments

ymoss’s picture

oh by the way this is the line 1319 of my file
if (in_array($node->type, variable_get('user_badges_current_node_types', array()))) {

and this is the full one.

/**
 * Implements hook_block_view().
 */
function user_badges_block_view($delta = 0) {
  $block = array();

  switch ($delta) {
    case 'current_node':
      $arg2 = arg(2);
      if (arg(0) == 'node' && is_numeric(arg(1)) && empty($arg2)) {
        $node = menu_get_object();
        if (in_array($node->type, variable_get('user_badges_current_node_types', array()))) {
          $account = user_load($node->uid);
          $result = isset($account->badges) ? $account->badges : array();
          $images = array();
          foreach ($result as $badge) {
            $images[] = theme('user_badge', array('badge' => $badge));
          }
          $block['subject'] = t("@name's Badges", array('@name' => $node->name));
          $block['content'] = theme('user_badge_group', array('badgeimages' => $images));
        }
      }
      break;

    case 'my_badges':
      global $user;
      if (!isset($user->badges_all)) {
        $user = user_load($user->uid);
      }
      if (variable_get('user_badges_my_badges_limit', 1)) {
        $result = $user->badges;
      }
      else {
        $result = $user->badges_all;
      }
      $images = array();
      foreach ($result as $badge) {
        $images[] = theme('user_badge', array('badge' => $badge));
      }
      $block['subject'] = t('My Badges');
      $block['content'] = theme('user_badge_group', array('badgeimages' => $images));
      break;

    case 'all_badges':
      $result = db_select('user_badges_badges', 'ubb')
        ->fields('ubb')
        ->orderBy('ubb.weight', 'asc')
        ->orderBy('ubb.name', 'asc')
        ->execute();
      $items = array();
      foreach ($result as $badge) {
        $items[] = theme('user_badge', array('badge' => $badge))
          . ' <span class="all-badges-name">'
          . check_plain($badge->name)
          . '</span>';
      }
      $block['content'] = theme('item_list', array('items' => $items));
      break;
  }

  return $block;
}
NancyDru’s picture

I committed a change. Please let me know if it stops the error. And please check your Drupal log, because it may put out an message there.

ymoss’s picture

Thank you so much now i can set forum nodes as for members only, i think its ok now
thank you again <3

indyana’s picture

Status: Active » Reviewed & tested by the community

Reading through old issues, this appears fixed.

shabana.navas’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.