<input type="hidden" id="amount" name="amount" value="<?php echo !empty($Bounty) ? $Bounty : '100'; ?> " /> <input type="hidden" id="current_uploaded" value="<?php echo $LoggedUser['BytesUploaded']; ?> " /> <input type="hidden" id="current_downloaded" value="<?php echo $LoggedUser['BytesDownloaded']; ?> " /> Bounty after tax: <strong><span id="bounty_after_tax">90.00 MB</span></strong><br /> If you add the entered <strong><span id="new_bounty">100.00 MB</span></strong> of bounty, your new stats will be: <br /> Uploaded: <span id="new_uploaded"><?php echo Format::get_size($LoggedUser['BytesUploaded']); ?> </span><br /> Ratio: <span id="new_ratio"><?php echo Format::get_ratio_html($LoggedUser['BytesUploaded'], $LoggedUser['BytesDownloaded']); ?> </span> </td> </tr> <tr> <td colspan="2" class="center"> <input type="submit" id="button" value="Create request" disabled="disabled" /> </td> </tr> <?php } else {
if ($LoggedUser['BytesUploaded'] >= $Amount && $Filled === '0') { // Create vote! $DB->query("\n\t\tINSERT IGNORE INTO requests_votes\n\t\t\t(RequestID, UserID, Bounty)\n\t\tVALUES\n\t\t\t({$RequestID}, " . $LoggedUser['ID'] . ", {$Bounty})"); if ($DB->affected_rows() < 1) { //Insert failed, probably a dupe vote, just increase their bounty. $DB->query("\n\t\t\t\tUPDATE requests_votes\n\t\t\t\tSET Bounty = (Bounty + {$Bounty})\n\t\t\t\tWHERE UserID = " . $LoggedUser['ID'] . "\n\t\t\t\t\tAND RequestID = {$RequestID}"); echo 'dupe'; } $DB->query("\n\t\tUPDATE requests\n\t\tSET LastVote = NOW()\n\t\tWHERE ID = {$RequestID}"); $Cache->delete_value("request_{$RequestID}"); $Cache->delete_value("request_votes_{$RequestID}"); $ArtistForm = Requests::get_artists($RequestID); foreach ($ArtistForm as $Importance) { foreach ($Importance as $Artist) { $Cache->delete_value('artists_requests_' . $Artist['id']); } } // Subtract amount from user $DB->query("\n\t\tUPDATE users_main\n\t\tSET Uploaded = (Uploaded - {$Amount})\n\t\tWHERE ID = " . $LoggedUser['ID']); $Cache->delete_value('user_stats_' . $LoggedUser['ID']); Requests::update_sphinx_requests($RequestID); echo 'success'; $DB->query("\n\t\tSELECT UserID\n\t\tFROM requests_votes\n\t\tWHERE RequestID = '{$RequestID}'\n\t\t\tAND UserID != '{$LoggedUser['ID']}'"); $UserIDs = array(); while (list($UserID) = $DB->next_record()) { $UserIDs[] = $UserID; } NotificationsManager::notify_users($UserIDs, NotificationsManager::REQUESTALERTS, Format::get_size($Amount) . " of bounty has been added to a request you've voted on!", "requests.php?action=view&id=" . $RequestID); } elseif ($LoggedUser['BytesUploaded'] < $Amount) { echo 'bankrupt'; }
/** * Produce a summary text over the collector results * * @param bool $FilterStats whether to include filter stats in the report * @return summary text */ public function summary($FilterStats) { global $ScriptStartTime; $Time = number_format(1000 * (microtime(true) - $ScriptStartTime), 2) . " ms"; $Used = Format::get_size(memory_get_usage(true)); $Date = date("M d Y, H:i"); $NumSkipped = count($this->SkippedFiles); return "Collector Download Summary for {$this->Title} - " . SITE_NAME . "\r\n" . "\r\n" . "User:\t\t{$this->User[Username]}\r\n" . "Passkey:\t{$this->User[torrent_pass]}\r\n" . "\r\n" . "Time:\t\t{$Time}\r\n" . "Used:\t\t{$Used}\r\n" . "Date:\t\t{$Date}\r\n" . "\r\n" . ($FilterStats !== false ? "Torrent groups analyzed:\t{$this->NumFound}\r\n" . "Torrent groups filtered:\t{$NumSkipped}\r\n" : "") . "Torrents downloaded:\t\t{$this->NumAdded}\r\n" . "\r\n" . "Total size of torrents (ratio hit): " . Format::get_size($this->Size) . "\r\n" . ($NumSkipped ? "\r\n" . "Albums unavailable within your criteria (consider making a request for your desired format):\r\n" . implode("\r\n", $this->SkippedFiles) . "\r\n" : ""); }
" class="tooltip" title="Report">RP</a> </span> <strong><?php echo $DisplayName; ?> </strong> <?php Votes::vote_link($GroupID, $UserVote); ?> <div class="tags"><?php echo $TorrentTags->format(); ?> </div> </td> <td class="number_column nobr"><?php echo Format::get_size($Torrent['Size']); ?> </td> <td class="number_column"><?php echo number_format($Torrent['Snatched']); ?> </td> <td class="number_column<?php echo $Torrent['Seeders'] == 0 ? ' r00' : ''; ?> "><?php echo number_format($Torrent['Seeders']); ?> </td> <td class="number_column"><?php echo number_format($Torrent['Leechers']);
function filelist($Str) { return "</td>\n<td>" . Format::get_size($Str[1]) . "</td>\n</tr>"; }
function make_tree() { $QueryID = G::$DB->get_query_id(); $UserID = $this->UserID; ?> <div class="invitetree pad"> <?php G::$DB->query("\n\t\t\tSELECT TreePosition, TreeID, TreeLevel\n\t\t\tFROM invite_tree\n\t\t\tWHERE UserID = {$UserID}"); list($TreePosition, $TreeID, $TreeLevel) = G::$DB->next_record(MYSQLI_NUM, false); if (!$TreeID) { return; } G::$DB->query("\n\t\t\tSELECT TreePosition\n\t\t\tFROM invite_tree\n\t\t\tWHERE TreeID = {$TreeID}\n\t\t\t\tAND TreeLevel = {$TreeLevel}\n\t\t\t\tAND TreePosition > {$TreePosition}\n\t\t\tORDER BY TreePosition ASC\n\t\t\tLIMIT 1"); if (G::$DB->has_results()) { list($MaxPosition) = G::$DB->next_record(MYSQLI_NUM, false); } else { $MaxPosition = false; } $TreeQuery = G::$DB->query("\n\t\t\tSELECT\n\t\t\t\tit.UserID,\n\t\t\t\tEnabled,\n\t\t\t\tPermissionID,\n\t\t\t\tDonor,\n\t\t\t\tUploaded,\n\t\t\t\tDownloaded,\n\t\t\t\tParanoia,\n\t\t\t\tTreePosition,\n\t\t\t\tTreeLevel\n\t\t\tFROM invite_tree AS it\n\t\t\t\tJOIN users_main AS um ON um.ID = it.UserID\n\t\t\t\tJOIN users_info AS ui ON ui.UserID = it.UserID\n\t\t\tWHERE TreeID = {$TreeID}\n\t\t\t\tAND TreePosition > {$TreePosition}" . ($MaxPosition ? " AND TreePosition < {$MaxPosition}" : '') . "\n\t\t\t\tAND TreeLevel > {$TreeLevel}\n\t\t\tORDER 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, $Enabled, $Class, $Donor, $Uploaded, $Downloaded, $Paranoia, $TreePosition, $TreeLevel) = G::$DB->next_record(MYSQLI_NUM, false)) { // 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 "\n\n<ul class=\"invitetree\">\n\t<li>\n"; } } elseif ($TreeLevel < $PreviousTreeLevel) { for ($i = 0; $i < $PreviousTreeLevel - $TreeLevel; $i++) { echo "\t</li>\n</ul>\n"; } echo "\t</li>\n\t<li>\n"; } else { echo "\t</li>\n\t<li>\n"; } $UserClass = $Classes[$Class]['Level']; ?> <strong><?php echo Users::format_username($ID, true, true, $Enabled != 2 ? false : true, true); ?> </strong> <?php if (check_paranoia(array('uploaded', 'downloaded'), $Paranoia, $UserClass)) { $TotalUpload += $Uploaded; $TotalDownload += $Downloaded; ?> Uploaded: <strong><?php echo Format::get_size($Uploaded); ?> </strong> Downloaded: <strong><?php echo Format::get_size($Downloaded); ?> </strong> Ratio: <strong><?php echo Format::get_ratio_html($Uploaded, $Downloaded); ?> </strong> <?php } else { $ParanoidCount++; ?> Hidden <?php } ?> <?php $PreviousTreeLevel = $TreeLevel; G::$DB->set_query_id($TreeQuery); } $Tree = ob_get_clean(); for ($i = 0; $i < $PreviousTreeLevel - $OriginalTreeLevel; $i++) { $Tree .= "\t</li>\n</ul>\n"; } if ($Count) { ?> <p style="font-weight: bold;"> This tree has <?php echo number_format($Count); ?> entries, <?php echo number_format($Branches); ?> branches, and a depth of <?php echo number_format($MaxTreeLevel - $OriginalTreeLevel); ?> . It has <?php $ClassStrings = array(); foreach ($ClassSummary as $ClassID => $ClassCount) { if ($ClassCount == 0) { continue; } $LastClass = Users::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 ' . Format::get_size($TotalUpload); echo '; the total amount downloaded was ' . Format::get_size($TotalDownload); echo '; and the total ratio is ' . Format::get_ratio_html($TotalUpload, $TotalDownload) . '. '; echo '</p>'; echo '<p style="font-weight: bold;">'; echo 'The total amount uploaded by direct invitees (the top level) was ' . Format::get_size($TopLevelUpload); echo '; the total amount downloaded was ' . Format::get_size($TopLevelDownload); echo '; and the total ratio is ' . Format::get_ratio_html($TopLevelUpload, $TopLevelDownload) . '. '; echo "These numbers include the stats of paranoid users and will be factored into the invitation giving script.\n\t\t</p>\n"; 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> <?php G::$DB->set_query_id($QueryID); }
?> </strong> <?php } if (check_paranoia('uploaded', $Paranoia, $Class, $FriendID)) { ?> Up: <strong><?php echo Format::get_size($Uploaded); ?> </strong> <?php } if (check_paranoia('downloaded', $Paranoia, $Class, $FriendID)) { ?> Down: <strong><?php echo Format::get_size($Downloaded); ?> </strong> <?php } ?> </span> <?php if (check_paranoia('lastseen', $Paranoia, $Class, $FriendID)) { ?> <span style="float: right;"><?php echo time_diff($LastAccess); ?> </span> <?php }
public function flag_table($Flags = false) { if (!is_array($Flags)) { $Flags = $this->get_flags(); } if (empty($Flags)) { return; } ?> <table class="layout" width="100%"> <tr> <td align="left"><strong><a href="#" onclick="$(this).parents('.layout').next('#debug_flags').gtoggle(); return false;" class="brackets">View</a> Flags:</strong></td> </tr> </table> <table id="debug_flags" class="debug_table hidden" width="100%"> <tr valign="top"> <td align="left" class="debug_flags_event"><strong>Event</strong></td> <td align="left" class="debug_flags_time"><strong>Page time</strong></td> <?php if ($Flags[0][3] !== false) { ?> <td align="left" class="debug_flags_time"><strong>CPU time</strong></td> <?php } ?> <td align="left" class="debug_flags_memory"><strong>Memory</strong></td> </tr> <?php foreach ($Flags as $Flag) { list($Event, $MicroTime, $Memory, $CPUTime) = $Flag; ?> <tr valign="top"> <td align="left"><?php echo $Event; ?> </td> <td align="left"><?php echo number_format($MicroTime, 3); ?> ms</td> <?php if ($CPUTime !== false) { ?> <td align="left"><?php echo number_format($CPUTime / 1000, 3); ?> ms</td> <?php } ?> <td align="left"><?php echo Format::get_size($Memory); ?> </td> </tr> <?php } ?> </table> <?php }
</li> <li><strong>Mean download: </strong><?php echo Format::get_size($TotalDownload / $NumUsers); ?> </li> <li><strong>Mean buffer: </strong><?php echo Format::get_size(($TotalUpload - $TotalDownload) / $NumUsers); ?> </li> <br /> <li><strong>Total request bounty: </strong><?php echo Format::get_size($TotalBounty); ?> </li> <li><strong>Available request bounty: </strong><?php echo Format::get_size($AvailableBounty); ?> </li> </ul> </div> </div> <br /> <div class="box"> <div class="head">Swarms and snatches</div> <div class="pad"> <ul class="stats nobullet"> <li><strong>Total seeders: </strong><?php echo number_format($TotalSeeders); ?> </li> <li><strong>Total leechers: </strong><?php
function generate_torrent_table($Caption, $Tag, $Details, $Limit) { global $LoggedUser, $Categories, $ReleaseTypes, $GroupBy; ?> <h3>Top <?php echo "{$Limit} {$Caption}"; if (empty($_GET['advanced'])) { ?> <small class="top10_quantity_links"> <?php switch ($Limit) { case 100: ?> - <a href="top10.php?details=<?php echo $Tag; ?> " class="brackets">Top 10</a> - <span class="brackets">Top 100</span> - <a href="top10.php?type=torrents&limit=250&details=<?php echo $Tag; ?> " class="brackets">Top 250</a> <?php break; case 250: ?> - <a href="top10.php?details=<?php echo $Tag; ?> " class="brackets">Top 10</a> - <a href="top10.php?type=torrents&limit=100&details=<?php echo $Tag; ?> " class="brackets">Top 100</a> - <span class="brackets">Top 250</span> <?php break; default: ?> - <span class="brackets">Top 10</span> - <a href="top10.php?type=torrents&limit=100&details=<?php echo $Tag; ?> " class="brackets">Top 100</a> - <a href="top10.php?type=torrents&limit=250&details=<?php echo $Tag; ?> " class="brackets">Top 250</a> <?php } ?> </small> <?php } ?> </h3> <table class="torrent_table cats numbering border"> <tr class="colhead"> <td class="center" style="width: 15px;"></td> <td class="cats_col"></td> <td>Name</td> <td style="text-align: right;">Size</td> <td style="text-align: right;">Data</td> <td style="text-align: right;" class="sign snatches"><img src="static/styles/<?php echo $LoggedUser['StyleName']; ?> /images/snatched.png" alt="Snatches" title="Snatches" class="tooltip" /></td> <td style="text-align: right;" class="sign seeders"><img src="static/styles/<?php echo $LoggedUser['StyleName']; ?> /images/seeders.png" alt="Seeders" title="Seeders" class="tooltip" /></td> <td style="text-align: right;" class="sign leechers"><img src="static/styles/<?php echo $LoggedUser['StyleName']; ?> /images/leechers.png" alt="Leechers" title="Leechers" class="tooltip" /></td> <td style="text-align: right;">Peers</td> </tr> <?php // Server is already processing a top10 query. Starting another one will make things slow if ($Details === false) { ?> <tr class="rowb"> <td colspan="9" class="center"> Server is busy processing another top list request. Please try again in a minute. </td> </tr> </table><br /> <?php return; } // in the unlikely event that query finds 0 rows... if (empty($Details)) { ?> <tr class="rowb"> <td colspan="9" class="center"> Found no torrents matching the criteria. </td> </tr> </table><br /> <?php return; } $Rank = 0; foreach ($Details as $Detail) { $GroupIDs[] = $Detail[1]; } $Artists = Artists::get_artists($GroupIDs); foreach ($Details as $Detail) { list($TorrentID, $GroupID, $GroupName, $GroupCategoryID, $WikiImage, $TagsList, $Format, $Encoding, $Media, $Scene, $HasLog, $HasCue, $LogScore, $Year, $GroupYear, $RemasterTitle, $Snatched, $Seeders, $Leechers, $Data, $ReleaseType, $Size) = $Detail; $IsBookmarked = Bookmarks::has_bookmarked('torrent', $GroupID); $IsSnatched = Torrents::has_snatched($TorrentID); // highlight every other row $Rank++; $Highlight = $Rank % 2 ? 'a' : 'b'; // generate torrent's title $DisplayName = ''; if (!empty($Artists[$GroupID])) { $DisplayName = Artists::display_artists($Artists[$GroupID], true, true); } $DisplayName .= "<a href=\"torrents.php?id={$GroupID}&torrentid={$TorrentID}\" class=\"tooltip\" title=\"View torrent\" dir=\"ltr\">{$GroupName}</a>"; if ($GroupCategoryID == 1 && $GroupYear > 0) { $DisplayName .= " [{$GroupYear}]"; } if ($GroupCategoryID == 1 && $ReleaseType > 0) { $DisplayName .= ' [' . $ReleaseTypes[$ReleaseType] . ']'; } // append extra info to torrent title $ExtraInfo = ''; $AddExtra = ''; if (empty($GroupBy)) { if ($Format) { $ExtraInfo .= $Format; $AddExtra = ' / '; } if ($Encoding) { $ExtraInfo .= $AddExtra . $Encoding; $AddExtra = ' / '; } // "FLAC / Lossless / Log (100%) / Cue / CD"; if ($HasLog) { $ExtraInfo .= $AddExtra . 'Log (' . $LogScore . '%)'; $AddExtra = ' / '; } if ($HasCue) { $ExtraInfo .= $AddExtra . 'Cue'; $AddExtra = ' / '; } if ($Media) { $ExtraInfo .= $AddExtra . $Media; $AddExtra = ' / '; } if ($Scene) { $ExtraInfo .= $AddExtra . 'Scene'; $AddExtra = ' / '; } if ($Year > 0) { $ExtraInfo .= $AddExtra . $Year; $AddExtra = ' '; } if ($RemasterTitle) { $ExtraInfo .= $AddExtra . $RemasterTitle; } if ($IsSnatched) { if ($GroupCategoryID == 1) { $ExtraInfo .= ' / '; } $ExtraInfo .= Format::torrent_label('Snatched!'); } if ($ExtraInfo != '') { $ExtraInfo = "- [{$ExtraInfo}]"; } } $TorrentTags = new Tags($TagsList); //Get report info, use the cache if available, if not, add to it. $Reported = false; $Reports = Torrents::get_reports($TorrentID); if (count($Reports) > 0) { $Reported = true; } // print row ?> <tr class="torrent row<?php echo $Highlight . ($IsBookmarked ? ' bookmarked' : '') . ($IsSnatched ? ' snatched_torrent' : ''); ?> "> <td style="padding: 8px; text-align: center;"><strong><?php echo $Rank; ?> </strong></td> <td class="center cats_col"><div title="<?php echo $TorrentTags->title(); ?> " class="tooltip <?php echo Format::css_category($GroupCategoryID); ?> <?php echo $TorrentTags->css_name(); ?> "></div></td> <td class="big_info"> <?php if ($LoggedUser['CoverArt']) { ?> <div class="group_image float_left clear"> <?php ImageTools::cover_thumb($WikiImage, $GroupCategoryID); ?> </div> <?php } ?> <div class="group_info clear"> <span><a href="torrents.php?action=download&id=<?php echo $TorrentID; ?> &authkey=<?php echo $LoggedUser['AuthKey']; ?> &torrent_pass=<?php echo $LoggedUser['torrent_pass']; ?> " title="Download" class="brackets tooltip">DL</a></span> <strong><?php echo $DisplayName; ?> </strong> <?php echo $ExtraInfo; if ($Reported) { ?> - <strong class="torrent_label tl_reported">Reported</strong><?php } if ($IsBookmarked) { ?> <span class="remove_bookmark float_right"> <a href="#" id="bookmarklink_torrent_<?php echo $GroupID; ?> " class="bookmarklink_torrent_<?php echo $GroupID; ?> brackets" onclick="Unbookmark('torrent', <?php echo $GroupID; ?> , 'Bookmark'); return false;">Remove bookmark</a> </span> <?php } else { ?> <span class="add_bookmark float_right"> <a href="#" id="bookmarklink_torrent_<?php echo $GroupID; ?> " class="bookmarklink_torrent_<?php echo $GroupID; ?> brackets" onclick="Bookmark('torrent', <?php echo $GroupID; ?> , 'Remove bookmark'); return false;">Bookmark</a> </span> <?php } ?> <div class="tags"><?php echo $TorrentTags->format(); ?> </div> </div> </td> <td class="number_column nobr"><?php echo Format::get_size($Size); ?> </td> <td class="number_column nobr"><?php echo Format::get_size($Data); ?> </td> <td class="number_column"><?php echo number_format((double) $Snatched); ?> </td> <td class="number_column"><?php echo number_format((double) $Seeders); ?> </td> <td class="number_column"><?php echo number_format((double) $Leechers); ?> </td> <td class="number_column"><?php echo number_format($Seeders + $Leechers); ?> </td> </tr> <?php } //foreach ($Details as $Detail) ?> </table><br /> <?php }
?> " class="brackets">Schema</a></td> </tr> <?php } ?> <tr> <td></td> <td></td> <td><?php echo number_format($TotalRows); ?> </td> <td></td> <td><?php echo Format::get_size($TotalDataSize); ?> </td> <td><?php echo Format::get_size($TotalIndexSize); ?> </td> <td><?php echo Format::get_size($TotalDataSize + $TotalIndexSize); ?> </td> <td></td> </tr> </table> <?php View::show_footer();
public function get_perf() { $PageTime = microtime(true) - $this->timestart; $CPUTime = self::get_cpu_time(); $Perf = array('RameUsage' => Format::get_size(memory_get_usage(true)), 'TimePage' => number_format($PageTime, 3) . ' s'); if ($CPUTime) { $Perf['TimeCPU'] = number_format($CPUTime / 1000000, 3) . ' s'; } return $Perf; }
?> " /> <a href="javascript:Vote(0, <?php echo $RequestID; ?> )" class="brackets"><strong>+</strong></a> <?php } ?> </td> <td class="nobr"> <span id="bounty_<?php echo $RequestID; ?> "><?php echo Format::get_size($Request['Bounty']); ?> </span> </td> <td> <?php echo time_diff($Request['TimeAdded']); ?> </td> </tr> <?php } ?> </table> <?php }
// If we can't take it all out of upload, zero that out and add whatever is left as download. $DB->query("\n\t\tUPDATE users_main\n\t\tSET Uploaded = 0\n\t\tWHERE ID = {$FillerID}"); $DB->query(' UPDATE users_main SET Downloaded = Downloaded + ' . ($RequestVotes['TotalBounty'] - $Uploaded) . "\n\t\tWHERE ID = {$FillerID}"); } else { $DB->query(' UPDATE users_main SET Uploaded = Uploaded - ' . $RequestVotes['TotalBounty'] . "\n\t\tWHERE ID = {$FillerID}"); } Misc::send_pm($FillerID, 0, 'A request you filled has been unfilled', "The request \"[url=" . site_url() . "requests.php?action=view&id={$RequestID}]{$FullName}" . "[/url]\" was unfilled by [url=" . site_url() . 'user.php?id=' . $LoggedUser['ID'] . ']' . $LoggedUser['Username'] . '[/url] for the reason: [quote]' . $_POST['reason'] . "[/quote]\nIf you feel like this request was unjustly unfilled, please [url=" . site_url() . "reports.php?action=report&type=request&id={$RequestID}]report the request[/url] and explain why this request should not have been unfilled."); $Cache->delete_value("user_stats_{$FillerID}"); if ($UserID !== $LoggedUser['ID']) { Misc::send_pm($UserID, 0, 'A request you created has been unfilled', "The request \"[url=" . site_url() . "requests.php?action=view&id={$RequestID}]{$FullName}" . "[/url]\" was unfilled by [url=" . site_url() . 'user.php?id=' . $LoggedUser['ID'] . ']' . $LoggedUser['Username'] . "[/url] for the reason: [quote]" . $_POST['reason'] . '[/quote]'); } Misc::write_log("Request {$RequestID} ({$FullName}), with a " . Format::get_size($RequestVotes['TotalBounty']) . ' bounty, was unfilled by user ' . $LoggedUser['ID'] . ' (' . $LoggedUser['Username'] . ') for the reason: ' . $_POST['reason']); $Cache->delete_value("request_{$RequestID}"); $Cache->delete_value("request_artists_{$RequestID}"); if ($GroupID) { $Cache->delete_value("requests_group_{$GroupID}"); } Requests::update_sphinx_requests($RequestID); if (!empty($ArtistForm)) { foreach ($ArtistForm as $ArtistType) { foreach ($ArtistType as $Artist) { $Cache->delete_value('artists_requests_' . $Artist['id']); } } } $SphQL = new SphinxqlQuery(); $SphQL->raw_query("\n\t\tUPDATE requests, requests_delta\n\t\tSET torrentid = 0, fillerid = 0\n\t\tWHERE id = {$RequestID}", false);
function generate_user_table($Caption, $Tag, $Details, $Limit) { global $Time; ?> <h3>Top <?php echo $Limit . ' ' . $Caption; ?> <small class="top10_quantity_links"> <?php switch ($Limit) { case 100: ?> - <a href="top10.php?type=users&details=<?php echo $Tag; ?> " class="brackets">Top 10</a> - <span class="brackets">Top 100</span> - <a href="top10.php?type=users&limit=250&details=<?php echo $Tag; ?> " class="brackets">Top 250</a> <?php break; case 250: ?> - <a href="top10.php?type=users&details=<?php echo $Tag; ?> " class="brackets">Top 10</a> - <a href="top10.php?type=users&limit=100&details=<?php echo $Tag; ?> " class="brackets">Top 100</a> - <span class="brackets">Top 250</span> <?php break; default: ?> - <span class="brackets">Top 10</span> - <a href="top10.php?type=users&limit=100&details=<?php echo $Tag; ?> " class="brackets">Top 100</a> - <a href="top10.php?type=users&limit=250&details=<?php echo $Tag; ?> " class="brackets">Top 250</a> <?php } ?> </small> </h3> <table class="border"> <tr class="colhead"> <td class="center">Rank</td> <td>User</td> <td style="text-align: right;">Uploaded</td> <td style="text-align: right;">UL speed</td> <td style="text-align: right;">Downloaded</td> <td style="text-align: right;">DL speed</td> <td style="text-align: right;">Uploads</td> <td style="text-align: right;">Ratio</td> <td style="text-align: right;">Joined</td> </tr> <?php // in the unlikely event that query finds 0 rows... if (empty($Details)) { echo ' <tr class="rowb"> <td colspan="9" class="center"> Found no users matching the criteria </td> </tr> </table><br />'; return; } $Rank = 0; foreach ($Details as $Detail) { $Rank++; $Highlight = $Rank % 2 ? 'a' : 'b'; ?> <tr class="row<?php echo $Highlight; ?> "> <td class="center"><?php echo $Rank; ?> </td> <td><?php echo Users::format_username($Detail['ID'], false, false, false); ?> </td> <td class="number_column"><?php echo Format::get_size($Detail['Uploaded']); ?> </td> <td class="number_column tooltip" title="Upload speed is reported in base 2 in bytes per second, not bits per second."><?php echo Format::get_size($Detail['UpSpeed']); ?> /s</td> <td class="number_column"><?php echo Format::get_size($Detail['Downloaded']); ?> </td> <td class="number_column tooltip" title="Download speed is reported in base 2 in bytes per second, not bits per second."><?php echo Format::get_size($Detail['DownSpeed']); ?> /s</td> <td class="number_column"><?php echo number_format($Detail['NumUploads']); ?> </td> <td class="number_column"><?php echo Format::get_ratio_html($Detail['Uploaded'], $Detail['Downloaded']); ?> </td> <td class="number_column"><?php echo time_diff($Detail['JoinDate']); ?> </td> </tr> <?php } ?> </table><br /> <?php }
?> ">View</a> </li> <li> <span<?php echo $ViewCount === 2 ? ' class="paranoia_override"' : ''; ?> >Requests voted: <?php echo number_format($RequestsVoted); ?> </span> <span<?php echo $ViewBounty === 2 ? ' class="paranoia_override"' : ''; ?> > for <?php echo Format::get_size($TotalSpent); ?> </span> <a href="requests.php?type=voted&userid=<?php echo $UserID; ?> " class="brackets<?php echo $ViewAll === 2 ? ' paranoia_override' : ''; ?> ">View</a> </li> <?php } if ($Override = check_paranoia_here('uploads+')) { ?> <li id="comm_upload"<?php
<li><strong>Torrents this month: </strong><?php echo number_format($MonthNum); ?> </li> <li><strong>Size this month: </strong><?php echo Format::get_size($MonthSize); ?> </li> <li><strong>Files this month: </strong><?php echo number_format($MonthFiles); ?> </li> <br /> <li><strong>Torrents per day this month: </strong><?php echo number_format($MonthNum / 30); ?> </li> <li><strong>Size per day this month: </strong><?php echo Format::get_size($MonthSize / 30); ?> </li> <li><strong>Files per day this month: </strong><?php echo number_format($MonthFiles / 30); ?> </li> </ul> </div> </div> </div> <?php View::show_footer();
<td class="number_column"><?php echo Format::get_ratio_html($Uploaded, $Downloaded); ?> </td> <td class="number_column"><?php echo number_format($RequiredRatio, 2); ?> </td> <td class="number_column"><?php if ($Downloaded * $RequiredRatio > $Uploaded) { echo Format::get_size($Downloaded * $RequiredRatio - $Uploaded); } ?> </td> <td class="number_column"><?php echo Format::get_size($Downloaded - $RatioWatchDownload); ?> </td> <td><?php echo time_diff($Joined, 2); ?> </td> <td><?php echo time_diff($RatioWatchEnds); ?> </td> <td><?php //time_diff(strtotime($Joined), strtotime($RatioWatchEnds)) ?> </td> </tr>
?> "><?php echo Format::get_size(G::$LoggedUser['BytesUploaded']); ?> </span> </li> <li id="stats_leeching"> <a href="torrents.php?type=leeching&userid=<?php echo G::$LoggedUser['ID']; ?> ">Down</a>: <span class="stat tooltip" title="<?php echo Format::get_size(G::$LoggedUser['BytesDownloaded'], 5); ?> "><?php echo Format::get_size(G::$LoggedUser['BytesDownloaded']); ?> </span> </li> <li id="stats_ratio"> Ratio: <span class="stat"><?php echo Format::get_ratio_html(G::$LoggedUser['BytesUploaded'], G::$LoggedUser['BytesDownloaded']); ?> </span> </li> <?php if (!empty(G::$LoggedUser['RequiredRatio'])) { ?> <li id="stats_required"> <a href="rules.php?p=ratio">Required</a>: <span class="stat tooltip" title="<?php
?> <br /> Leeching: <?php echo $UserPeerStats[0] === false ? "hidden" : number_format($UserPeerStats[0]); ?> <br /> Seeding: <?php echo $UserPeerStats[1] === false ? "hidden" : number_format($UserPeerStats[1]); ?> <br /> <?php } elseif (!empty($MainStats)) { foreach ($MainStats as $Key => $Value) { if (is_numeric($Value)) { if (substr($Key, 0, 6) === "bytes ") { $Value = Format::get_size($Value); $Key = substr($Key, 6); } else { $Value = number_format($Value); } } ?> <?php echo "{$Value} {$Key}<br />\n"; } } elseif (isset($TorrentPass)) { ?> Failed to get stats for user <?php echo $_GET['userid']; } elseif (isset($_GET['userid'])) { ?>
</span><br /> Ratio: <span id="new_ratio"><?php echo Format::get_ratio_html($LoggedUser['BytesUploaded'], $LoggedUser['BytesDownloaded']); ?> </span> <input type="button" id="button" value="Vote!" disabled="disabled" onclick="Vote();" /> </form> </td> </tr> <?php } ?> <tr id="bounty"> <td class="label">Bounty</td> <td id="formatted_bounty"><?php echo Format::get_size($RequestVotes['TotalBounty']); ?> </td> </tr> <?php if ($IsFilled) { $TimeCompare = 1267643718; // Requests v2 was implemented 2010-03-03 20:15:18 ?> <tr> <td class="label">Filled</td> <td> <strong><a href="torrents.php?<?php echo (strtotime($Request['TimeFilled']) < $TimeCompare ? 'id=' : 'torrentid=') . $Request['TorrentID']; ?> ">Yes</a></strong>,
} else { ?> <td>Peer</td> <?php } ?> <td><?php echo $Active ? '<span style="color: green;">Yes</span>' : '<span style="color: red;">No</span>'; ?> </td> <td><?php echo $Connectable ? '<span style="color: green;">Yes</span>' : '<span style="color: red;">No</span>'; ?> </td> <td class="number_column"><?php echo Format::get_size($Uploaded); ?> </td> <td class="number_column"><?php echo number_format(($Size - $Remaining) / $Size * 100, 2); ?> </td> <td><?php echo display_str($UserAgent); ?> </td> </tr> <?php } ?> </table>
if (check_perms('site_vote')) { ?> <a href="javascript:Vote(0, <?php echo $RequestID; ?> )" class="brackets">+</a> <?php } ?> </td> <td> <span id="bounty_<?php echo $RequestID; ?> "><?php echo Format::get_size($Bounty); ?> </span> </td> <td> <?php echo time_diff($Request['TimeAdded']); ?> </td> </tr> <?php } ?> </table> </div> </div>
<div class="tags"><?php echo $TorrentTags->format("torrents.php?{$Action}&taglist="); ?> </div> </div> </td> <td><?php echo $Data['FileCount']; ?> </td> <td class="nobr"><?php echo time_diff($Data['Time'], 1); ?> </td> <td class="number_column nobr"><?php echo Format::get_size($Data['Size']); ?> </td> <td class="number_column"><?php echo number_format($Data['Snatched']); ?> </td> <td class="number_column<?php echo $Data['Seeders'] == 0 ? ' r00' : ''; ?> "><?php echo number_format($Data['Seeders']); ?> </td> <td class="number_column"><?php echo number_format($Data['Leechers']);
IRC Server: ' . BOT_SERVER . ' Port: ' . BOT_PORT . ' (' . BOT_PORT_SSL . ' for SSL) Once you are connected to our server you will need to join our disabled users channel. Type: /join ' . BOT_DISABLED_CHAN . ' Please visit us soon so we can help you resolve this matter.', 'noreply'); } if ($MergeStatsFrom && check_perms('users_edit_ratio')) { $DB->query("\n\t\tSELECT ID, Uploaded, Downloaded\n\t\tFROM users_main\n\t\tWHERE Username LIKE '{$MergeStatsFrom}'"); if ($DB->has_results()) { list($MergeID, $MergeUploaded, $MergeDownloaded) = $DB->next_record(); $DB->query("\n\t\t\tUPDATE users_main AS um\n\t\t\t\tJOIN users_info AS ui ON um.ID = ui.UserID\n\t\t\tSET\n\t\t\t\tum.Uploaded = 0,\n\t\t\t\tum.Downloaded = 0,\n\t\t\t\tui.AdminComment = CONCAT('" . sqltime() . ' - Stats (Uploaded: ' . Format::get_size($MergeUploaded) . ', Downloaded: ' . Format::get_size($MergeDownloaded) . ', Ratio: ' . Format::get_ratio($MergeUploaded, $MergeDownloaded) . ') merged into ' . site_url() . "user.php?id={$UserID} (" . $Cur['Username'] . ') by ' . $LoggedUser['Username'] . "\n\n', ui.AdminComment)\n\t\t\tWHERE ID = {$MergeID}"); $UpdateSet[] = "Uploaded = Uploaded + '{$MergeUploaded}'"; $UpdateSet[] = "Downloaded = Downloaded + '{$MergeDownloaded}'"; $EditSummary[] = 'stats merged from ' . site_url() . "user.php?id={$MergeID} ({$MergeStatsFrom}) (previous stats: Uploaded: " . Format::get_size($Cur['Uploaded']) . ', Downloaded: ' . Format::get_size($Cur['Downloaded']) . ', Ratio: ' . Format::get_ratio($Cur['Uploaded'], $Cur['Downloaded']) . ')'; $Cache->delete_value("user_stats_{$UserID}"); $Cache->delete_value("user_stats_{$MergeID}"); } } if ($Pass && check_perms('users_edit_password')) { $UpdateSet[] = "PassHash = '" . db_string(Users::make_crypt_hash($Pass)) . "'"; $EditSummary[] = 'password reset'; $Cache->delete_value("user_info_{$UserID}"); $Cache->delete_value("user_info_heavy_{$UserID}"); $Cache->delete_value("user_stats_{$UserID}"); $Cache->delete_value("enabled_{$UserID}"); $DB->query("\n\t\tSELECT SessionID\n\t\tFROM users_sessions\n\t\tWHERE UserID = '{$UserID}'"); while (list($SessionID) = $DB->next_record()) { $Cache->delete_value("session_{$UserID}_{$SessionID}"); }
echo Format::get_size($MemStats['bytes_read'] / $MemStats['uptime']); ?> /s</td> </tr> <tr> <td>Database:</td> <td><?php echo Format::get_size($DBStats['Bytes_received']['Value'] / $DBStats['Uptime']['Value']); ?> /s</td> </tr> <tr><td colspan="2"><strong>Data Write</strong></td></tr> <tr> <td>Cache:</td> <td><?php echo Format::get_size($MemStats['bytes_written'] / $MemStats['uptime']); ?> /s</td> </tr> <tr> <td>Database:</td> <td><?php echo Format::get_size($DBStats['Bytes_sent']['Value'] / $DBStats['Uptime']['Value']); ?> /s</td> </tr> </table> </div> </div> <?php View::show_footer();
$DB->query("\n\tUPDATE requests\n\tSET FillerID = {$FillerID},\n\t\tTorrentID = {$TorrentID},\n\t\tTimeFilled = '" . sqltime() . "'\n\tWHERE ID = {$RequestID}"); if ($CategoryName === 'Music') { $ArtistForm = Requests::get_artists($RequestID); $ArtistName = Artists::display_artists($ArtistForm, false, true); $FullName = $ArtistName . $Title; } else { $FullName = $Title; } $DB->query("\n\tSELECT UserID\n\tFROM requests_votes\n\tWHERE RequestID = {$RequestID}"); $UserIDs = $DB->to_array(); foreach ($UserIDs as $User) { list($VoterID) = $User; Misc::send_pm($VoterID, 0, "The request \"{$FullName}\" has been filled", 'One of your requests — [url=' . site_url() . "requests.php?action=view&id={$RequestID}]{$FullName}" . '[/url] — has been filled. You can view it here: [url]' . site_url() . "torrents.php?torrentid={$TorrentID}" . '[/url]'); } $RequestVotes = Requests::get_votes_array($RequestID); Misc::write_log("Request {$RequestID} ({$FullName}) was filled by user {$FillerID} ({$FillerUsername}) with the torrent {$TorrentID} for a " . Format::get_size($RequestVotes['TotalBounty']) . ' bounty.'); // Give bounty $DB->query("\n\tUPDATE users_main\n\tSET Uploaded = (Uploaded + " . $RequestVotes['TotalBounty'] . ")\n\tWHERE ID = {$FillerID}"); $Cache->delete_value("user_stats_{$FillerID}"); $Cache->delete_value("request_{$RequestID}"); if ($GroupID) { $Cache->delete_value("requests_group_{$GroupID}"); } $DB->query("\n\tSELECT ArtistID\n\tFROM requests_artists\n\tWHERE RequestID = {$RequestID}"); $ArtistIDs = $DB->to_array(); foreach ($ArtistIDs as $ArtistID) { $Cache->delete_value("artists_requests_{$ArtistID}"); } Requests::update_sphinx_requests($RequestID); $SphQL = new SphinxqlQuery(); $SphQL->raw_query("UPDATE requests, requests_delta SET torrentid = {$TorrentID}, fillerid = {$FillerID} WHERE id = {$RequestID}", false);
<span class="tooltip" title="Manage sessions"> from <?php echo $LastActive['IP']; ?> .</span> </a> </p> <?php } ?> <p> <strong>Time:</strong> <span><?php echo number_format((microtime(true) - $ScriptStartTime) * 1000, 5); ?> ms</span> <strong>Used:</strong> <span><?php echo Format::get_size(memory_get_usage(true)); ?> </span> <strong>Load:</strong> <span><?php echo number_format($Load[0], 2) . ' ' . number_format($Load[1], 2) . ' ' . number_format($Load[2], 2); ?> </span> <strong>Date:</strong> <span id="site_date"><?php echo date('M d Y'); ?> </span>, <span id="site_time"><?php echo date('H:i'); ?> </span> </p>