0
Welcome Guest! Login
0 items Join Now

Help with this php code...

    • edfel's Avatar
    • edfel
    • Elite Rocketeer
    • Posts: 584
    • Thanks: 0

    Help with this php code...

    Posted 17 years 3 months ago
    • Hi:

      I am using jumi to display users chatting (mediamogul_j15). The problem is that I need word wrap because users with large nicknames are causing theme corruption.

      The code is this:
      function getChatters()
      { 
           $chat_data_path = "/usr/local/123FlashChat/data/default/";
       
           
       
           $room = array();
       
           $room['connections'] = 0;
           $room['logon_users'] = 0;
           $room['room_numbers'] = 0;
       
           $online_file = $chat_data_path."online.txt";
       
           if (!file_exists($online_file))
           {
                return $room;
           }
       
           if (!$row = file($online_file))
           {
                return $room;
           }
       
           $room_data = explode("|", $row[0]);
       
       
           if (count($room_data) == 3)
           {
                $room['connections'] =  intval($room_data[0]);
                $room['logon_users'] =  intval($room_data[1]);
                $room['room_numbers'] = intval($room_data[2]);
           }
      $userListStr = "";
       
           $d = dir($chat_data_path);
       
           while (false !== ($entry = $d->read())) 
           {
              $rest = substr($entry, 0, 5);
              if ($rest == "room_")
              {
                
                if (file_exists($chat_data_path.$entry))
                {
                     
                     $f_users = file($chat_data_path.$entry);
                     
                     for ($i = 0; $i < count($f_users); $i ++)
                     {
                          $f_line = trim($f_users[$i]);
                          
                          if ($f_line != "")
                          {
                               $userListStr = ($userListStr == "") ? $f_line : $userListStr. "," . $f_line;
                          }
                     }
                     
                }    &nbsp;       
           &nbsp;  }
       
           }
           $d->close();
       
           $userListStr = ($userListStr == "") ? $lang['None'] : $userListStr;
           $room['userlist'] = ($userListStr == "") ? $lang['None'] : $userListStr;
           return $room;
      }

      How the word wrapping can be done, or How can I place the code above inside a table so template is not affected.

      Thanks in Advance!

      ???
    • Apache 2.4.23 | PHP 7.0.10 | MySQL 5.5.50 | RHEL 6.8
      Joomla 3.6.2

Time to create page: 0.063 seconds