X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fitem.php;h=91a94974e9a232cd0b7c1e2a55893fe0ee69c41b;hb=b53ae0d42af7cc4c2a682bec7229669dba114ca6;hp=a5f483b3524089f778a226b792fae04c845473de;hpb=d2a593b4a03442ce16c6227cb29d79b496c04d2d;p=friendica.git diff --git a/mod/item.php b/mod/item.php index a5f483b352..91a94974e9 100644 --- a/mod/item.php +++ b/mod/item.php @@ -18,7 +18,6 @@ require_once('include/crypto.php'); require_once('include/enotify.php'); require_once('include/email.php'); -require_once('library/langdet/Text/LanguageDetect.php'); require_once('include/tags.php'); require_once('include/files.php'); require_once('include/threads.php'); @@ -268,32 +267,8 @@ function item_post(&$a) { $guid = get_guid(32); - $naked_body = preg_replace('/\[(.+?)\]/','',$body); - - if (version_compare(PHP_VERSION, '5.3.0', '>=')) { - $l = new Text_LanguageDetect; - //$lng = $l->detectConfidence($naked_body); - //$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); - } - else - $postopts = ''; + item_add_language_opt($_REQUEST); + $postopts = $_REQUEST['postopts'] ? $_REQUEST['postopts'] : ""; $private = ((strlen($str_group_allow) || strlen($str_contact_allow) || strlen($str_group_deny) || strlen($str_contact_deny)) ? 1 : 0); @@ -674,7 +649,7 @@ function item_post(&$a) { $notify_type = (($parent) ? 'comment-new' : 'wall-new' ); - $uri = (($message_id) ? $message_id : item_new_uri($a->get_hostname(),$profile_uid)); + $uri = (($message_id) ? $message_id : item_new_uri($a->get_hostname(),$profile_uid, $guid)); // Fallback so that we alway have a thr-parent if(!$thr_parent)