#1
Посоветуйте как правильно сделать?
Spoiler content hidden.
function make_url_clickable_callback ($m)
{
$max_len = 70;
$href = $m[1];
$name = (mb_strlen($href, 'UTF-8') > $max_len) ? mb_substr($href, 0, $max_len - 19) .'...'. mb_substr($href, -16) : $href;
return "<a rel=\"nofollow\" href=\"$href\" class=\"postLink\">$name</a>";
} else if ($user_sig)
{
$user_sig = bbcode2html($user_sig);
$user_sig = str_replace('<a','<a rel="nofollow"',$user_sig);
}function url2nofollow($s){
if(!stristr($s,'http://mysite1.ru') AND !stristr($s,'http://mysite2.ru') AND !stristr($s,'http://mysite3.ru') AND !stristr($s,'http://mysite4.ru') AND !stristr($s,'http://mysite5.ru')){
$s = str_replace('<a','<a rel="nofollow"',$s);
return preg_replace('/(<a .*?href=\")([^>]+?)/i', '$1/out.php?url=$2', $s);
}
else return $s;
} 'MESSAGE' => url2nofollow($message),
<?php
$url=(isset($_GET['url'])) ? $_GET['url'] : '/';
if($url!='/' && stripos($url, 'http://')===false) $url='http://'.$url;
header('Location: '.$url);
?>