Требуется изменить скрипт таким образом, что бы ссылки автоматически становились активными. Предположительно для этого нужно вставить $com = auto_link($com);
function auto_link($proto){
$proto = ereg_replace("(https?|ftp|news)(://[[:alnum:]+$;?.%,!#~*/:@&=_-]+)","<a href="\1\2" target="_blank">\1\2</a>",$proto);
return $proto;
} в нужное место в inc/html.php или вот это function autolink($str, $attributes=array()) {
$attrs = '';
foreach ($attributes as $attribute => $value) {
$attrs .= " {$attribute}="{$value}"";
}
$str = ' ' . $str;
$str = preg_replace(
'`([^"='>])((http|https|ftp)://[^s<]+[^s<.)])`i',
'$1<a href="$2"'.$attrs.'>$2</a>',
$str
);
$str = substr($str, 1);
return $str;
}
Опубликован 14.12.2014 в 15:26
Заказ находится в архиве