'. check_plain($node->title) .''; $output .= drupal_render($node->content); if ($node->voted) { $output .= '

'. l(t('Older polls'), 'polls', array('class' => 'old-polls', 'title' => t('View the list of polls on this site.'))) .'

'; } } return $output; } function ogpolls_latest_poll() { if ($group_node = og_get_group_context()) { $gid = $group_node->nid; $result = db_query('SELECT MAX(og.nid) AS nid FROM {og_ancestry} AS og INNER JOIN {advpoll} AS p ON p.nid = og.nid WHERE p.active = 1 AND og.group_nid = %d', $gid); $poll = db_fetch_object($result); // The nid will be NULL if there ar no active polls. if($poll->nid) { $node = advpoll_view(node_load($poll->nid), FALSE, FALSE); } return $node; } }