Commit e13580f0 authored by Philipp's avatar Philipp

added "days" parameter

parent 1e70d9c7
......@@ -2,13 +2,18 @@
<?php
include( 'mystic_library.php' );
if ( isset( $argv[1] ) ) {
$header = iconv( 'cp437', 'utf-8', file_get_contents( $argv[1] ) );
if ( isset( $argv[2] ) ) {
$header = iconv( 'cp437', 'utf-8', file_get_contents( $argv[2] ) );
$header = str_replace( '@DATE@', date( 'Y-m-d' ), $header );
} else {
$header = "Last Update: ". date( 'Y-m-d' ) ."\n\n";
}
echo $header;
if ( isset( $argv[1] ) ) {
$days = intval( $argv[1] );
} else {
$days = 1;
}
$bases = true;
$count = 0;
while ( $bases != false ) {
......@@ -22,7 +27,7 @@
$files = mystic_files( '/opt/mystic/data/', $base['filename'], 10, $count2*10 );
if ( $files != false ) {
foreach ( $files as $file ) {
if ( $file['datetime'] >= time()-1186400 ) {
if ( $file['datetime'] >= time()-(86400*$days) ) {
if ( $title == false ) {
echo "\n\n\n". $base['name'] ."\n";
echo str_repeat( '=', strlen( $base['name'] ) ) ."\n\n";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment