';
} else {
$recent_lines = $args[0];
}
}
// Show only N times
if ($exec_count > PLUGIN_RECENT_EXEC_LIMIT) {
return '#recent(): You called me too much' . '
' . "\n";
} else {
++$exec_count;
}
// Get latest N changes
if (file_exists(PLUGIN_RECENT_CACHE)) {
// BugTrack2/106: Only variables can be passed by reference from PHP 5.0.5
$file_array = file(PLUGIN_RECENT_CACHE); // with array_splice()
$lines = array_splice($file_array, 0, $recent_lines);
} else {
return '#recent(): Cache file of RecentChanges not found' . '
';
}
$script = get_script_uri();
$date = $items = '';
foreach ($lines as $line) {
list($time, $page) = explode("\t", rtrim($line));
$_date = get_date($date_format, $time);
if ($date != $_date) {
// End of the day
if ($date != '') $items .= '' . "\n";
// New day
$date = $_date;
$items .= '' . $date . '' . "\n" .
'