function q_item_stats($q_item) // add view count to question list
{
$this->output('<DIV CLASS="qa-q-item-stats">');
$this->voting($q_item);
$this->a_count($q_item);
$this->output('<DIV CLASS="qa-view-count">');
$this->output(
'<SPAN CLASS="qa-view-count-data">',
$this->short_num($q_item['raw']['views']),
'</SPAN>'
);
$this->output('<span class="qa-view-count-pad">views</span>');
$this->output('</DIV>');
$this->output('</DIV>');
}
function view_count($q_item) // prevent display of view count in the usual place
{
}
function short_num($num, $precision = 1) {
if ($num >= 1000 && $num < 1000000) {
$n_format = number_format($num/1000,$precision).'K';
} else if ($num >= 1000000 && $num < 1000000000) {
$n_format = number_format($num/1000000,$precision).'M';
} else if ($num >= 1000000000) {
$n_format=number_format($num/1000000000,$precision).'B';
} else {
$n_format = $num;
}
return $n_format;
}