'bug-bingo', 'title' => 'Bug bingo', 'callback' => 'bingo_jump', 'callback arguments' => array(0), 'access' => user_access('access content'), 'type' => MENU_SUGGESTED_ITEM, ); $items[] = array( 'path' => 'contrib-bug-bingo', 'title' => 'Contrib bug bingo', 'callback' => 'bingo_jump', 'callback arguments' => array(1), 'access' => user_access('access content'), 'type' => MENU_SUGGESTED_ITEM, ); $items[] = array( 'path' => 'patch-bingo', 'title' => 'Patch bingo', 'callback' => 'bingo_jump', 'callback arguments' => array(2), 'access' => user_access('access content'), 'type' => MENU_SUGGESTED_ITEM, ); $items[] = array( 'path' => 'contrib-patch-bingo', 'title' => 'Contrib patch bingo', 'callback' => 'bingo_jump', 'callback arguments' => array(3), 'access' => user_access('access content'), 'type' => MENU_SUGGESTED_ITEM, ); } return $items; } function bingo_jump($type = BINGO_TYPE_MIN) { // Check that we got a valid argument if ($type < BINGO_TYPE_MIN || $type > BINGO_TYPE_MAX) { // otherwise fake a valid one! $type = BINGO_TYPE_MIN; } $sql = array( // Bug core "SELECT nid FROM {project_issues} WHERE sid IN (1) AND category = 'bug' AND pid = 3060 ORDER BY RAND() LIMIT 1", // Bug contrib "SELECT nid FROM {project_issues} WHERE sid IN (1) AND category = 'bug' AND pid != 3060 ORDER BY RAND() LIMIT 1", // Patch core "SELECT nid FROM {project_issues} WHERE sid IN (8,13,14) AND pid = 3060 ORDER BY RAND() LIMIT 1", // Patch contrib "SELECT nid FROM {project_issues} WHERE sid IN (8,13,14) AND pid != 3060 ORDER BY RAND() LIMIT 1", ); $nid = db_result(db_query($sql[$type])); if ($_GET['stop'] != 1) { drupal_goto('node/'. $nid); } } function bingo_block($op = 'list', $delta = 0, $edit = array()) { switch ($op) { case 'list': $blocks[0]['info'] = t('bingo: Contributor links'); return $blocks; case 'view': $block['subject'] = t('Contributor links'); $block['content'] = bingo_block_output(); return $block; } } function bingo_spotlight_title() { $nid = 132970; $title = db_result(db_query("SELECT title FROM {node} WHERE nid = %d", $nid)); $clean_title = str_replace('Patch spotlight: ', '', $title); return l($clean_title, 'node/' . $nid); } function bingo_block_output() { $spotlight = bingo_spotlight_title(); $counts = variable_get('drupalorg_issue_counts', array()); $counts_pending = $counts['Pending bugs']; $counts_critical = $counts['Critical issues']; $counts_queue = $counts['Patch queue']; $counts_review = $counts['Patches to review']; $output = << EOT; return $output; }