«««Հեսա եսի ընթանուր կոդնա.PHP կոդ:
<div class="tab_container">
<div class="generic_layout_container layout_user_list_popular">
<ul>
<?
$query_mess_dialogue = "SELECT *
FROM `messages`
WHERE sender_uid='$ses_uid'
OR
recipient_uid='$ses_uid'
GROUP BY
CASE WHEN `sender_uid`='$ses_uid' THEN recipient_uid
WHEN `recipient_uid`='$ses_uid' THEN sender_uid END";
$resultmessages_dialogue = mysql_query($query_mess_dialogue);
while($rowpmessages_dialogue = mysql_fetch_array($resultmessages_dialogue))
{
$r_mess = $rowpmessages_dialogue;
$r_sender = $r_mess['sender_uid'];
$r_recipient = $r_mess['recipient_uid'];
$query_mess_user_sender = mysql_query("SELECT * FROM users WHERE uid='$r_sender'");
$resultmessages_user_sender = mysql_fetch_array($query_mess_user_sender);
$query_mess_user_recipient = mysql_query("SELECT * FROM users WHERE uid='$r_recipient'");
$resultmessages_user_recipient = mysql_fetch_array($query_mess_user_recipient);
$r_sender_profile_photo = $resultmessages_user_sender['profile_photo'];
$query_sender_profile_photo = mysql_query("SELECT * FROM photos WHERE id='$r_sender_profile_photo'");
$result_sender_profile_photo = mysql_fetch_array($query_sender_profile_photo);
$r_recipient_profile_photo = $resultmessages_user_recipient['profile_photo'];
$query_recipient_profile_photo = mysql_query("SELECT * FROM photos WHERE id='$r_recipient_profile_photo'");
$result_recipient_profile_photo = mysql_fetch_array($query_recipient_profile_photo);
echo '
<div id="m_file_b" style="margin-bottom:10px;" onclick="document.location.href="фы"">
<a href="?id='.$resultmessages_user_sender['id'].'"><img src="uploads/photos/'.$result_sender_profile_photo['photo'].'.jpg" align="left" width="40" height="35" title="'.$resultmessages_user_sender['name'].' '.$resultmessages_user_sender['lastname'].'" style="border-radius:3px;margin-right:3px;" alt=""/></a>
<a href="?id='.$resultmessages_user_recipient['id'].'"><img src="uploads/photos/'.$result_recipient_profile_photo['photo'].'.jpg" align="right" width="40" height="35" title="'.$resultmessages_user_recipient['name'].' '.$resultmessages_user_recipient['lastname'].'" style="border-radius:3px;" alt=""/></a>
<a href="?id='.$resultmessages_user_sender['id'].'">'.$resultmessages_user_sender['name'].'</a> <a href="/mess/'.$resultmessages_user_recipient['uid'].'" title="Վերջին գրառող՝ '.$resultmessages_user_sender['name'].' '.$resultmessages_user_sender['lastname'].'">»»»</a> <a href="?id='.$resultmessages_user_recipient['id'].'">'.$resultmessages_user_recipient['name'].'</a>
<p>'.$rowpmessages_dialogue['message'].'</p>
</div>
<style>
#right{
float:right;
margin-right:5px;
}
#center{
margin-left:125px;
}
div#m_file_b
{
display:block;
width:97.2%;
height:35px;
background:#FFFFFF;
border:2px solid #cccccc;
margin-right:30px;
padding:5px;
}
div#m_file_b:hover
{
background:#E6EEF4;
width:97.2%;
}
</style>
';
}
?>
</ul>
</div>
8ba435d9309b.png
«««Եսել ետ կոդի արդյունքը...
Հիմա ես նկարի մեջ որ ցուցադրվում են նամակները դրանք ետ երկու օգտագործողների ամենավերջի գրված նամակները չեն, հիմա ես ուզում եմ որ ետ նամակների տեղը լինի ամենավերջի խոսացած նամակները տվյալ օգտագործողների...
Վերջին խմբագրող՝ ARMbrain: 06.07.2012, 16:37:
Նավի համար ավելի անվտանգ կլիներ նավահանգստում, բայց դրա համար չէ նա ստեղծված...(Գրեյս Հոպպեր)
ժողովուրդ ջան մեկը չկա օգնի.
Նավի համար ավելի անվտանգ կլիներ նավահանգստում, բայց դրա համար չէ նա ստեղծված...(Գրեյս Հոպպեր)
Այս պահին թեմայում են 1 հոգի. (0 անդամ և 1 հյուր)
Էջանիշներ