+// Very roughly, shrink the lines of var_export()
+// NOTE: If the same data exists, it must be corrupted.
+function var_export_shrink($expression, $return = FALSE)
+{
+ $result =preg_replace(
+ // Remove a newline and spaces
+ '# => \n *array \(#', ' => array (',
+ var_export($expression, TRUE)
+ );
+
+ if ($return) {
+ return $result;
+ } else {
+ echo $result;
+ return NULL;
+ }
+}
+
+function summarize_detail_badhost($progress = array())
+{
+ if (! isset($progress['is_spam']['badhost'])) return '';
+
+ return var_export_shrink($progress['blocked'], TRUE);
+}
+
+function summarize_detail_newtral($progress = array())
+{
+ if (! isset($progress['hosts']) || ! is_array($progress['hosts'])) return '';
+
+ // Sort by domain
+ $tmp = array();
+ foreach($progress['hosts'] as $value) {
+ $tmp[strrev($value)] = $value;
+ }
+ ksort($tmp);
+
+ return implode(', ', $tmp);
+}
+
+