<?php require('layout/header.php'); ?>
<style type="text/css">
<!--
textarea {
width: 500px;
height: 38px;
margin: 5px 0 10px 0;
border: 1px solid #AAAAAA;
padding: 4px 2px;
font-family: sans-serif;
color: #737373;
overflow: auto;
font-size: 14px;
}
-->
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="functions/javascript/messagebox.js"></script>
<div id="content_wrapper">
<div class="content"><?php
if(!isset($_SESSION['signed_in'])) {
echo '<p class="false">' . $lang['just_for_users'] . '!</p>
<p>' . $lang['you_need_to'] . ' <a href="signin.php">' . $lang['signin_s'] . '</a>.
- ' . $lang['not_yet'] . ' <a href="signup.php">' . $lang['registered'] . '</a>?</p>';
}else{
echo '<table align="center" class="usertable">
<tr>
<td align="center"><ul class="usermenu">
<li><a href="myprofile.php">' . $lang['my_profile'] . '</a></li>
<li><a href="guestbook.php">' . $lang['guestbook'] . '</a></li>
<li><a href="messagebox.php">' . $lang['messagebox'] . '</a></li>
<li><a href="password.php">' . $lang['password'] . '</a></li>
<li><a href="inbox.php">' . $lang['inbox'] . '</a></li>
<li><a href="outbox.php">' . $lang['outbox'] . '</a></li>
<li><a href="create_pm.php">' . $lang['m_newpm'] . '</a></li>
<li><a href="mypostings.php">' . $lang['my_posts'] . '</a></li>
<li><a href="infos.php">' . $lang['informations'] . '</a></li>
<li><a href="todo.php">' . $lang['m_todo'] . '</a></li>
<li><a href="news.php">' . $lang['news'] . '</a></li>
</ul></td>
</tr>
<tr>
<td><h1>' . $lang['my_messagebox'] . '</h1>';
$id = (int)$_SESSION['user_id'];
include_once('functions/messagebox.php');
$tweet_sql = mysql_query("SELECT * FROM messagebox WHERE msg_id2 = '" . $id . "' ORDER BY msg_id DESC") OR die(mysql_error());
$timeline='';
while($row=mysql_fetch_assoc($tweet_sql)) {
$timeline.=formatTweet($row['message'],$row['date']);
}
$lastTweet = '';
list($lastTweet) = mysql_fetch_array(mysql_query("SELECT message FROM messagebox WHERE msg_id2 = '" . $id . "' ORDER BY msg_id DESC LIMIT 1"));
if(!$lastTweet) $lastTweet = '<p class="false">' . $lang['no_written_msg'] . '.</p>'; ?>
<div id="twitter-container">
<form id="tweetForm" action="create_msg.php" method="post">
<span class="counter">140</span>
<label for="inputField"><strong><?php echo $lang['whats_new']; ?>?</strong></label>
<textarea name="inputField" id="inputField" tabindex="1" rows="2" cols="40"></textarea>
<input class="submitButton inact" name="submit" type="submit" value="<?php echo $lang['publish']; ?>" disabled="disabled">
<span class="latest"><span class="blue"><?php echo $lang['newest_msg']; ?>:</span> <span id="lastTweet"><?=$lastTweet?></span></span>
<div class="clear"></div>
</form>
<div id="msg_line"> </div>
<label for="inputField"><strong>Message Timeline</strong></label>
<ul class="statuses"><?=$timeline?></ul>
</div>
<?php
echo '</td></tr>';
}
echo '</table>';
echo '<div class="spacer_div"> </div>';
?>
</div>
</div>
<div id="infobox_wrapper">
<div class="infobox">
<?php include('layout/infobox.php'); ?>
</div>
</div>
<?php require('layout/footer.php'); ?>