function draw_group($group) { $buddys = get_buddys($group); $kids = get_kids($group); ob_start(); ?> <div class="group_wrapper"> <?php echo draw_group_info($group); ?> <br /> <div class="buddy_list"> <h3>Faddere</h3> <?php foreach ($buddys as $buddy) { echo draw_small_profile($buddy->user_id); echo "</tr>\n"; } ?> </div> <div class="kids_list"> <h3>Barn</h3> <?php foreach ($kids as $kid) { echo draw_small_profile($kid->user_id); echo "</tr>\n"; } ?> </div> </div> <?php $data = ob_get_contents(); ob_end_clean(); return $data; }
function draw_profiles($settings) { global $wpdb; $current = ""; ob_start(); $NUM_BUDDY_GROUPS = 16; for ($i = 1; $i <= $NUM_BUDDY_GROUPS; $i++) { $buddys = get_buddys($i); $program_name = get_study_program($i); if ($program_name != $current) { echo draw_study_program($program_name); $current = $program_name; } echo '<div class="group_list clearfix">'; echo '<ul class="group_list_buddys">'; foreach ($buddys as $buddy) { echo draw_profile($buddy->user_id); } echo "</ul>\n"; echo draw_group_infobox($i); echo "</div>"; if (get_study_program($i) != $current) { echo draw_study_program($program_name); $current = $program_name; } } $data = ob_get_contents(); ob_end_clean(); return $data; }