Для работы ссылок ВВ [img] [url] Для работы ссылок ВВ [img] [url]
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

Для работы ссылок ВВ [img] [url]

Started by lineart, April 23, 2011, 09:52:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lineart

Для работы ссылок ВВ- img, url с использованием РУССКИХ букв, типа
_ttp://www/search-thumbnails-русский.html

Необходимо добавить в файл include/functions.inc.php символы \x7f-\xff
====
function make_clickable($text)
{
    $ret = ' '.$text;
        $ret = preg_replace("#([\n ])([a-z]+?)://([a-z0-9\x7f-\xff\-\.,\?!%\*_\#:;~\\&$@\/=\+]+)#i", "\\1<a href=\"\\2://\\3\" rel=\"external\">\\2://\\3</a>", $ret);
        $ret = preg_replace("#([\n ])www\.([a-z0-9\x7f-\xff\-]+)\.([a-z0-9\x7f-\xff\-.\~]+)((?:/[a-z0-9\x7f-\xff\-\.,\?!%\*_\#:;~\\&$@\/=\+]*)?)#i", "\\1<a href=\"http://www.\\2.\\3\\4\" rel=\"external\">www.\\2.\\3\\4</a>", $ret);
        $ret = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)?[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret);
        return substr($ret, 1);
}
====