Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: kaip?
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();
Parašė MAnjack· 2008 Lie. 7 13:07:21
#2
if ($result !=0) {
kodas
} else {
echo "Online nieko nėra";
}
Parašė TaduXxX0· 2008 Lie. 7 14:07:15
#3
MAnjack parašė:
if ($result !=0) {
kodas
} else {
echo "Online nieko nėra";
}
neveikia taip...
Parašė MAnjack· 2008 Lie. 7 14:07:23
#4
Veikia. tik reikia žinot kur įsidėt.
Parašė TaduXxX0· 2008 Lie. 7 14:07:10
#5
tai gal gali idet?
Parašė MAnjack· 2008 Lie. 7 14:07:31
#6
PO šito dėk:
$result_from=dbquery("SELECT * FROM ".$db_prefix."buddys WHERE
buddy_from = ".$userdata['user_id']." AND buddy_to = ".$data['user_id']."");
Parašė bad_user· 2008 Lie. 7 14:07:45
#7
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."");
if ($result !=0) {
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>
";
}}
} else {
echo "Online nieko nëra";
}
echo"</table>\n";
closeside();
Bandyk
Parašė TaduXxX0· 2008 Lie. 7 14:07:31
#8
neveikia