function set_ubb (&$bericht)
{
$bbcode = array('b' => 'b',
'i' => 'i',
'u' => 'u',
's' => 's',
'sub' => 'sub',
'sup' => 'sup',
'list' => 'ul');
$bericht = str_replace("\n","
",$bericht);
foreach($bbcode as $bb=>$code){
$bericht = preg_replace("#\[" . $bb . "\](.*?)\[/" . $bb . "\]#si","<" . $code . ">\\1" . $code . ">",$bericht);
}
$bericht = preg_replace("#\[kleur=(\#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/kleur\]#si","
\\2
",$bericht);
$bericht = preg_replace("#\[list=([a1]{1})\](.*?)\[/list\]#si","\\2
",$bericht);
$bericht = preg_replace("#\[email=(.*?)\](.*?)\[/email\]#si", "\\2", $bericht);
$bericht = preg_replace("#\[img\](.*?)\[/img\]#si","
",$bericht);
$bericht = preg_replace("#\[S\]#si"," ",$bericht);
$bericht = preg_replace("#\[url=(.*?)\](.*?)\[/url\]#si", "\\2", $bericht);
$bericht = preg_replace("#\[url_self=(.*?)\](.*?)\[/url_self\]#si", "\\2", $bericht);
$bericht = preg_replace("#\[quote\](.*?)\[/quote\]#si","Quote:
\\1
",$bericht);
$bericht = preg_replace("#\[quote=(.*?)\](.*?)\[/url\]#si","\\1 schreef:
\\2
",$bericht);
$bericht = preg_replace("#\[edit\](.*?)\[/edit\]#si","\\1
",$bericht);
$bericht = str_replace("[*]","",$bericht);
return $bericht;
}
function is_valid_email($email) {
$result = TRUE;
if(!preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i", $email)) {
$result = FALSE;
}
return $result;
}
function getUrlFriendlyString( $p_sValue )
{
$l_sUrl = strtolower( $p_sValue );
$l_aFind = array(' ',
'&',
'\r\n',
'\n',
'+');
$l_sUrl = str_replace ($l_aFind, '-', $l_sUrl);
$l_aFind = array('/[^a-z0-9\-<>]/',
'/[\-]+/',
'/<[^>]*>/');
$l_aRepl = array('',
'-',
'');
$l_sUrl = preg_replace ($l_aFind, $l_aRepl, $l_sUrl);
return $l_sUrl;
}
function getUrlNormal( $p_sValue )
{
$l_sUrl = strtolower( $p_sValue );
$l_aFind = array(' ',
'&',
'\r\n',
'\n',
'+');
$l_sUrl = str_replace ($l_aFind, ' ', $l_sUrl);
$l_aFind = array('/[^a-z0-9\-<>]/',
'/[\-]+/',
'/<[^>]*>/');
$l_aRepl = array('',
' ',
'');
$l_sUrl = preg_replace ($l_aFind, $l_aRepl, $l_sUrl);
return ucwords($l_sUrl);
}
function getVimeoInfo($link, $display)
{
if (preg_match('~^http://(?:www\.)?vimeo\.com/(?:clip:)?(\d+)~', $link, $match))
{
$id = $match[1];
}
else
{
$id = substr($link,10,strlen($link));
}
if (!function_exists('curl_init')) die('CURL is not installed!');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://vimeo.com/api/v2/video/$id.php");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$output = unserialize(curl_exec($ch));
$output = $output[0];
curl_close($ch);
return $output[$display];
}
?>
Buddy | BijlesBuddy