All pastes #135364 Raw Edit

Miscellany

public php v1 · immutable
#135364 ·published 2006-08-16 22:23 UTC
rendered paste body
function chat_update($chat_log){  if(file_exists($chat_log))  {    include "parse_html.php";    $buffer_array = array();    $line_count = 0;    $buffer = file_get_contents($chat_log);    $buffer = explode("<~![-=#i(o)i#=-]!~>\r\n", $buffer);    foreach($buffer as $newline)    {      $newline = explode("<~![-=#i(i)i#=-]!~>", $newline);      $count = 0;      foreach($newline as $message)      {        if($count == 0)        {          $buffer_array[$line_count][0] = format($message)."<br />";          $count = 1;        }         else        {          $message = $parser -> parse_smileys($message);          $message = $parser -> parse_icons($message);          $buffer_array[$line_count][1] = format($message);          $count = 0;        }      }      $line_count++;    }    foreach($buffer_array as $key => $message)    {      if(!empty($buffer_array[$key]) && !empty($message[0]) && !empty($message[1]))      {        echo "<div style=\"border: 1px solid #000000; margin: 3px; padding: 3px; background-color: #EEEEEE;\">";        echo $message[0].$message[1];        echo "</div>";      }    }  }  else echo "No chat history availble!";}