I want to extend the user profile with a rank (a decimal ranging from 500 - 2500), which needs to be updated on a regular basis (10 times per minute) for several users. (it is for http://achtungdiekurve.net/ ) I already implemented it with a seperate table, containing a rank field and implemented a table to show the rankings (http://achtungdiekurve.net/ranks ).
However, I want to use views to create this table. But I cant seem to alter the entity type user in such a way, that it shows Rank in the views forms. How to do this? My current code:
<?php
function achtung_entity_property_info_alter(&$info) {
$info["user"]["properties"]["rank"] = array(
"label" => t("Rank"),
"description" => t("The rank of the user"),
"type" => "decimal",
"getter callback" => "achtung_get_entity_callback",
"computed" => true,
"entity views field" => true,
"query callback" => "entity_property_query",
);
watchdog("ACHTUNG entity info alter", "<pre>".print_r($info, true)."</pre>");
return $info;
}
function achtung_get_entity_callback($account, $options, $name, $entity_type) {
watchdog("ACHTUNG entity info callback", "<pre>".print_r($account, true)."</pre>");
return 2;
}
?>