Apenas em /home/henrique/workspace/groupsorg: .cache diff -u groupsorg/groupsorg.module /home/henrique/workspace/groupsorg/groupsorg.module --- groupsorg/groupsorg.module 2008-04-20 19:58:24.000000000 -0300 +++ /home/henrique/workspace/groupsorg/groupsorg.module 2008-06-27 18:47:07.000000000 -0300 @@ -43,6 +43,13 @@ 'access' => TRUE, 'type' => MENU_CALLBACK, ); + $items[] = array( + 'path' => 'local-ambassadors', + 'title' => t('Local ambassadors'), + 'callback' => 'groupsorg_ambassadors', + 'access' => TRUE, + 'type' => MENU_CALLBACK, + ); } else { groupsorg_set_footer(); @@ -197,6 +204,40 @@ } } +/** + * Local ambassadors page (/local-ambassadors). + */ +function groupsorg_ambassadors() { + // Number of columns to display. + $columns = 5; + + // Number of rows to display. + $rows = 10; + + // Pager id. For using more than one pager on the same page. + $pager_id = 0; + + $per_page = $rows * $columns; + + $sql_from = 'FROM {users} u JOIN {content_field_organizers} cfo ON u.uid = cfo.field_organizers_uid JOIN {content_type_event} cte ON cfo.nid = cte.nid AND cfo.vid = cte.vid'; + + $sql = 'SELECT DISTINCT u.* '. $sql_from .' ORDER BY cte.field_start7_value DESC'; + + $count_sql = 'SELECT COUNT(DISTINCT(u.uid)) AS row_count '. $sql_from; + + $result = pager_query($sql, $per_page, $pager_id, $count_sql); + + $output = t('
The following people are local Drupal ambassadors and are currently helping to organize a local Drupal event. To learn how you can help organize a local Drupal event visit the organizing events tips and guidelines handbook. To see if there is a local group near you view this map.
'); + + if (isset($result)) { + drupal_add_css(drupal_get_path('module', 'og'). '/og.css'); + $output .= theme('og_picture_grid', $result, $columns); + $output .= theme('pager', NULL, $per_page, $pager_id); + } + + return $output; +} + function phptemplate_signup_user_form() { global $user; Apenas em groupsorg: groupsorg.patch Apenas em /home/henrique/workspace/groupsorg: .project Apenas em /home/henrique/workspace/groupsorg: .settings