_get_plugin_filepath('shared','escape_special_chars'); $file = ''; foreach($params as $_key => $_val) { switch($_key) { case 'file': $$_key = $_val; break; default: if(!is_array($_val)) { $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; } else { $smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE); } break; } } if (empty($file)) { $smarty->trigger_error("html_image: missing 'file' parameter", E_USER_NOTICE); return; } $maxNews = 4; $counter = 0; $newsfile = fopen($file, "r"); while (($date = fscanf($newsfile, "Date:\t%[^\n]\n")) && ($maxNews*2 > $counter)) { $counter++; if ($date[0] != "") { $topic = fscanf($newsfile, "Topic:\t%[^\n]\n"); $body = fscanf($newsfile, "Body:\t%[^\n]\n"); $output .= "

$topic[0]

$date[0]
$body[0]
"; } } fclose($newsfile); return $output; } /* vim: set expandtab: */ ?>