Esempio n. 1
0
" />
						<input type="hidden" id="current_downloaded" value="<?php 
echo $LoggedUser['BytesDownloaded'];
?>
" />
						<input id="total_bounty" type="hidden" value="<?php 
echo $RequestVotes['TotalBounty'];
?>
" />
						If you add the entered <strong><span id="new_bounty">0.00 MB</span></strong> of bounty, your new stats will be: <br/>
						Uploaded: <span id="new_uploaded"><?php 
echo get_size($LoggedUser['BytesUploaded']);
?>
</span>
						Ratio: <span id="new_ratio"><?php 
echo ratio($LoggedUser['BytesUploaded'], $LoggedUser['BytesDownloaded']);
?>
</span>
						<input type="button" id="button" value="Vote!" disabled="disabled" onclick="Vote();"/> 
					</form>
				</td>
			</tr>
<? }?> 
			<tr id="bounty">
				<td class="label">Bounty</td>
				<td id="formatted_bounty"><?php 
echo get_size($RequestVotes['TotalBounty']);
?>
</td>
			</tr>
<?
Esempio n. 2
0
?>
</li>
				<li><strong>Total peers: </strong><?php 
echo number_format($TotalSeeders + $TotalLeechers);
?>
</li>
				<li><strong>Total snatches: </strong><?php 
echo number_format($TotalOverallSnatches);
?>
</li>
				<li><strong>Seeder/leecher ratio: </strong><?php 
echo ratio($TotalSeeders, $TotalLeechers);
?>
</li>
				<li><strong>Seeder/snatch ratio: </strong><?php 
echo ratio($TotalSeeders, $TotalOverallSnatches);
?>
</li>
				<br />
				<li><strong>Mean seeders per torrent: </strong><?php 
echo number_format($TotalSeeders / $TotalTorrents, 2);
?>
</li>
				<li><strong>Mean leechers per torrent: </strong><?php 
echo number_format($TotalLeechers / $TotalTorrents, 2);
?>
</li>
				<li><strong>Mean snatches per torrent: </strong><?php 
echo number_format($TotalSnatches / $TotalTorrents, 2);
?>
</li>
Esempio n. 3
0
		<tr class="row<?php 
        echo $Row;
        ?>
">
			<td><?php 
        echo format_username($UserID, $Username, $Donor, $Warned, $Enabled, $PermissionID);
        ?>
<br /><?php 
        echo format_username($InviterID, $InviterUsername, $InviterDonor, $InviterWarned, $InviterEnabled, $InviterPermissionID);
        ?>
</td>
			<td><?php 
        echo ratio($Uploaded, $Downloaded);
        ?>
<br /><?php 
        echo ratio($InviterUploaded, $InviterDownloaded);
        ?>
</td>
			<td>
				<span style="float:left;"><?php 
        echo display_str($Email);
        ?>
