Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: asmenines zinutes

Parašė MAnjack· 2008 Lie. 4 09:07:46
#7

Va tikrai veikianti:
$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();
}