Commit 1e70d9c7 authored by Philipp's avatar Philipp

initial import

parents
This diff is collapsed.
#!/usr/bin/php
<?php
include( 'mystic_library.php' );
if ( isset( $argv[1] ) ) {
$header = iconv( 'cp437', 'utf-8', file_get_contents( $argv[1] ) );
$header = str_replace( '@DATE@', date( 'Y-m-d' ), $header );
} else {
$header = "Last Update: ". date( 'Y-m-d' ) ."\n\n";
}
echo $header;
$bases = true;
$count = 0;
while ( $bases != false ) {
$bases = mystic_fbases( '/opt/mystic/data/', 10, $count*10 );
if ( $bases != false ) {
foreach ( $bases as $base ) {
$files = true;
$count2 = 0;
$title = false;
while ( $files != false ) {
$files = mystic_files( '/opt/mystic/data/', $base['filename'], 10, $count2*10 );
if ( $files != false ) {
foreach ( $files as $file ) {
if ( $file['datetime'] >= time()-1186400 ) {
if ( $title == false ) {
echo "\n\n\n". $base['name'] ."\n";
echo str_repeat( '=', strlen( $base['name'] ) ) ."\n\n";
echo "Filename Size Date Description\n";
echo str_repeat( '-', 78 ) ."\n";
$title = true;
}
echo str_pad( $file['filename'], 14, ' ' ) ."\n";
echo str_pad( round( $file['size']/1024 ) ."KB", 14, ' ', STR_PAD_LEFT ) ." ";
echo str_pad( date ( 'Y-m-d', $file['datetime'] ), 12, ' ' );
$count3 = 0;
foreach ( $file['desc'] as $d ) {
if ( $count3 > 0 ) {
echo str_repeat( ' ', 28 );
}
echo $d ."\n";
$count3++;
}
}
}
}
$count2++;
}
}
}
$count++;
}
?>
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