blog_count; if ($count < 1) { $count = 8; } // get view mode $view_mode = $widget->view_mode; // backup context and set switch($view_mode){ case "slider": elgg_push_context("slider"); break; case "preview": elgg_push_context("preview"); break; case "simple": elgg_push_context("simple"); break; default: elgg_push_context("listing"); break; } $options = array( "type" => "object", "subtype" => "blog", "limit" => $count, "full_view" => false, "pagination" => false, "metadata_name_value_pairs" => array() ); // only show published blogs to non admins if (!elgg_is_admin_logged_in()) { $options["metadata_name_value_pairs"][] = array( "name" => "status", "value" => "published" ); } // limit to featured blogs? if ($widget->show_featured == "yes") { $options["metadata_name_value_pairs"][] = array( "name" => "featured", "value" => true ); } $blogs = elgg_list_entities_from_metadata($options); if (!empty($blogs)) { if ($view_mode == "slider") { $blog_entities = elgg_get_entities_from_metadata($options); echo "
"; echo " "; ?>