From: Nicolas H. <nh...@us...> - 2001-03-21 16:48:31
|
Update of /cvsroot/phpmychat/phpMyChat - 0.14/chat In directory usw-pr-cvs1:/tmp/cvs-serv1046 Modified Files: usersH.php3 Log Message: gender is now shown even for users in other rooms ***** Bogus filespec: - ***** Bogus filespec: 0.14/chat Index: usersH.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat - 0.14/chat/usersH.php3,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** usersH.php3 2001/03/21 15:54:52 1.3 --- usersH.php3 2001/03/21 16:48:27 1.4 *************** *** 126,129 **** --- 126,184 ---- echo("</DIV>\n"); $DbLink->clean_results(); + + //** Build users list for other rooms ** + $AddPwd2Link = (isset($PWD_Hash) && $PWD_Hash != "") ? "&PWD_Hash=$PWD_Hash" : ""; + $DbLink->query("SELECT DISTINCT room FROM ".C_MSG_TBL." WHERE room != '$R' AND type = 1 ORDER BY room"); + if($DbLink->num_rows() > 0) + { + $i = 0; + $ChildNb = Array(); + $OthersUsers = new DB; + while(list($Other) = $DbLink->next_record()) + { + $OthersUsers->query("SELECT ".C_USR_TBL.".username, ".C_USR_TBL.".latin1, status, gender FROM ".C_USR_TBL." LEFT JOIN ".C_REG_TBL." ON ".C_USR_TBL.".username = ".C_REG_TBL.".username WHERE room = '".addslashes($Other)."' ORDER BY username"); + if($OthersUsers->num_rows() > 0) + { + $i++; + $id = md5($Other); + if ($i == 1) $FirstOtherRoom = "Parent".$id; + echo("<DIV ID=\"Parent${id}\" CLASS=\"parent\" STYLE=\"margin-top: 5px; CURSOR: hand\">"); + echo("<A HREF=\"#\" onClick=\"window.parent.expandIt('${id}'); return false\">"); + echo("<IMG NAME=\"imEx\" SRC=\"images/closed.gif\" WIDTH=9 HEIGHT=9 BORDER=0 ALT=\"".L_EXPCOL."\"></A>"); + echo(" <A HREF=\"$From?Ver=H&L=$L&U=".urlencode(stripslashes($U))."$AddPwd2Link&R1=".urlencode($Other)."&T=1&D=$D&N=$N&E=".urlencode(stripslashes($R))."&EN=$T\" TARGET=\"_parent\">".htmlspecialchars($Other)."</A><SPAN CLASS=\"small\"><BDO dir=\"${textDirection}\"></BDO> (".$OthersUsers->num_rows().")</SPAN>"); + echo("</DIV>\n"); + echo("<DIV ID=\"Child${id}\" CLASS=\"child\" STYLE=\"margin-left: 12px\">\n"); + $j = 0; + while(list($OtherUser, $Latin1, $status, $gender) = $OthersUsers->next_record()) + { + $j++; + // Put an icon when there is a profile for the user + if($gender == 1) + $gender = 'boy'; + elseif($gender == 2) + $gender = 'girl'; + else + $gender = 'none'; + if ($status != "u" && $status != "k" && $status != "d" && $status != "b") + { + $ImgNum++; + //echo("<A HREF=\"#\" onClick=\"window.parent.runCmd('WHOIS','".special_char2($OtherUser,$Latin1)."'); return false;\" CLASS=\"user\" onmouseover=\"document.images['whoisImg$ImgNum'].src = window.parent.imgWhoisOn.src\" onmouseout=\"document.images['whoisImg$ImgNum'].src = window.parent.imgWhoisOff.src\"><IMG NAME=\"whoisImg$ImgNum\" SRC=\"images/whoisOff.gif\" WIDTH=5 HEIGHT=9 BORDER=0 ALT=\"".L_PROFILE."\"></A> "); + echo('<a href="#" onClick="window.parent.runCmd('WHOIS','".special_char2($OtherUser,$Latin1)."'); return false;" class="user"><img name="whoisImg'.$ImgNum.'" src="images/gender_'.$gender.'.gif" width="14" height="14" border="0" alt="'.L_PROFILE.'"></a> '); + } + else + { + //echo("- "); + echo('<img name="whoisImg'.$ImgNum.'" src="images/gender_none.gif" width="14" height="14" border="0" alt="Pas de profil"> '); + }; + echo("<A HREF=\"javascript:window.parent.userClick('".special_char2($OtherUser,$Latin1)."',false);\" CLASS=\"user\">".special_char($OtherUser,$Latin1,$status)."</A><BR>\n"); + }; + echo("</DIV>\n"); + $ChildNb[$id] = $j; + } + $OthersUsers->clean_results(); + } + } + $DbLink->clean_results(); + $DbLink->close(); } else *************** *** 156,207 **** echo("</DIV>\n"); $DbLink->clean_results(); - } ! //** Build users list for other rooms ** ! $AddPwd2Link = (isset($PWD_Hash) && $PWD_Hash != "") ? "&PWD_Hash=$PWD_Hash" : ""; ! $DbLink->query("SELECT DISTINCT room FROM ".C_MSG_TBL." WHERE room != '$R' AND type = 1 ORDER BY room"); ! if($DbLink->num_rows() > 0) ! { ! $i = 0; ! $ChildNb = Array(); ! $OthersUsers = new DB; ! while(list($Other) = $DbLink->next_record()) { ! $OthersUsers->query("SELECT username, latin1, status FROM ".C_USR_TBL." WHERE room = '".addslashes($Other)."' ORDER BY username"); ! if($OthersUsers->num_rows() > 0) { ! $i++; ! $id = md5($Other); ! if ($i == 1) $FirstOtherRoom = "Parent".$id; ! echo("<DIV ID=\"Parent${id}\" CLASS=\"parent\" STYLE=\"margin-top: 5px; CURSOR: hand\">"); ! echo("<A HREF=\"#\" onClick=\"window.parent.expandIt('${id}'); return false\">"); ! echo("<IMG NAME=\"imEx\" SRC=\"images/closed.gif\" WIDTH=9 HEIGHT=9 BORDER=0 ALT=\"".L_EXPCOL."\"></A>"); ! echo(" <A HREF=\"$From?Ver=H&L=$L&U=".urlencode(stripslashes($U))."$AddPwd2Link&R1=".urlencode($Other)."&T=1&D=$D&N=$N&E=".urlencode(stripslashes($R))."&EN=$T\" TARGET=\"_parent\">".htmlspecialchars($Other)."</A><SPAN CLASS=\"small\"><BDO dir=\"${textDirection}\"></BDO> (".$OthersUsers->num_rows().")</SPAN>"); ! echo("</DIV>\n"); ! echo("<DIV ID=\"Child${id}\" CLASS=\"child\" STYLE=\"margin-left: 12px\">\n"); ! $j = 0; ! while(list($OtherUser,$Latin1,$status) = $OthersUsers->next_record()) { ! $j++; ! // Put an icon when there is a profile for the user ! if ($status != "u" && $status != "k" && $status != "d" && $status != "b") ! { ! $ImgNum++; ! echo("<A HREF=\"#\" onClick=\"window.parent.runCmd('WHOIS','".special_char2($OtherUser,$Latin1)."'); return false;\" CLASS=\"user\" onmouseover=\"document.images['whoisImg$ImgNum'].src = window.parent.imgWhoisOn.src\" onmouseout=\"document.images['whoisImg$ImgNum'].src = window.parent.imgWhoisOff.src\"><IMG NAME=\"whoisImg$ImgNum\" SRC=\"images/whoisOff.gif\" WIDTH=5 HEIGHT=9 BORDER=0 ALT=\"".L_PROFILE."\"></A> "); ! } ! else { ! echo("- "); }; ! echo("<A HREF=\"javascript:window.parent.userClick('".special_char2($OtherUser,$Latin1)."',false);\" CLASS=\"user\">".special_char($OtherUser,$Latin1,$status)."</A><BR>\n"); ! }; ! echo("</DIV>\n"); ! $ChildNb[$id] = $j; } - $OthersUsers->clean_results(); } } - $DbLink->clean_results(); - $DbLink->close(); // Display all rest default rooms --- 211,262 ---- echo("</DIV>\n"); $DbLink->clean_results(); ! //** Build users list for other rooms ** ! $AddPwd2Link = (isset($PWD_Hash) && $PWD_Hash != "") ? "&PWD_Hash=$PWD_Hash" : ""; ! $DbLink->query("SELECT DISTINCT room FROM ".C_MSG_TBL." WHERE room != '$R' AND type = 1 ORDER BY room"); ! if($DbLink->num_rows() > 0) { ! $i = 0; ! $ChildNb = Array(); ! $OthersUsers = new DB; ! while(list($Other) = $DbLink->next_record()) { ! $OthersUsers->query("SELECT username, latin1, status FROM ".C_USR_TBL." WHERE room = '".addslashes($Other)."' ORDER BY username"); ! if($OthersUsers->num_rows() > 0) { ! $i++; ! $id = md5($Other); ! if ($i == 1) $FirstOtherRoom = "Parent".$id; ! echo("<DIV ID=\"Parent${id}\" CLASS=\"parent\" STYLE=\"margin-top: 5px; CURSOR: hand\">"); ! echo("<A HREF=\"#\" onClick=\"window.parent.expandIt('${id}'); return false\">"); ! echo("<IMG NAME=\"imEx\" SRC=\"images/closed.gif\" WIDTH=9 HEIGHT=9 BORDER=0 ALT=\"".L_EXPCOL."\"></A>"); ! echo(" <A HREF=\"$From?Ver=H&L=$L&U=".urlencode(stripslashes($U))."$AddPwd2Link&R1=".urlencode($Other)."&T=1&D=$D&N=$N&E=".urlencode(stripslashes($R))."&EN=$T\" TARGET=\"_parent\">".htmlspecialchars($Other)."</A><SPAN CLASS=\"small\"><BDO dir=\"${textDirection}\"></BDO> (".$OthersUsers->num_rows().")</SPAN>"); ! echo("</DIV>\n"); ! echo("<DIV ID=\"Child${id}\" CLASS=\"child\" STYLE=\"margin-left: 12px\">\n"); ! $j = 0; ! while(list($OtherUser,$Latin1,$status) = $OthersUsers->next_record()) { ! $j++; ! // Put an icon when there is a profile for the user ! if ($status != "u" && $status != "k" && $status != "d" && $status != "b") ! { ! $ImgNum++; ! echo("<A HREF=\"#\" onClick=\"window.parent.runCmd('WHOIS','".special_char2($OtherUser,$Latin1)."'); return false;\" CLASS=\"user\" onmouseover=\"document.images['whoisImg$ImgNum'].src = window.parent.imgWhoisOn.src\" onmouseout=\"document.images['whoisImg$ImgNum'].src = window.parent.imgWhoisOff.src\"><IMG NAME=\"whoisImg$ImgNum\" SRC=\"images/whoisOff.gif\" WIDTH=5 HEIGHT=9 BORDER=0 ALT=\"".L_PROFILE."\"></A> "); ! } ! else ! { ! echo("- "); ! }; ! echo("<A HREF=\"javascript:window.parent.userClick('".special_char2($OtherUser,$Latin1)."',false);\" CLASS=\"user\">".special_char($OtherUser,$Latin1,$status)."</A><BR>\n"); }; ! echo("</DIV>\n"); ! $ChildNb[$id] = $j; ! } ! $OthersUsers->clean_results(); } } + $DbLink->clean_results(); + $DbLink->close(); } // Display all rest default rooms |