MyBB.de Forum

Normale Version: PHP Script FlashChat
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
nachdem ich alles vergeblich versucht habe das "whosinchat"-Plugin zum laufen zu bekommen, habe ich nun eine andere Möglichkeit gefunden für die Anzeige im Forum.

Nun brauche ich aber mal jemanden der mir bei dem Script unter die Arme greift.
Im Anhang ist ein Screenshot wie es im moment aussieht (nicht schlecht) aber ... es werden die Namen derjenigen die im Chat sind untereinander aufgezählt was ich nicht unbedingt möchte.
Am Liebsten wäre mir die Darstellung so wie hier nämlich nebeneinander durch ein komma getrennt.
Hier mal der Teil des scriptes:

PHP-Code:
<html>
<
head>
<
title>Who's in the chat?</title>
<meta http-equiv=Content-Type content="text/html;  charset=UTF-8">
<style type="text/css">
<!--

body { background-color: transparent; margin: 0; padding: 0; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: normal; font-size: 10px;}
....normal {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: normal;
    margin: 0; padding: 0;
        text-align: center;
}

#roomList { margin: 0; padding: 0; }
#roomList a { color: black; text-decoration: none; } #roomList a:hover { text-decoration: underline; }
....userList { margin-left: 7px; margin-right: 0; margin-bottom: 0; margin-top: 0;  padding: 0; }

-->
</style>
<script type="text/javascript">
function toggleUserList(id) {
   if (l = document.getElementById(id)) {
      if (l.style.display == '' || l.style.display == '
block') l.style.display = 'none';
      else l.style.display = '
block';
   }
   return false;
}

</script>
</head>
<body>
<p class=normal><?php echo $usernumb ?> User sind im Chat.</p>
<ul id="roomList">
<?php if($roomnumb) { ?>
        <?php foreach($rooms as $room) { ?>
                <li><strong><a href="#" onClick="javascript:toggleUserList('
room_<?php echo $room['id']?>')"><?php echo $room['name']?> (<?php echo numusers($room['id']) ?>)</a></strong>
                <?php

                    $users 
usersinroom($room['id']);
                                        if (
$users) {
                                          echo 
"<ul class=\"userList\" id=\"room_".$room['id']."\">";
                                          foreach( 
$users as $user ) {
                        echo 
"<li>".$user['login'] . "</li>";
                      }
                                          echo 
"</ul>";
                                        }

                
?> </li>
        <?php ?>
<?php 
?>
</ul>

</body>
</html>

Danke im voraus!
coma 
Ersetze:
PHP-Code:
if ($users) {
                                          echo 
"<ul class=\"userList\" id=\"room_".$room['id']."\">";
                                          foreach( 
$users as $user ) {
                        echo 
"<li>".$user['login'] . "</li>";
                      }
                                          echo 
"</ul>";
                                        } 
durch
PHP-Code:
if ($users) {
                                          foreach( 
$users as $user ) {
                        
$array[] = $user['login'];
                      }
                        echo 
implode(', '$array);
                                        } 
superschnelle Antwort und gleich ein Treffer! Smile

vielen Dank Dragon!

Gruss, coma