In "vier" the tag line is now suppressed. It saves a little bit of space - and is redundant.
require_once('library/langdet/Text/LanguageDetect.php');
$naked_body = preg_replace('/\[(.+?)\]/','',$arr['body']);
$l = new Text_LanguageDetect;
- $lng = $l->detectConfidence($naked_body);
- $arr['postopts'] = (($lng['language']) ? 'lang=' . $lng['language'] . ';' . $lng['confidence'] : '');
+ //$lng = $l->detectConfidence($naked_body);
+ //$arr['postopts'] = (($lng['language']) ? 'lang=' . $lng['language'] . ';' . $lng['confidence'] : '');
+ $lng = $l->detect($naked_body, 3);
+
+ if (sizeof($lng) > 0) {
+ $postopts = "";
+
+ foreach ($lng as $language => $score) {
+ if ($postopts == "")
+ $postopts = "lang=";
+ else
+ $postopts .= ":";
+
+ $postopts .= $language.";".$score;
+ }
+ $arr['postopts'] = $postopts;
+ }
}
$arr['wall'] = ((x($arr,'wall')) ? intval($arr['wall']) : 0);
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
$l = new Text_LanguageDetect;
- $lng = $l->detectConfidence($naked_body);
+ //$lng = $l->detectConfidence($naked_body);
+ //$postopts = (($lng['language']) ? 'lang=' . $lng['language'] . ';' . $lng['confidence'] : '');
- $postopts = (($lng['language']) ? 'lang=' . $lng['language'] . ';' . $lng['confidence'] : '');
+ $lng = $l->detect($naked_body, 3);
+
+ if (sizeof($lng) > 0) {
+ $postopts = "";
+
+ foreach ($lng as $language => $score) {
+ if ($postopts == "")
+ $postopts = "lang=";
+ else
+ $postopts .= ":";
+
+ $postopts .= $language.";".$score;
+ }
+ }
logger('mod_item: detect language' . print_r($lng,true) . $naked_body, LOGGER_DATA);
}
localize_item($item);
if ($item["postopts"]) {
- $langdata = explode(";", $item["postopts"]);
- $langstr = substr($langdata[0], 5)." (".round($langdata[1]*100, 1)."%)";
+ //$langdata = explode(";", $item["postopts"]);
+ //$langstr = substr($langdata[0], 5)." (".round($langdata[1]*100, 1)."%)";
+ $langstr = "";
+ if (substr($item["postopts"], 0, 5) == "lang=") {
+ $postopts = substr($item["postopts"], 5);
+
+ $languages = explode(":", $postopts);
+
+ if (sizeof($languages) == 1) {
+ $languages = array();
+ $languages[] = $postopts;
+ }
+
+ foreach ($languages as $language) {
+ $langdata = explode(";", $language);
+ if ($langstr != "")
+ $langstr .= ", ";
+
+ //$langstr .= $langdata[0]." (".round($langdata[1]*100, 1)."%)";
+ $langstr .= round($langdata[1]*100, 1)."% ".$langdata[0];
+ }
+ }
}
$body = prepare_body($item,true);
max-width: 660px;
word-wrap: break-word;
line-height: 1.36;
+ padding-bottom: 6px;
}
.wall-item-container .wall-item-content img {
.wall-item-tags {
padding-top: 1px;
padding-bottom: 2px;
+ display: none;
}
+
.tag {
color: rgb(153,153,153);
padding-left: 3px;