<?php

class Plugin_commentstyle extends Plugin
{
	function do_block($pagename, $param1, $param2)
	{
		if(mb_ereg('^(.*),\s*([^,]+)\s*$', $param1, $m)){
			$name = trim($m[1]);
			$time = $m[2];
		}
		else{
			$name = trim($param1);
			$time = 0;
		}
		$text = convert_block($param2, $pagename);
		
		$smarty = new PluginSmarty('commentstyle');
		$smarty->assign('name', $name);
		$smarty->assign('time', $time);
		$smarty->assign('isnew', TIME - strtotime($time) < 24*60*60);
		$smarty->assign('text', $text);
		return $smarty->fetch('style.tpl.htm');
	}
}

?>