Parašė WyPuk· 2010 Kov. 13 13:03:35
#8
Bandyk šitą
$msg_count = dbcount("(message_id)", "messages", "message_to='".$userdata['user_id']."' AND message_read='0'AND message_folder='0'");
if ($_POST['uzdaryti']) {
$result = dbquery("UPDATE ".DB_PREFIX."messages SET message_read=1 WHERE message_id='".$_POST['message_id']."'");
redirect(FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : ""));
}
if ($_POST['atsakyti']) {
$result = dbquery("UPDATE ".DB_PREFIX."messages SET message_read=1 WHERE message_id='".$_POST['message_id']."'");
redirect(BASEDIR."messages.php?folder=inbox&msg_send=".$_POST['message_from']."&msg_id=".$_POST['message_id']);
}
if ($msg_count != 0) {
openside("<blink>Nauja AŽ!</blink>");
$data = dbarray(dbquery("SELECT tm.*, tu.user_id,user_name,user_avatar FROM ".DB_PREFIX."messages tm
LEFT JOIN ".DB_PREFIX."users tu ON tm.message_from=tu.user_id WHERE message_to='".$userdata['user_id']."' && message_read=0 ORDER BY message_datestamp DESC LIMIT 1"));
echo "<center><a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'><b>".$data['user_name']."</b></a>
<br><img src='".IMAGES.($data['user_avatar'] ? "avatars/".$data['user_avatar'] : "noav.gif")."' alt='Siuntėjo Avataras'></center><small>".($data['message_smileys'] == 1 ? $data['message_message'] : parsesmileys($data['message_message']))."</small><br><br>
<form method='post' action='' name='submitform'><center>
<input type='hidden' name='message_id' value='".$data['message_id']."'>
<input type='hidden' name='message_from' value='".$data['message_from']."'>
<input type='submit' class='button' name='atsakyti' value='Atsakyti'>
<input type='submit' class='button' name='uzdaryti' value='Uždaryti'>
</center></form>";
closeside();
}
Redagavo WyPuk· 2010 Kov. 13 13:03:11