Here is how my Profile.php looks:
function usersrecentposts ()
{
global $userid, $viewscount, $censored, $user, $membergroups, $settings, $username, $yytitle, $txt, $enable_ubbc;
global $cgi, $img, $imagesdir, $enable_notification, $maxmessagedisplay, $color, $scripturl, $menusep, $db_prefix;
$display = $viewscount;
if (!is_numeric($display))
fatal_error($txt[337]);
$request = mysql_query("SELECT realName FROM {$db_prefix}members WHERE ID_MEMBER=$userid LIMIT 1") or database_error(__FILE__, __LINE__);
list($realName) = mysql_fetch_row($request);
$permit = 0;
if ($settings[7] == 'Administrator' || $settings[7] == 'Global Moderator')
$permit = 1;
$limitString = ($display != '0') ? " LIMIT $display" : '';
$request = mysql_query("
SELECT m.*,t.numReplies,c.memberGroups,c.name as cname,b.name as bname,b.ID_BOARD
FROM {$db_prefix}messages as m, {$db_prefix}topics as t, {$db_prefix}boards as b, {$db_prefix}categories as c, {$db_prefix}members as mem
WHERE
m.ID_MEMBER=$userid
AND
m.ID_TOPIC=t.ID_TOPIC
AND
t.ID_BOARD=b.ID_BOARD
AND
b.ID_CAT=c.ID_CAT
AND (FIND_IN_SET('$settings[7]',c.memberGroups) != 0 || $permit || c.memberGroups='')
AND
mem.ID_MEMBER=m.ID_MEMBER
".AU_GetWhereClause('AND', 'b.', false)." ORDER BY m.posterTime DESC$limitString") or database_error(__FILE__, __LINE__);
$yytitle = "$txt[458] $user";
template_header();
$euser = urlencode($user);
echo '<p align=left><a href="' . $cgi . ';action=viewprofile;user=' . $euser . '"><font size="2"><b>' . $txt[92] . ' ' . $realName . '</b></font></a></p>';
$counter = 1;
while ($row = mysql_fetch_assoc($request))
{
CensorTxt($row['body']);
CensorTxt($row['subject']);
Anything wrong with it?