</span>
				<span style="float:right;">[<a href="userhistory.php?action=email&amp;userid=<?php 
        echo $UserID;
        ?>
" title="History">H</a>|<a href="/user.php?action=search&email_history=on&email=<?php 
        echo display_str($Email);
        ?>
" title="Search">S</a>]</span><br />
				<span style="float:left;"><?php 
Esempio n. 4
0
	function make_tree(){
		$UserID = $this->UserID;
		global $DB;
?>
		<div class="invitetree pad">
<?
		$DB->query("SELECT 
			t1.TreePosition, 
			t1.TreeID, 
			t1.TreeLevel, 
			(SELECT 
				t2.TreePosition FROM invite_tree AS t2 
				WHERE TreeID=t1.TreeID AND TreeLevel=t1.TreeLevel AND t2.TreePosition>t1.TreePosition 
				ORDER BY TreePosition LIMIT 1
			) AS MaxPosition
			FROM invite_tree AS t1
			WHERE t1.UserID=$UserID");
		
		list($TreePosition, $TreeID, $TreeLevel, $MaxPosition) = $DB->next_record();
		if(!$MaxPosition){ $MaxPosition = 1000000; } // $MaxPermission is null if the user is the last one in that tree on that level
		if(!$TreeID){ return; }
		$DB->query("
			SELECT 
			it.UserID, 
			Username,
			Donor,
			Warned,
			Enabled,
			PermissionID,
			Uploaded,
			Downloaded,
			Paranoia,
			TreePosition,
			TreeLevel
			FROM invite_tree AS it
			JOIN users_main AS um ON um.ID=it.UserID
			JOIN users_info AS ui ON ui.UserID=it.UserID
			WHERE TreeID=$TreeID
			AND TreePosition>$TreePosition
			AND TreePosition<$MaxPosition
			AND TreeLevel>$TreeLevel
			ORDER BY TreePosition");
		
		$PreviousTreeLevel = $TreeLevel;
		
		// Stats for the summary
		$MaxTreeLevel = $TreeLevel; // The deepest level (this changes)
		$OriginalTreeLevel = $TreeLevel; // The level of the user we're viewing
		$BaseTreeLevel = $TreeLevel + 1; // The level of users invited by our user
		$Count = 0;
		$Branches = 0;
		$DisabledCount = 0;
		$DonorCount = 0;
		$ParanoidCount = 0;
		$TotalUpload = 0;
		$TotalDownload = 0;
		$TopLevelUpload = 0;
		$TopLevelDownload = 0;
		
		$ClassSummary = array();
		global $Classes;
		foreach ($Classes as $ClassID => $Val) {
			$ClassSummary[$ClassID] = 0;
		}
		
		// We store this in an output buffer, so we can show the summary at the top without having to loop through twice
		ob_start();
		while(list($ID, $Username, $Donor, $Warned, $Enabled, $Class, $Uploaded, $Downloaded, $Paranoia, $TreePosition, $TreeLevel) = $DB->next_record()){ 
			
			// Do stats
			$Count++;
			
			if($TreeLevel > $MaxTreeLevel){
				$MaxTreeLevel = $TreeLevel;
			}
			
			if($TreeLevel == $BaseTreeLevel){
				$Branches++;
				$TopLevelUpload += $Uploaded;
				$TopLevelDownload += $Downloaded;
			}
			
			$ClassSummary[$Class]++;
			if($Enabled == 2){
				$DisabledCount++;
			}
			if($Donor){
				$DonorCount++;
			}
			
			// Manage tree depth
			if($TreeLevel > $PreviousTreeLevel){
				for($i = 0; $i<$TreeLevel-$PreviousTreeLevel; $i++){ echo "<ul class=\"invitetree\">\n"; }
			} elseif($TreeLevel < $PreviousTreeLevel){
				for($i = 0; $i<$PreviousTreeLevel-$TreeLevel; $i++){ echo "</ul>\n"; }
			}
?>
			<li>
				<strong><?php 
echo format_username($ID, $Username, $Donor, $Warned, $Enabled == 2 ? false : true, $Class);
?>
</strong>
<?
			if ($Paranoia < 4 || check_perms('users_mod')) {
				$TotalUpload += $Uploaded;
				$TotalDownload += $Downloaded;
?>
				&nbsp;Uploaded: <strong><?php 
echo get_size($Uploaded);
?>
</strong>
				&nbsp;Downloaded: <strong><?php 
echo get_size($Downloaded);
?>
</strong>
				&nbsp;Ratio: <strong><?php 
echo ratio($Uploaded, $Downloaded);
?>
</strong>
<?
			} else {
				$ParanoidCount++;
?>
				&nbsp;Paranoia: <strong><?php 
echo number_format($Paranoia);
?>
</strong>
<?
			}
?>			
			</li>
<?			$PreviousTreeLevel = $TreeLevel;
		} 
		$Tree = ob_get_clean();
		if($Count){
		
?> 		<p style="font-weight: bold;">
			This tree has <?php 
echo $Count;
?>
 entries, <?php 
echo $Branches;
?>
 branches, and a depth of <?php 
echo $MaxTreeLevel - $OriginalTreeLevel;
?>
.
			It has
<?
			$ClassStrings = array();
			foreach ($ClassSummary as $ClassID => $ClassCount) {
				if($ClassCount == 0) { continue; }
				$LastClass = make_class_string($ClassID);
				if($ClassCount>1) { 
					if($LastClass == "Torrent Celebrity") {
						 $LastClass = 'Torrent Celebrities';
					} else {
						$LastClass.='s'; 
					}
				}
				$LastClass= $ClassCount.' '.$LastClass.' (' . number_format(($ClassCount/$Count)*100) . '%)';
				
				$ClassStrings []= $LastClass;
			}
			if(count($ClassStrings)>1){
				array_pop($ClassStrings);
				echo implode(', ', $ClassStrings);
				echo ' and '.$LastClass;
			} else {
				echo $LastClass;
			}
			echo '. ';
			echo $DisabledCount;
			echo ($DisabledCount==1)?' user is':' users are';
			echo ' disabled (';
			if($DisabledCount == 0) { echo '0%)'; }
			else { echo number_format(($DisabledCount/$Count)*100) . '%)';}
			echo ', and ';
			echo $DonorCount;
			echo ($DonorCount==1)?' user has':' users have';
			echo ' donated (';
			if($DonorCount == 0) { echo '0%)'; }
			else { echo number_format(($DonorCount/$Count)*100) . '%)';}
			echo '. </p>';
			
			echo '<p style="font-weight: bold;">';
			echo 'The total amount uploaded by the entire tree was '.get_size($TotalUpload);
			echo ', the total amount downloaded was '.get_size($TotalDownload);
			echo ', and the total ratio is '.ratio($TotalUpload, $TotalDownload).'. ';
			echo '</p>';
			
			echo '<p style="font-weight: bold;">';
			echo 'The total amount uploaded by direct invitees (the top level) was '.get_size($TopLevelUpload);
			echo ', the total amount downloaded was '.get_size($TopLevelDownload);
			echo ', and the total ratio is '.ratio($TopLevelUpload, $TopLevelDownload).'. ';
			
			
			echo 'These numbers include the stats of paranoid users, and will be factored in to the invitation giving script.</p>';
			
			
			if($ParanoidCount){
				echo '<p style="font-weight: bold;">';
				echo $ParanoidCount;
				echo ($ParanoidCount==1)?' user (':' users (';
				echo number_format(($ParanoidCount/$Count)*100);
				echo '%) ';
				echo ($ParanoidCount==1)?'  is':' are';
				echo ' too paranoid to have their stats shown here, and ';
				echo ($ParanoidCount==1)?'  was':' were';
				echo ' not factored into the stats for the total tree.';
				echo '</p>';
			}
		}
		
?>
		<br />
		<?php 
echo $Tree;
?>
		</div>
<?
	}
Esempio n. 5
0
			<td>Joined</td>
			<td>Last Seen</td>
			<td>Upload</td>
			<td>Download</td>
			<td>Snatched</td>
			<td>Invites</td>
		</tr>
<?
while(list($UserID, $Username, $Uploaded, $Downloaded, $Snatched, $Class, $Email, $Enabled, $IP, $Invites, $DisableInvites, $Warned, $Donor, $JoinDate, $LastAccess) = $DB->next_record()){ ?>
		<tr>
			<td><?php 
echo format_username($UserID, $Username, $Donor, $Warned, $Enabled == 2 ? false : true, $Class);
?>
</td>
			<td><?php 
echo ratio($Uploaded, $Downloaded);
?>
</td>
			<td><?php 
echo display_str($IP);
?>
</td>
			<td><?php 
echo display_str($Email);
?>
</td>
			<td><?php 
echo time_diff($JoinDate);
?>
</td>
			<td><?php 
Esempio n. 6
0
</li>
<?
}
$PeerStats = $Cache->get_value('stats_peers');
	if(!$PeerStats && check_perms('admin_clear_cache')) {
		$DB->query("SELECT COUNT(uid) FROM xbt_files_users WHERE remaining>0 AND active>0");
		list($LeecherCount) = $DB->next_record();
		if(!$LeecherCount) { $LeecherCount = 0; }
		$DB->query("SELECT COUNT(uid) FROM xbt_files_users WHERE remaining=0 AND active>0");
		list($SeederCount) = $DB->next_record();
		if(!$SeederCount) { $SeederCount = 0; }
		$Cache->cache_value('stats_peers',array($LeecherCount,$SeederCount),0);
	} else {
		list($LeecherCount,$SeederCount) = $PeerStats;
	}
	$Ratio = ratio($SeederCount, $LeecherCount);
	$PeerCount = $SeederCount + $LeecherCount;
?>
				<li>Peers: <?php 
echo number_format($PeerCount);
?>
</li>
				<li>Seeders: <?php 
echo number_format($SeederCount);
?>
</li>
				<li>Leechers: <?php 
echo number_format($LeecherCount);
?>
</li>
				<li>Seeder/Leecher Ratio: <?php 
Esempio n. 7
0
?>
/s</td>
		<td style="text-align:right"><?php 
echo get_size($Detail['Downloaded']);
?>
</td>
		<td style="text-align:right"><?php 
echo get_size($Detail['DownSpeed']);
?>
/s</td>
		<td style="text-align:right"><?php 
echo number_format($Detail['NumUploads']);
?>
</td>
		<td style="text-align:right"><?php 
echo ratio($Detail['Uploaded'], $Detail['Downloaded']);
?>
</td>
		<td style="text-align:right"><?php 
echo time_diff($Detail['JoinDate']);
?>
</td>
	</tr>
<?
	}
?>
</table><br />
<?
}
?>
Esempio n. 8
0
		<tr class="row<?php 
        echo $Row;
        ?>
">
			<td><?php 
        echo format_username($UserID, $Username, $Donor, $Warned, $Enabled, $PermissionID);
        ?>
<br /><?php 
        echo format_username($OtherID, $OtherUsername, $OtherDonor, $OtherWarned, $OtherEnabled, $OtherPermissionID);
        ?>
</td>
			<td><?php 
        echo ratio($Uploaded, $Downloaded);
        ?>
<br /><?php 
        echo ratio($OtherUploaded, $OtherDownloaded);
        ?>
</td>
			<td>
				<span style="float:left;"><?php 
        echo number_format($Value);
        ?>
</span>
			</td>
			<td>
				<span style="float:left;"><?php 
        echo display_str($IP);
        ?>
</span>
				<span style="float:right;"><?php 
        echo display_str($Uses);

<?php 
    site_stats();
    // Total Coins
    $totalcoins = intval($network_info["moneysupply"]);
    $totalcoins = number_format($totalcoins, 0, '.', ',');
    //Minted Reward last 1h/24h
    $hours = 1;
    list($POS1, $POW1, $POScoins1, $POWcoins1, $avgPOScoins1, $avgPOWcoins1) = get_num_pos($hours);
    list($POS24, $POW24, $POScoins24, $POWcoins24, $avgPOScoins24, $avgPOWcoins24) = get_num_pos($hours * 24);
    // Total Blocks
    $totalblocks = intval($network_info["blocks"]);
    // POS:POW Ratio
    $ratio1 = ratio($POS1, $POW1);
    $ratio24 = ratio($POS24, $POW24);
    ?>


<div class="coin-overview">
        <dl>
                <dt>Network Hashrate:</dt>
                <dd>
                <?php 
    if (intval($net_speed) < 1024) {
        echo "" . number_format($net_speed, 2) . " GH/s";
    } else {
        $net_speed = number_format($net_speed / 1024, 2);
        echo "" . $net_speed . " TH/s";
    }
    ?>