Frågan#1
Tjenare!!
Jag har hittat en gästbok på nätet som jag är ganska nöjd med det är bara det att när dom som skiver i gb fyller i sin webadress så vill jag att den öppnas i en nytt fönster _blank men den öppnas i framen som jag har gästboken i,hur ändar jag det?
Här är funktions sidan.
<?
function _bui($str) {
while (substr_count($str, '[b]') > substr_count($str, '[/b]')) {
$str .= '[/b]';
} while (substr_count($str, '[u]') > substr_count($str, '[/u]')) {
$str .= '[/u]';
} while (substr_count($str, '[i]') > substr_count($str, '[/i]')) {
$str .= '[/i]';
}
$ett = array('[b]','[/b]','[u]','[/u]','[i]','[/i]');
$tva = array('<B>','</b>','<u>','</u>','<i>','</i>');
$str = str_replace($ett, $tva, $str);
return $str;
}
function _cs($str) {
while (substr_count($str, '[color') > substr_count($str, '[/color]')) {
$str .= '[/color]';
} while (substr_count($str, '[size') > substr_count($str, '[/size]')) {
$str .= '[/size]';
}
$str = preg_replace("/\[color\=#?([abcdefABCDEF0-9]+)\]/","<span style=\"color:#$1\">",$str);
$str = preg_replace("/\[size\=(\d{2})\]/","<span style=\"font-size:$1px\">",$str);
$str = str_replace('[/color]', '</span>', $str);
$str = str_replace('[/size]', '</span>', $str);
return $str;
}
function _qoute($str) {
while (substr_count($str, '[qoute') > substr_count($str, '[/qoute]')) {
$str .= '[/qoute]';
}
$str = preg_replace('/\[quote="(.*)"\](.*?)\[\/quote\]/i', '<blockquote><b>\\1 skrev:</b><br>\\2</blockquote>', $str);
$str = preg_replace('/\[quote="(.*)"\](.*?)\[\/quote\]/i', '<blockquote><b>\\1 skrev:</b><br>\\2</blockquote>', $str);
$str = str_replace('[quote]', '<blockquote><b>Citat:</b><br>', $str);
$str = str_replace('[/quote]', '</blockquote>', $str);
return $str;
}
function _link($str) {
$str = preg_replace("/(?<!\[img\])(https?:\/\/|ftp:\/\/)([^<>\s\"\']+\.[^<>\s\"\']+)/i", "<a href=\"\\0\" target=\"_blank\">\\2</a>", $str);
return $str;
}
function _img($str) {
$str = preg_replace("/\[img\](.*)\[\/img\]/i", '<img src="\\1" alt="" />', $str);
return $str;
}
include 'smileys.php';
?>
