<?php
if( !(preg_match("/^http:\/\/([-a-z0-9\.]+\.[a-z]{2,6}\/?[\-\_\%\{\}\/\#\~\:\?\;\=\.\+\&a-z0-9]*)$/i", $_GET['url'])) )
{
die("Неправильный URL<br> <a href='".$_GET['url']."'>".$_GET['url']."</a>");
}
else
{
header("HTTP/1.1 303 See Other");
header("location: ".$_GET['url']);
exit();
}
?><!-- BEGIN url --><a href="/redirect.php?url={URL}" target="_new" class="postlink">{DESCRIPTION}</a><!-- END url -->function make_clickable($text)
{
$text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text);
// pad it with a space so we can match things at the start of the 1st line.
$ret = ' ' . $text;
// matches an "xxxx://yyyy" URL at the start of a line, or after a space.
// xxxx can only be alpha characters.
// yyyy is anything up to the first space, newline, comma, double quote or <
$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"/redirect.php?url=\\2\" target=\"_new\">\\2</a>", $ret);
// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
// zzzz is optional.. will contain everything up to the first space, newline,
// comma, double quote or <.
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"/redirect.php?url=http://\\2\" target=\"_new\">\\2</a>", $ret);
// matches an email@domain type address at the start of a line, or after a space.
// Note: Only the followed chars are valid; alphanums, "-", "_" and or ".".
$ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret);
// Remove our padding..
$ret = substr($ret, 1);
return($ret);
}Siava писал(а):по сути получилось создать полный аналог платного se_friendly_board, что установлен тут, а может и лучше
Siava писал(а): а может и лучше
Вернуться в Запросы модов для phpBB 2.0.x
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 0