$post_sigline = "";
}
if (empty($row_user[forum_avatar])) {
    $avatar = "<img src='http://s3.shastrix.co.uk/forum/avatars/0.png' height='90' width='90' border='0' alt='Avatar' />";
} else {
    switch ($row_user['forum_avatartype']) {
        case 1:
            $ext = ".gif";
            break;
        case 2:
            $ext = ".jpg";
            break;
    }
    $avatar = "<img src='http://s3.shastrix.co.uk/forum/avatars/" . $post_userid . $ext . "' height='90' width='90' border='0' alt='Avatar' />";
}
$post_scno = semicircle($post_rankno, $post_posts);
if (!empty($row_user['location'])) {
    $post_location = "Locale: " . $row_user['location'];
}
$print_preview .= <<<EOD

<table width="800" cellspacing="0" align="center">

  <tr>
    <td width="110" height="200" rowspan="2" style="background-color:{$post_colour};" class="idbox" align="left">

<center>
<font style="font-size:12px; font-weight:bold;">{$post_user}</font>
<a href="index.php?show=profile&amp;user={$post_userid}">{$avatar}</a><br />

{$post_rank}</center><br />
    exit;
}
$sql = "SELECT realname, forum_accesslevel, blog_user, startdate, forum_posts, forum_avatar, forum_pmallowed, forum_lastactive, website, location, occupation, interests, bio, forum_avatartype FROM users WHERE number = '{$showuser}'";
$request = $mysqli->query($sql) or die($mysqli->error);
$row = $request->fetch_assoc();
//if they are banned then only mods can see their user page
if ($row['forum_accesslevel'] < 0 && $_SESSION['forums_accesslevel'] < 7) {
    header("Location: index.php?show=userlist");
    exit;
}
$posts = $row['forum_posts'];
$name = $row['realname'];
$rank = moderatorlevels($row['forum_accesslevel'], $posts);
$rank2 = $row['forum_accesslevel'];
$col = moderatorcolours($row['forum_accesslevel'], $posts);
$sc = semicircle($rank2, $posts);
$startdate = $row['startdate'];
$lastactive = date('Y-m-d', strtotime($row['forum_lastactive']));
if ($row['blog_user'] == 1) {
    $blog = "<a href='http://www.shastrix.com/blogs?blog={$name}' target='_blank'>My blog</a><br />";
}
if (empty($row['forum_avatar'])) {
    $avatar = "<img src='http://s3.shastrix.co.uk/forum/avatars/0.png' height='90' width='90' border='0'>";
} else {
    switch ($row['forum_avatartype']) {
        case 1:
            $ext = ".gif";
            break;
        case 2:
            $ext = ".jpg";
            break;
$row_user = $request_user->fetch_assoc();
if (!empty($row_user['location'])) {
    $from_location = "Location: " . $row_user['location'];
}
$from_posts = $row_user['forum_posts'];
$from_name = $row_user['forum_realname'];
if (strlen($from_name) > 12) {
    //whack in a line break
    $post_user_split = chunk_split($from_name);
    $from_name = $post_user_split[0] . $post_user_split[1] . $post_user_split[2] . $post_user_split[3] . $post_user_split[4] . $post_user_split[5] . $post_user_split[6] . $post_user_split[7] . $post_user_split[8] . $post_user_split[9] . $post_user_split[10] . $post_user_split[11] . "<br>" . $post_user_split[12] . $post_user_split[13] . $post_user_split[14] . $post_user_split[15];
}
$from_rankno = $row_user['forum_accesslevel'];
$from_rank = moderatorlevels($row_user['forum_accesslevel'], $from_posts);
$from_colour = moderatorcolours($row_user['forum_accesslevel'], $from_posts);
$from_bg = backgroundcolours($from_rankno, $from_posts);
$from_scno = semicircle($from_rankno, $from_posts);
if (empty($row_user['forum_avatar'])) {
    $avatar = "<img src='avatars/0.gif' height='90' width='90' border='0'>";
} else {
    switch ($row_user['forum_avatartype']) {
        case 1:
            $ext = ".gif";
            break;
        case 2:
            $ext = ".jpg";
            break;
    }
    $avatar = "<img src='http://s3.shastrix.co.uk/forum/avatars/" . $pm_from . $ext . "' height='90' width='90' border='0'>";
}
//and print
$print_pm .= <<<EOD
//check whether quest posting is enabled
if ($row_topic['topic_guest'] == 0) {
    header("Location:?");
    exit;
}
$post_text = stripslashes($_POST['post_text']);
$post_text2 = htmlentities($post_text, ENT_QUOTES);
$post_text_preview = craptohtml($post_text);
$usernumber = 0;
$post_userid = 0;
$post_user = "******";
$post_rankno = 0;
$post_rank = moderatorlevels(0, 1);
$post_colour = moderatorcolours(0, 1);
$post_bg = backgroundcolours(0, 1);
$post_scno = semicircle(0, 1);
$post_posts = 1;
$post_sig = "</td></tr><tr><td class='bottomall' style='background-color:{$post_bg}'>&nbsp;";
$post_sigline = "";
$avatar = "<img src='http://s3.shastrix.co.uk/forum/avatars/guest.jpg' height='90' width='90' border='0' alt='Avatar' />";
//the thing to test they are a real person and not a random bot from somewhere
$test_no = rand(1, 12);
switch ($test_no) {
    case 1:
        $test_q = "";
        //how many sides
        $test_img = "1001.gif";
        break;
    case 2:
        $test_q = "";
        //how many sides