0 ) { echo ' '; } ?>
$sdata) { $text2 = ereg_replace( $sdata, '', $text2 ); } return $text2; } function read_sizecache( $filename ) { global $sizecache; global $sizecache_dirty; $sizecache_dirty = 0; $len = filesize($filename); if ( $len <= 0 ) return; $fp = fopen( $filename, 'r' ); if ( $fp ) { $tread = fread($fp, $len); fclose($fp); $tlines = explode("\n", $tread); foreach ( $tlines as $ykey => $ydata) { if ( ereg( '[:]', $ydata ) ) { list( $key, $tsize ) = explode(':', $ydata, 2); $sizecache[ $key ] = $tsize; } } } } function write_sizecache( $filename ) { global $sizecache; global $sizecache_dirty; if ( $sizecache_dirty == 0 ) return; $fp = fopen( $filename, 'w' ); if ( $fp ) { foreach ( $sizecache as $key => $ydata ) { fwrite( $fp, $key.':'.$ydata."\n" ); } fclose($fp); } } function filesize_cache( $filename ) { global $sizecache; global $sizecache_dirty; global $base_path; if ( isset( $sizecache[ $filename ] ) ) { return $sizecache[ $filename ]; } $localfile = $filename; if ( !ereg( '^/', $filename ) ) $localfile = $base_path.$filename; $tsize = filesize( $localfile ); $sizecache[ $filename ] = $tsize; $sizecache_dirty ++; return $tsize; } function cgi_escape( $string ) { $string = ereg_replace( '[&]', '%26', $string ); $string = ereg_replace( '[+]', '%2B', $string ); return $string; } function make_self_more() { $par = 0; $link = $_SERVER[ 'PHP_SELF' ]; # options: if ( isset( $_GET[ 'group' ] ) ) { if ( $par == 0 ) $link .= '?'; else $link .= '&'; $link .= 'group='.cgi_escape($_GET[ 'group' ]); $par ++; } if ( !isset( $_GET[ 'volumen' ] ) ) { if ( $par == 0 ) $link .= '?'; else $link .= '&'; $link .= 'volumen=1'; $par ++; } if ( isset( $_GET[ 'order' ] ) ) { if ( $par == 0 ) $link .= '?'; else $link .= '&'; $link .= 'order='.$_GET[ 'order' ]; $par ++; } return $link; } function make_self_order( $order ) { $par = 0; $link = $_SERVER[ 'PHP_SELF' ]; # options: if ( isset( $_GET[ 'group' ] ) ) { if ( $par == 0 ) $link .= '?'; else $link .= '&'; $link .= 'group='.cgi_escape($_GET[ 'group' ]); $par ++; } if ( isset( $_GET[ 'volumen' ] ) ) { if ( $par == 0 ) $link .= '?'; else $link .= '&'; $link .= 'volumen='.$_GET[ 'volumen' ]; $par ++; } if ( $order != '' ) { if ( $par == 0 ) $link .= '?'; else $link .= '&'; $link .= 'order='.$order; $par ++; } return $link; } function make_self_group( $group ) { $par = 0; $link = $_SERVER[ 'PHP_SELF' ]; # options: if ( $group != '' ) { if ( $par == 0 ) $link .= '?'; else $link .= '&'; $link .= 'group='.cgi_escape($group); $par ++; } if ( isset( $_GET[ 'volumen' ] ) ) { if ( $par == 0 ) $link .= '?'; else $link .= '&'; $link .= 'volumen='.$_GET[ 'volumen' ]; $par ++; } if ( isset( $_GET[ 'order' ] ) ) { if ( $par == 0 ) $link .= '?'; else $link .= '&'; $link .= 'order='.$_GET[ 'order' ]; $par ++; } return $link; } function make_self_back( $order ) { $par = 0; $link = $_SERVER[ 'PHP_SELF' ]; # options: if ( isset( $_GET[ 'volumen' ] ) ) { if ( $par == 0 ) $link .= '?'; else $link .= '&'; $link .= 'volumen='.$_GET[ 'volumen' ]; $par ++; } if ( isset( $_GET[ 'order' ] ) ) { if ( $par == 0 ) $link .= '?'; else $link .= '&'; $link .= 'order='.$_GET[ 'order' ]; $par ++; } return $link; } read_sizecache( $cache_file ); $read = ''; # Status aller Bots lesen foreach ( $filenames as $key => $filename) { $fp = fopen( $filename, 'r' ); if ( $fp ) { $read .= fread($fp, filesize ($filename)); fclose($fp); } } $nick2 = ereg_replace( '[^A-Za-z_0-9]', '', $nick ); $packs = 0; $fpacks = 0; $total[ 'packs' ] = 0; $total[ 'size' ] = 0; $total[ 'downl' ] = 0; $total[ 'xx_gets' ] = 0; $total[ 'trans' ] = 0; $gruppen[ '*' ][ 'packs' ] = 0; $gruppen[ '*' ][ 'size' ] = 0; $gruppen[ '*' ][ 'xx_gets' ] = 0; $gruppen[ '*' ][ 'trans' ] = 0; $newfile = 0; $datalines = explode("\n", $read); foreach ( $datalines as $key => $data) { if ( $data == '' ) continue; if ( ereg( '^Do Not Edit This File[:] ', $data ) ) { list( $key, $text ) = explode(': ', $data, 2); list( $irec, $iband, $itotal, $irest ) = explode(' ', $text, 4); $total[ 'downl' ] += $itotal; $packs = 0; continue; } if ( !ereg( ' ', $data ) ) continue; list( $key, $text ) = explode(' ', $data, 2); if ( $text == '' ) continue; # removed packages if ( $irest == '-' ) { if ( $key == 'xx_file' ) { $fsize = filesize_cache( $text ); if ( isset( $seen[ $text ] ) ) continue; $seen[ $text ] = 0; $total[ 'packs' ] ++; $total[ 'size' ] += $fsize; } if ( $key == 'xx_gets' ) { $total[ 'xx_gets' ] += $text; $total[ 'trans' ] += $fsize * $text; } continue; } if ( $key == 'xx_file' ) { $newfile = 0; $packs ++; $fsize = filesize_cache( $text ); $info[ $packs ][ 'pack' ] = $packs; $info[ $packs ][ 'size' ] = $fsize; if ( !isset( $info[ $packs ][ 'xx_gets' ] ) ) { $info[ $packs ][ 'xx_gets' ] = 0; $info[ $packs ][ 'trans' ] = 0; } if ( !isset( $seen[ $text ] ) ) { $newfile = 1; $seen[ $text ] = $packs; $total[ 'packs' ] ++; $total[ 'size' ] += $fsize; } $fpacks = $seen[ $text ]; } if ( $key == 'xx_gets' ) { $tgets = $text; $ttrans = $info[ $fpacks ][ 'size' ] * $tgets; $info[ $fpacks ][ $key ] += $tgets; $info[ $fpacks ][ 'trans' ] += $ttrans; $total[ 'xx_gets' ] += $tgets; $total[ 'trans' ] += $ttrans; continue; } if ( $key == 'xx_desc' ) { $info[ $fpacks ][ 'xx_desc' ] = clean_names( $text ); continue; } if ( !isset( $info[ $fpacks ][ $key ] ) ) { $info[ $fpacks ][ $key ] = $text; } if ( $key == 'xx_trno' ) { if ( !isset( $gruppen[ $gr ][ 'xx_trno' ] ) ) { $gruppen[ $gr ][ 'xx_trno' ] = clean_names( $text ); } continue; } if ( $key == 'xx_note' ) { $info[ $fpacks ][ 'xx_note' ] = clean_names( $text ); continue; } if ( $key != 'xx_data' ) continue; $gr = $text; if ( !isset( $gruppen[ $gr ][ 'packs' ] ) ) { $gruppen[ $gr ][ 'packs' ] = 0; $gruppen[ $gr ][ 'size' ] = 0; $gruppen[ $gr ][ 'xx_gets' ] = 0; $gruppen[ $gr ][ 'trans' ] = 0; } $gruppen[ $gr ][ 'xx_gets' ] += $tgets; $gruppen[ $gr ][ 'trans' ] += $ttrans; $gruppen[ '*' ][ 'xx_gets' ] += $tgets; $gruppen[ '*' ][ 'trans' ] += $ttrans; if ( $newfile == 0 ) continue; $gruppen[ $gr ][ 'packs' ] ++; $gruppen[ $gr ][ 'size' ] += $info[ $fpacks ][ 'size' ]; $gruppen[ '*' ][ 'packs' ] ++; $gruppen[ '*' ][ 'size' ] += $info[ $fpacks ][ 'size' ]; } write_sizecache( $cache_file ); # Ueberschrift: if ( isset( $_GET[ 'group' ] ) ) { echo '

'.$nick." Datei-Liste

\n"; echo "\n"; echo '

Download im IRC mit "/msg '.$nick.' xdcc send #nummer"

'; echo "\n"; } else { echo '

'.$nick." Gruppen-Liste

\n"; echo "\n"; } ?> PACK'; $hgets = 'DLs'; $hsize = 'GRÖSSE'; if ( !isset( $_GET[ 'order' ] ) ) { foreach ( $info as $key => $data) $ausgabe[ $key ] = $key; asort( $ausgabe ); $hpack = 'PACK'; } else { $ofound = 0; if ( $_GET[ 'order' ] == 'gets' ) { foreach ( $info as $key => $data) $ausgabe[ $key ] = $info[ $key ][ 'xx_gets' ]; arsort( $ausgabe ); $hgets = 'DLs'; $ofound = 1; } if ( $_GET[ 'order' ] == 'size' ) { foreach ( $info as $key => $data) $ausgabe[ $key ] = $info[ $key ][ 'size' ]; arsort( $ausgabe ); $hsize = 'GRÖSSE'; $ofound = 1; } if ( $ofound == 0 ) { foreach ( $info as $key => $data) $ausgabe[ $key ] = $key; asort( $ausgabe ); $hpack = 'PACK'; } } $linkmore = ' (zurück)'; echo ' '; $gr = $_GET[ 'group' ]; $tpacks = $gruppen[ $gr ][ 'packs' ]; $tsize = $gruppen[ $gr ][ 'size' ]; echo ' '; foreach ( $ausgabe as $key => $data) { if ( $key == '' ) continue; if ( ( $_GET[ 'group' ] != '*' ) && ( $info[ $key ][ 'xx_data' ] != $_GET[ 'group' ] ) ) continue; $tpack = $info[ $key ][ 'pack' ]; $tname = $info[ $key ][ 'xx_desc' ]; $jsid= $nick2.'_'.$tpack; $tname = htmlspecialchars( $tname); if ( $javascript > 0 ) { $tname = ''. $tname."\n". '\n"; } if ( isset( $info[ $key ][ 'xx_note' ] ) ) $tname .= '
'.$info[ $key ][ 'xx_note' ]; $label = "Download mit:\n/msg ".$nick.' xdcc send #'.$tpack."\n"; echo ' '; } } else { $hpack = 'PACKs'; $hgets = 'DLs'; $hrget = 'DLs/Pack'; $hsize = 'GRÖSSE'; $htvol = 'Volumen'; $hname = 'GRUPPE'; if ( !isset( $_GET[ 'order' ] ) ) { foreach ( $gruppen as $key => $data) $ausgabe[ $key ] = $key; asort( $ausgabe ); $hname = 'GRUPPE'; } else { if ( $_GET[ 'order' ] == 'pack' ) { foreach ( $gruppen as $key => $data) $ausgabe[ $key ] = $gruppen[ $key ][ 'packs' ]; arsort( $ausgabe ); $hpack = 'PACKs'; } if ( $_GET[ 'order' ] == 'gets' ) { foreach ( $gruppen as $key => $data) $ausgabe[ $key ] = $gruppen[ $key ][ 'xx_gets' ]; arsort( $ausgabe ); $hgets = 'DLs'; } if ( $_GET[ 'order' ] == 'rget' ) { foreach ( $gruppen as $key => $data) $ausgabe[ $key ] = $gruppen[ $key ][ 'xx_gets' ] / $gruppen[ $key ][ 'packs' ]; arsort( $ausgabe ); $hrget = 'DLs/Pack'; } if ( $_GET[ 'order' ] == 'size' ) { foreach ( $gruppen as $key => $data) $ausgabe[ $key ] = $gruppen[ $key ][ 'size' ]; arsort( $ausgabe ); $hsize = 'GRÖSSE'; } if ( $_GET[ 'order' ] == 'tvol' ) { foreach ( $gruppen as $key => $data) $ausgabe[ $key ] = $gruppen[ $key ][ 'trans' ]; arsort( $ausgabe ); $htvol = 'Volumen'; } } $tvol1 = ''; $rget1 = ''; if ( isset( $_GET[ 'volumen' ] ) ) { $tvol1 = ''; $rget1 = ''; $linkmore = ' (weniger)'; } else { $linkmore = ' (mehr)'; } echo ' '.$rget1.' '.$tvol1.' '; $tpacks = $total[ 'packs' ]; $tsize = $total[ 'size' ]; $part = $total[ 'downl' ] - $total[ 'trans' ]; $tcount = count($gruppen) - 1; $tvol2 = ''; $rget2 = ''; if ( isset( $_GET[ 'volumen' ] ) ) { $tvol2 = ''; $getsperpack = sprintf( '%.1f', $total[ 'xx_gets' ] / $tpacks ); $rget2 = ''; } echo ' '.$rget2.' '.$tvol2.' '; foreach ( $ausgabe as $key => $data) { if ( $key == '' ) continue; if ( $key == '*' ) continue; $tpacks= $gruppen[ $key ][ 'packs' ]; $asize = $gruppen[ $key ][ 'size' ]; $tsize = $gruppen[ $key ][ 'trans' ]; $tname = $key; if ( isset( $gruppen[ $key ][ 'xx_trno' ] ) ) $tname = $gruppen[ $key ][ 'xx_trno' ]; $link = make_self_group( $key ); $tvol3 = ''; $rget3 = ''; if ( isset( $_GET[ 'volumen' ] ) ) { $tvol3 = ''; $getsperpack = sprintf( '%.1f', $gruppen[ $key ][ 'xx_gets' ] / $tpacks ); $rget3 = ''; } echo ' '.$rget3.' '.$tvol3.' '; } } ?>
'.$hpack.' '.$hgets.' '.$hsize.' BESCHREIBUNG'.$linkmore.'
'.$tpacks.' '.$gruppen[ $gr ][ 'xx_gets' ].' '.makesize($tsize).' ['.makesize($gruppen[ $gr ][ 'trans' ]).'] vollständig heruntergeladen
#'.$tpack.' '.$info[ $key ][ 'xx_gets' ].' '.makesize($info[ $key ][ 'size' ]).' '.$tname.'
'.$htvol.''.$hrget.'
'.$hpack.' '.$hgets.''.$hsize.''.$hname.' BESCHREIBUNG'.$linkmore.'
'.makesize($total[ 'trans' ]).''.$getsperpack.'
'.$tpacks.' '.$total[ 'xx_gets' ].''.makesize($tsize).''.$tcount.' alle Packs ['.makesize($total[ 'trans' ]).'] vollständig heruntergeladen, ['.makesize($part).'] unvollständig
'.makesize($tsize).''.$getsperpack.'
'.$tpacks.' '.$gruppen[ $key ][ 'xx_gets' ].''.makesize($asize).''.htmlspecialchars($key).' '.htmlspecialchars($tname).'