Commit bbbbd6bb by Scott

Tag Cloud: keep showing tags at minimum size

Also set a readable default size and some more code formatting.
parent 105c7434
...@@ -33,9 +33,10 @@ ...@@ -33,9 +33,10 @@
// Collect the question ids of all items in the question list (so we can do this in one DB query) // Collect the question ids of all items in the question list (so we can do this in one DB query)
$postids = array(); $postids = array();
foreach ($q_list['qs'] as $question) foreach ($q_list['qs'] as $question) {
if (isset($question['raw']['postid'])) if (isset($question['raw']['postid']))
$postids[] = $question['raw']['postid']; $postids[] = $question['raw']['postid'];
}
if (!empty($postids)) { if (!empty($postids)) {
...@@ -52,7 +53,7 @@ ...@@ -52,7 +53,7 @@
// Now add the popup to the title for each question // Now add the popup to the title for each question
foreach ($q_list['qs'] as $index => $question) foreach ($q_list['qs'] as $index => $question) {
if (isset($postinfo[$question['raw']['postid']])) { if (isset($postinfo[$question['raw']['postid']])) {
$thispost = $postinfo[$question['raw']['postid']]; $thispost = $postinfo[$question['raw']['postid']];
$text = qa_viewer_text($thispost['content'], $thispost['format'], array('blockwordspreg' => $blockwordspreg)); $text = qa_viewer_text($thispost['content'], $thispost['format'], array('blockwordspreg' => $blockwordspreg));
...@@ -60,6 +61,7 @@ ...@@ -60,6 +61,7 @@
$title = isset($question['title']) ? $question['title'] : ''; $title = isset($question['title']) ? $question['title'] : '';
$q_list['qs'][$index]['title'] = sprintf('<span title="%s">%s</span>', qa_html($text), $title); $q_list['qs'][$index]['title'] = sprintf('<span title="%s">%s</span>', qa_html($text), $title);
} }
}
} }
} }
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
if ($option === 'tag_cloud_font_size') if ($option === 'tag_cloud_font_size')
return 24; return 24;
if ($option === 'tag_cloud_minimal_font_size') if ($option === 'tag_cloud_minimal_font_size')
return 5; return 8;
if ($option === 'tag_cloud_size_popular') if ($option === 'tag_cloud_size_popular')
return true; return true;
} }
...@@ -134,8 +134,8 @@ ...@@ -134,8 +134,8 @@
if (empty($matches)) { if (empty($matches)) {
if ($scale) { if ($scale) {
$size = number_format($maxsize * $count / $maxcount, 1); $size = number_format($maxsize * $count / $maxcount, 1);
if ($size < $minsize) // Size is too small so stop processing if ($size < $minsize)
break; $size = $minsize;
} else } else
$size = $maxsize; $size = $maxsize;
......
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