/** * Returns entities ordered by the sum of an annotation * * @param unknown_type $entity_type * @param unknown_type $entity_subtype * @param unknown_type $name * @param string $mdname * @param string $mdvalue * @param unknown_type $owner_guid * @param int $limit * @param int $offset * @param true|false $count * @return unknown */ function get_entities_from_annotation_count($entity_type = "", $entity_subtype = "", $name = "", $mdname = '', $mdvalue = '', $owner_guid = 0, $limit = 10, $offset = 0, $orderdir = 'desc', $count = false) { return __get_entities_from_annotations_calculate_x('sum', $entity_type, $entity_subtype, $name, $mdname, $mdvalue, $owner_guid, $limit, $offset, $orderdir, $count); }
<?php /** * Front page for plugin repository */ //Newest $newest = elgg_get_entities(array('type' => 'object', 'subtype' => 'plugin_project')); //Most downloaded set_context('search'); $popular = __get_entities_from_annotations_calculate_x('count', 'object', 'plugin_project', 'download'); //Most dugg $dugg = __get_entities_from_annotations_calculate_x('count', 'object', 'plugin_project', 'plugin_digg'); //Last updated $updated = elgg_get_entities(array('object' => 'plugin_project', 'order_by' => 'e.time_updated desc')); set_context('plugin_project'); $welcome = elgg_view('plugins/front/main'); $sidebar = elgg_view('plugins/categories'); $bottom = elgg_view('plugins/front/bottom', array('newest' => $newest, 'updated' => $updated, 'popular' => $popular, 'dugg' => $dugg)); $body = elgg_view_layout('plugins_layout', $welcome, $sidebar, $bottom); page_draw(elgg_echo("plugins:all"), $body);