Commit dc4e335d by Scott

Fix calls to qa_format_number

Decimals parameter takes effect when compact option is off.
parent 8f780c62
......@@ -138,7 +138,7 @@
$ranking['items'][] = array(
'avatar' => $avatarhtml,
'label' => $usershtml[$user['userid']],
'score' => qa_html(qa_format_number($user['points'], 1, true)),
'score' => qa_html(qa_format_number($user['points'], 0, true)),
'raw' => $user,
);
}
......@@ -163,7 +163,7 @@
foreach ($tags as $tag) {
$ranking['items'][] = array(
'label' => qa_tag_html($tag['word'], false, true),
'count' => qa_html(qa_format_number($tag['tagcount'], 1, true)),
'count' => qa_html(qa_format_number($tag['tagcount'], 0, true)),
);
}
......@@ -187,7 +187,7 @@
$cat_url = qa_path_html( 'questions/' . implode( '/', array_reverse(explode('/', $category['backpath'])) ) );
$cat_anchor = $category['qcount'] == 1
? qa_lang_html_sub('main/1_question', '1', '1')
: qa_lang_html_sub('main/x_questions', qa_format_number($category['qcount'], 1, true));
: qa_lang_html_sub('main/x_questions', qa_format_number($category['qcount'], 0, true));
$cat_descr = strlen($category['content']) ? qa_html(' - '.$category['content']) : '';
$nav_list_categories['nav'][$category['categoryid']] = array(
......
......@@ -318,7 +318,7 @@
$fields['answers_raw']=$post['acount'];
$fields['answers']=($post['acount']==1) ? qa_lang_html_sub_split('main/1_answer', '1', '1')
: qa_lang_html_sub_split('main/x_answers', qa_format_number($post['acount'], 1, true));
: qa_lang_html_sub_split('main/x_answers', qa_format_number($post['acount'], 0, true));
$fields['answer_selected']=isset($post['selchildid']);
}
......@@ -327,7 +327,7 @@
$fields['views_raw']=$post['views'];
$fields['views']=($post['views']==1) ? qa_lang_html_sub_split('main/1_view', '1', '1') :
qa_lang_html_sub_split('main/x_views', qa_format_number($post['views'], 1, true));
qa_lang_html_sub_split('main/x_views', qa_format_number($post['views'], 0, true));
}
if (@$options['categoryview'] && isset($post['categoryname']) && isset($post['categorybackpath'])) {
......@@ -401,8 +401,8 @@
// Create HTML versions...
$upvoteshtml = qa_html(qa_format_number($upvotes, 1, true));
$downvoteshtml = qa_html(qa_format_number($downvotes, 1, true));
$upvoteshtml = qa_html(qa_format_number($upvotes, 0, true));
$downvoteshtml = qa_html(qa_format_number($downvotes, 0, true));
if ($netvotes >= 1)
$netvotesPrefix = '+';
......@@ -412,7 +412,7 @@
$netvotesPrefix = '';
$netvotes = abs($netvotes);
$netvoteshtml = $netvotesPrefix . qa_html(qa_format_number($netvotes, 1, true));
$netvoteshtml = $netvotesPrefix . qa_html(qa_format_number($netvotes, 0, true));
// ...with microformats if appropriate
......@@ -528,7 +528,7 @@
if (isset($post['points'])) {
if (@$options['pointsview'])
$fields['who']['points']=($post['points']==1) ? qa_lang_html_sub_split('main/1_point', '1', '1')
: qa_lang_html_sub_split('main/x_points', qa_format_number($post['points'], 1, true));
: qa_lang_html_sub_split('main/x_points', qa_format_number($post['points'], 0, true));
if (isset($options['pointstitle']))
$fields['who']['title']=qa_get_points_title_html($post['points'], $options['pointstitle']);
......@@ -854,7 +854,7 @@
if (isset($question['opoints'])) {
if (@$options['pointsview'])
$fields['who']['points']=($question['opoints']==1) ? qa_lang_html_sub_split('main/1_point', '1', '1')
: qa_lang_html_sub_split('main/x_points', qa_format_number($question['opoints'], 1, true));
: qa_lang_html_sub_split('main/x_points', qa_format_number($question['opoints'], 0, true));
if (isset($options['pointstitle']))
$fields['who']['title']=qa_get_points_title_html($question['opoints'], $options['pointstitle']);
......@@ -1243,7 +1243,7 @@
'label' => qa_html($category['title']),
'popup' => qa_html(@$category['content']),
'selected' => isset($selecteds[$category['categoryid']]),
'note' => $showqcount ? ('('.qa_html(qa_format_number($category['qcount'], 1, true)).')') : null,
'note' => $showqcount ? ('('.qa_html(qa_format_number($category['qcount'], 0, true)).')') : null,
'subnav' => qa_category_navigation_sub($parentcategories, $category['categoryid'], $selecteds,
$pathprefix.$category['tags'].'/', $showqcount, $pathparams, $favoritemap),
'categoryid' => $category['categoryid'],
......
......@@ -69,7 +69,7 @@
$navigation[$key]['note'].=
' - <a href="'.qa_path_html('questions/'.implode('/', array_reverse(explode('/', $category['backpath'])))).'">'.( ($category['qcount']==1)
? qa_lang_html_sub('main/1_question', '1', '1')
: qa_lang_html_sub('main/x_questions', qa_format_number($category['qcount'], 1, true))
: qa_lang_html_sub('main/x_questions', qa_format_number($category['qcount'], 0, true))
).'</a>';
if (strlen($category['content']))
......
......@@ -60,7 +60,7 @@
foreach ($populartags as $word => $count) {
$qa_content['ranking']['items'][] = array(
'label' => qa_tag_html($word, false, @$favoritemap['tag'][qa_strtolower($word)]),
'count' => qa_format_number($count, 1, true),
'count' => qa_format_number($count, 0, true),
);
if ((++$output) >= $pagesize)
......
......@@ -66,7 +66,7 @@
$qa_content['ranking']['items'][] = array(
'avatar' => $avatarhtml,
'label' => $usershtml[$user['userid']],
'score' => qa_html(qa_format_number($user['points'], 1, true)),
'score' => qa_html(qa_format_number($user['points'], 0, true)),
'raw' => $user,
);
}
......
......@@ -56,7 +56,7 @@ class qa_activity_count
if ($value==1)
$themeobject->output(qa_lang_html_sub($langsingular, '<span class="qa-activity-count-data">1</span>', '1'));
else
$themeobject->output(qa_lang_html_sub($langplural, '<span class="qa-activity-count-data">'.qa_format_number((int) $value, 1, true).'</span>'));
$themeobject->output(qa_lang_html_sub($langplural, '<span class="qa-activity-count-data">'.qa_format_number((int) $value, 0, true).'</span>'));
$themeobject->output('</p>');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment