conf = $CONF; $stats->runstats(); class stats { var $conf = array(); var $html = ""; function runstats() { $sql = mysql_query("SELECT sum(size) AS size, count(*) AS count FROM torrents"); while ( $data = mysql_fetch_array( $sql ) ) { $data['size'] = $this->get_size( $data['size'] ); $this->html .= " Total Torrents {$data['count']} Total Size of torrents indexed {$data['size']}"; } $this->output(); } function get_size( $bytes="" ) { $value = ""; if ( $bytes >= 125899906842624 ) { $value = round( $bytes / 125899906842624 * 100) / 100 . ' PB'; } else if ( $bytes >= 1099511627776 ) { $value = round( $bytes / 1099511627776 * 100 ) / 100 . ' TB'; } else if ( $bytes >= 1073741824 ) { $value = round( $bytes / 1073741824 * 100 ) / 100 . ' GB'; } else if ( $bytes >= 1048576 ) { $value = round( $bytes / 1048576 * 100 ) / 100 . ' MB'; } return $value; } function output() { echo ""; echo $this->html; echo ""; } } /////////////// echo '
Home » Latest files
'; echo '

'; echo '

'; foreach ($catt as $catval) { $result = mysql_query("SELECT * FROM torrents LEFT JOIN categories ON torrents.subcat = categories.subid WHERE maincat = '$catval' $sort LIMIT 10") or die (mysql_error()); if (mysql_num_rows($result) == 0) { } else { echo '

'.$catnamet[$catval].'

'; echo '
'; while ($row = mysql_fetch_array($result)) { extract($row); echo ''; echo ''; echo ''; echo ''; //echo ''; //echo ''; echo ''; } echo '
Category

Filename

Size

'.$subname.'[dl] '.regicon($registration,$tracker).' '.desc($description).''.$torrentname.''.torsize($size).''.getpeer($seeds).''.getpeer($peers).'

'; } } footer(); ?>