Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/02/2006, 17:48
syncmaster
 
Fecha de Ingreso: julio-2005
Mensajes: 86
Antigüedad: 18 años, 9 meses
Puntos: 0
Mostrar la foto de cada uno de los usuarios en linea

Hola que tal, lo que pasa es que tengo un script que estaba en ingles y que me ha servido de mucho para analizarlo(es de tipo match maker)contactos

La cuestion es la siguiente, tiene una parte en donde muestra las fotos de los usuarios que tienes agregados como amigos entonces lo que yo quice hacer es que en vez de eso me mostrara todos los usuarios sin importar que lo tengas agregado como amigo o no.

la sentecia sql que utilizaban para sacar las fotos de los usuarios que tenias como amigos era:

"select friendid from friends where memid =$mid and friend_flag = 1";
en donde $mid es el usuario actual

seleccionaba todos los usuarios q truvieras agregado como tu amigo sin importar si estaba en linea o no.

Entonces yo lo cambie por:
"select memid from member_details where memid =$mid and onlineflg ='yes'";
para que me mostrara las fotos de todos los usuarios q estaban en linea en la pagina,pero lo que me hace es que aunque 3 esten conectados solo me aparce mi foto(del usuario registrado en esa maquina) y por duplicado(2 fotos del mismo usuario)

me gustaria que me ayudaran a como puedo mostrar los usuarios enlinea, alguien q ya lo haya hecho.
gracias.




$stmt = "select memid from member_details where memid =$mid and onlineflg ='yes'";
$rs = mysql_query($stmt);
$num = mysql_num_rows($rs);
$ind = 0;
$cnt=0;
for ($i = 0; $i < $num;$i++)
{
$arrmem[$ind] = mysql_result($rs,$i,"memid");
$ind++;
$stmt = "select memid from member_details where memid = ".mysql_result($rs,$i,"memid")." and onlineflg ='yes'";
$rs1 = mysql_query($stmt);
$num1 = mysql_num_rows($rs1);
for ($j = 0;$j < $num1;$j++)
{
$ind1 = $ind - 1;
for ($k = 0;$k < $ind1;$k++)
{
if ( $arrmem[$k] == mysql_result($rs1,$j,"memid"))
$flg = 1;
}//for
if ($flg != 1)
{
$arrmem[$ind] = mysql_result($rs1,$j,"memid");
$ind++;
}//if
}//for
}//for
//print_r($arrmem);
$rows=ceil($ind/12);
for($j=0;$j<$rows;$j++)
{
?>
<tr>
<?
for($k=0;$k<12;$k++)
{
if($arrmem[$cnt]=="")
break;
?>
<?
$img1=getimage1($arrmem[$cnt]);
$img2=getimage2($arrmem[$cnt]);
$img3=getimage3($arrmem[$cnt]);
$currimage=getcurrimage($arrmem[$cnt]);

if($currimage!="")
{?>
<td><a href="profile.php?memberid=<?echo $arrmem[$cnt];?>"> <img border=0 alt=<?echo getfname($arrmem[$cnt]);?> height=60 src="photo/<?echo $currimage;?>" width=60></a></td>
<?}?>
<!--
<? if($img2!="")

{?>

<td><a href="profile.php?memberid=<?echo $arrmem[$cnt];?>"> <img border=0 alt=<?echo getfname($arrmem[$cnt]);?> height=60 src="photo/<?echo $img2;?>" width=60></a></td>

<?}?>
<? if($img3!="")
{?>
<td><a href="profile.php?memberid=<?echo $arrmem[$cnt];?>"> <img border=0 alt=<?echo getfname($arrmem[$cnt]);?> height=60 src="photo/<?echo $img3;?>" width=60></a></td>
<?}?>-->
<?$cnt++;
}//for k
?>
</tr>
<?
}//for j
?>
</tbody>
</table>
<br>
Estos son todos los usuarios en linea..<br>