guid . " ORDER BY views DESC LIMIT $max"; $result = get_data($sql); $entities = array(); foreach($result as $entity) { $entities[] = get_entity($entity->entity_guid); } $title = elgg_echo("tidypics:yourmostviewed"); $area2 = elgg_view_title($title); $area2 .= elgg_view_entity_list($entities, $max, 0, $max); $body = elgg_view_layout('two_column_left_sidebar', '', $area2); page_draw($title, $body); ?>