Location: PHPKode > scripts > WH Board > wh_board/outbox.php
<?php require('style/layout/header.php'); ?>

    <div class="content_left">
        <ul id="breadcrumbs">
            <li><a href="index.php"><?php echo $lang['main_page']; ?></a></li>
            <li><a href="myprofile.php"><?php echo $lang['user_area']; ?></a></li>
            <li><a href="outbox.php" class="actual"><?php echo $lang['outbox']; ?></a></li>
        </ul>
    </div>
    <div class="content_right"><form method="post" id="search" action="search.php?search">
        <input type="text" name="search" placeholder="<?php echo $lang['enter_search_term']; ?>..." class="searchfield">
        <input type="hidden" name="submit" value="<?php echo $lang['search']; ?>" alt="<?php echo $lang['search']; ?>">
        </form>
    </div>

    <div class="clear"></div>

    <div id="headline">&nbsp;</div>

    <?php

        if(!isset($_SESSION['signed_in'])) {

		echo '<p class="false">' . $lang['only_for_registered'] . '</p>
        <p>' . $lang['you_have_to'] . ' <a href="signin.php">' . $lang['small_signin'] . '</a>. ' . $lang['not_yet'] . ' <a href="signup.php">' . $lang['registered'] . '</a>?</p>';

		}else{

		echo '<h1>' . $lang['outbox']. '</h1>';

		$query = mysql_query("SELECT
                                  m1.msg_id, m1.msg_title, m1.msg_date, count(m2.msg_id) AS reps, users.user_id AS user_id, users.user_name
                              FROM
                                  messages AS m1, messages AS m2,users
                              WHERE
                                  ((m1.msg_user1 = '" . (int)$_SESSION['user_id'] . "'
                              AND
                                  m1.msg_user1read = 'yes'
                              AND
                                  users.user_id = m1.msg_user2)
                              OR
                                  (m1.msg_user2 = '" . (int)$_SESSION['user_id'] . "'
                              AND
                                  m1.msg_user2read = 'yes'
                              AND
                                  users.user_id = m1.msg_user1))
                              AND
                                  m1.msg_id2 = '1'
                              AND
                                  m2.msg_id = m1.msg_id
                              GROUP BY
                                  m1.msg_id
                              ORDER BY
                                  m1.msg_id DESC") OR die(mysql_error());

		if(intval(mysql_num_rows($query)) > 0) {

		echo '<table width="100%" class="tables">
        <tr>
        <td width="20%"><strong>' . $lang['receiver'] . '</strong></td>
        <td width="55%"><strong>' . $lang['subject'] . '</strong></td>
        <td width="10%"><strong>' . $lang['replies'] . '</strong></td>
        <td width="15%"><strong>' . $lang['date'] . '</strong></td>
        </tr>';

		while($row = mysql_fetch_assoc($query)) {

			$answer = $row['reps'] - 1;

            echo '<tr>
            <td width="20%"><a href="profile.php?user_id=' . (int)$row['user_id'] . '">' . htmlentities($row['user_name'], ENT_QUOTES) . '</a></td>
            <td width="55%"><a href="read_pm.php?user_id=' . (int)$_SESSION['user_id'] . '&msg_id=' . (int)$row['msg_id'] . '">' . htmlentities($row['msg_title'], ENT_QUOTES) . '</a></td>
            <td width="10%">' . $answer . '</td>
            <td width="15%">' . date('d.m.Y - H:i', strtotime($row['msg_date'])) . '</td>
            </tr>';
            }

        echo '</table>';

		}else{

		echo '<p class="false">' . $lang['no_pm_sendet'] . '</p>';
		}
		}

	?>

<?php require('style/layout/footer.php'); ?>
Return current item: WH Board