webForumDet fria alternativet

Funktions fel

PHP

0 svar · 144 visningar · startad av mr.mainline

Medlem sedan feb. 2003777 inlägg
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=&quot;(.*)&quot;\](.*?)\[\/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';

?>
254 ms totalt · 4 externa anrop · v20260731065814-full.a51de22e
121 ms — deklarationer (db)
0 ms — hämta statistik (cache)
127 ms — hämta tråd, inlägg och bilagor (db)
125 ms — ändringar (db)