Parašė TaduXxX0· 2008 Lie. 7 13:07:32
#1
kaip padaryti ,kad kai nera online draugu,rodytu mano teksta,o kai prisijungia draugai,juos rodytu ir mano tekstas dingtu? cia manau su if kazka reikia daryti,bet nesuprantu ka...
stai kodas:
opensidex("Prisijungæ draugai","on");
$lastseen=time()-120; // 120 sind 2 Minuten
echo"<table border='0' cellpadding='0' cellspacing='1' width='100%'>\n";
$result=dbquery("SELECT * FROM ".$db_prefix."users WHERE user_lastvisit >=".$lastseen."");
while($data = dbarray($result)) {
$result_from=dbquery("SELECT * FROM ".$db_prefix."buddys WHERE
buddy_from = ".$userdata['user_id']." AND buddy_to = ".$data['user_id']."");
$data_from = dbarray($result_from);
$result_to=dbquery("SELECT * FROM ".$db_prefix."buddys WHERE
buddy_to = ".$userdata['user_id']." AND buddy_from = ".$data['user_id']."");
$data_to = dbarray($result_to);
if($data_to['buddy_id'] != "" AND $data_from['buddy_id'] != ""){
$bild = "<img src='".INFUSIONS."draugu_panele/images/mail.gif' border='0'>";
$datum = strftime("Aktyvumas: %H:%M:%S Uhr", $data['user_lastvisit']);
echo ($data['user_avatar'] ? "<center><a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' target='_parent' title='$datum'>-->".$data['user_name']."<--<a href='".BASEDIR."messages.php?msg_send=".$data['user_id']."' target='_parent'>$bild</a><br><br><img src='".IMAGES."avatars/".$data['user_avatar']."' border=0 width=100 height=100><br><img src='".IMAGES."online.gif'><hr/></center>" : " <center><a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' target='_parent' title='$datum'>-->".$data['user_name']."<--<a href='".BASEDIR."messages.php?msg_send=".$data['user_id']."' target='_parent'>$bild</a><br><img src='".IMAGES."no.png' border=0 width=100 height=100><br><br><img src='".IMAGES."online.gif'><hr/></center>")."</td>
";
}}
echo"</table>\n";
closeside();