function do_favorite($event, $source, $target, $text) { global $favorite_row; static $cache = array(); array_push($cache, array("event" => $event, "text" => "@{$source} => @{$target}: {$text}")); if (count($cache) > FAVORITE_ROWS) { array_shift($cache); } cursave(); curpos($favorite_row, 1); foreach ($cache as $info) { curclearline(); if ($info["event"] == "favorite") { echocursetfont("YELLOW"); echo $info["text"] . "\n"; echocurfontreset(); } else { if ($info["event"] == "unfavorite") { echocursetfont("RED"); echo $info["text"] . "\n"; echocurfontreset(); } } } currestore(); }
function curhome() { curpos(1, 1); }