<?php

function textFormat($text,$page = "presentation",$admin = 0)
{
	if ($admin < 3)
		$text = htmlentities($text);

	$pattern = array (
	    "/\[line\]/is",
	    "/\[user=(.*?)]/is",
	);

	$replace = array (
	   "<hr color=\"black\" style=\"height:1px;\" noshade>",
	   getUserid($1),
	);
	
	$text = preg_replace($pattern, $replace, $text);
	$text = nl2br($text);
	return $text;
}


function getUserid($name)
{
	$query = "select from X where username = '".$name."'";
	//osv   :)

	return "<a href=\"".HOST."/community/u.presentation.php?id=".$rw["id"]."\">$name</a>";
}

?>