From: Nicolas H. <nh...@us...> - 2001-03-21 15:54:56
|
Update of /cvsroot/phpmychat/phpMyChat - 0.14/chat In directory usw-pr-cvs1:/tmp/cvs-serv24071 Modified Files: usersH.php3 Log Message: added gender differentiation in users frame, but only for MySQL for now because of "left join" ***** Bogus filespec: - ***** Bogus filespec: 0.14/chat Index: usersH.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat - 0.14/chat/usersH.php3,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** usersH.php3 2001/02/25 19:10:08 1.2 --- usersH.php3 2001/03/21 15:54:52 1.3 *************** *** 89,119 **** //** Build users list for the current room ** ! $DbLink->query("SELECT username, latin1, status FROM ".C_USR_TBL." WHERE room='$R' ORDER BY username"); ! echo("<B>".htmlspecialchars(stripslashes($R))."</B><SPAN CLASS=\"small\"><BDO dir=\"${textDirection}\"></BDO> (".$DbLink->num_rows().")</SPAN><BR>\n"); ! echo("<DIV STYLE=\"margin-bottom: 10px\">\n"); ! while(list($User, $Latin1, $status) = $DbLink->next_record()) { ! // Put an icon when there is a profile for the user ! if ($status != "u" && $status != "k" && $status != "d" && $status != "b") { ! $ImgNum++; ! $Cmd2Send = ($User == stripslashes($U) ? "'PROFILE',''" : "'WHOIS','".special_char2($User,$Latin1)."'"); ! echo("<A HREF=\"#\" onClick=\"window.parent.runCmd($Cmd2Send); 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("- "); ! }; ! if($User != stripslashes($U)) ! { ! echo("<A HREF=\"javascript:window.parent.userClick('".special_char2($User,$Latin1)."',false);\" CLASS=\"user\">".special_char($User,$Latin1,$status)."</A><BR>\n"); ! } ! else { ! echo(special_char($User,$Latin1,$status)."<BR>\n"); } } - echo("</DIV>\n"); - $DbLink->clean_results(); //** Build users list for other rooms ** --- 89,160 ---- //** Build users list for the current room ** ! if(C_DB_TYPE == 'mysql') { ! $DbLink->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='$R' ORDER BY username"); ! echo("<B>".htmlspecialchars(stripslashes($R))."</B><SPAN CLASS=\"small\"><BDO dir=\"${textDirection}\"></BDO> (".$DbLink->num_rows().")</SPAN><BR>\n"); ! echo("<DIV STYLE=\"margin-bottom: 10px\">\n"); ! while(list($User, $Latin1, $status, $gender) = $DbLink->next_record()) { ! // 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++; ! $Cmd2Send = ($User == stripslashes($U) ? "'PROFILE',''" : "'WHOIS','".special_char2($User,$Latin1)."'"); ! echo('<a href="#" onClick="window.parent.runCmd('.$Cmd2Send.'); return false;" class="user"><img name="whoisImg'.$ImgNum.'" src="images/gender_'.$gender.'.gif" width="14" height="14" border="0" alt="'.L_PROFILE.'"></a> '); ! //echo("<A HREF=\"#\" onClick=\"window.parent.runCmd($Cmd2Send); 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('<img name="whoisImg'.$ImgNum.'" src="images/gender_none.gif" width="14" height="14" border="0" alt="Pas de profil"> '); ! //echo("- "); ! }; ! if($User != stripslashes($U)) ! { ! echo("<A HREF=\"javascript:window.parent.userClick('".special_char2($User,$Latin1)."',false);\" CLASS=\"user\">".special_char($User,$Latin1,$status)."</A><BR>\n"); ! } ! else ! { ! echo(special_char($User,$Latin1,$status)."<BR>\n"); ! } } ! echo("</DIV>\n"); ! $DbLink->clean_results(); ! } ! else ! { ! $DbLink->query("SELECT username, latin1, status FROM ".C_USR_TBL." WHERE room='$R' ORDER BY username"); ! echo("<B>".htmlspecialchars(stripslashes($R))."</B><SPAN CLASS=\"small\"><BDO dir=\"${textDirection}\"></BDO> (".$DbLink->num_rows().")</SPAN><BR>\n"); ! echo("<DIV STYLE=\"margin-bottom: 10px\">\n"); ! while(list($User, $Latin1, $status, $gender) = $DbLink->next_record()) { ! // Put an icon when there is a profile for the user ! if ($status != "u" && $status != "k" && $status != "d" && $status != "b") ! { ! $ImgNum++; ! $Cmd2Send = ($User == stripslashes($U) ? "'PROFILE',''" : "'WHOIS','".special_char2($User,$Latin1)."'"); ! echo("<A HREF=\"#\" onClick=\"window.parent.runCmd($Cmd2Send); 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("- "); ! }; ! if($User != stripslashes($U)) ! { ! echo("<A HREF=\"javascript:window.parent.userClick('".special_char2($User,$Latin1)."',false);\" CLASS=\"user\">".special_char($User,$Latin1,$status)."</A><BR>\n"); ! } ! else ! { ! echo(special_char($User,$Latin1,$status)."<BR>\n"); ! } } + echo("</DIV>\n"); + $DbLink->clean_results(); } //** Build users list for other rooms ** |