"smile.gif", "[:))]" => "lol.gif", "[:(]" => "sad.gif", ); [color=green]/************* FUNCTIONS *****************/ // this will prepare all smilies[/color] function alter_smiley(&$item1, $key, $prefix) { $item1 = " \"\""; } [color=green]// bad words filter, you should add your own ones here[/color] function removeBadWords(&$text) { $badwords = array( "/fu[color=gray].[/color]ck/", "/sh[color=gray].[/color]it/" ); for ($i=0;$i\n"; echo "\n"; echo "
\n"; echo "

\n"; echo "
\n"; echo "\n"; echo "\n"; echo "
\n"; [color=green]/************* DISPLAY SHOUT *****************/ // This makes an array with each line in the file [/color] $shouts = file($filename); $rowColor = 0; $count = 0; array_walk ($smileys, 'alter_smiley', $smileydir); [color=green]// We'll add krsort right here! [/color] krsort($shouts); [color=green]// This does the same thing to each part...[/color] $link_search = array("/\/", "/\]/", "/\[/", "#([\n ])([a-z0-9\-_.]+?)@([^, \n\r]+)#i", "#([\n ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^, \n\r]*)?)#i", "/(?\s]+)/i"); if ($usemask=='yes') $link_replace = array("<", ">", ">", "<", "\\1".$email_mask."", "\\1".$link_mask."", "".$link_mask.""); else $link_replace = array("<", ">", ">", "<", "\\1\\2@\\3", "\\1www.\\2.\\3\\4", "\\0"); foreach($shouts as $sbox) { $count++; [color=green]// We'll split it into another array with list and explode.[/color] [color=green]// If you have changed the way data stored, please modify the following line too[/color] list($auth,$date,$time,$ipaddr,$shout) = explode(" | ", $sbox); $shout = " ".$shout; $shout = preg_replace($link_search, $link_replace, $shout); $shout = strtr($shout, $smileys); $shout = chop($shout); [color=green]// Now, we have to output it![/color] echo "
$auth: $shout
\n"; if ($rowColor==0) $rowColor = 1; else $rowColor = 0; } ?>