BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

private.php 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. <?php
  2. #declare(strict_types=1);
  3. $ENV = ENV::go();
  4. Text::$TOC = true;
  5. $NewsCount = 2;
  6. if (!$News = $Cache->get_value('news')) {
  7. $DB->query("
  8. SELECT
  9. `ID`,
  10. `Title`,
  11. `Body`,
  12. `Time`
  13. FROM `news`
  14. ORDER BY `Time` DESC
  15. LIMIT $NewsCount
  16. ");
  17. $News = $DB->to_array(false, MYSQLI_NUM, false);
  18. $Cache->cache_value('news', $News, 3600 * 24 * 30);
  19. $Cache->cache_value('news_latest_id', $News[0][0], 0);
  20. $Cache->cache_value('news_latest_title', $News[0][1], 0);
  21. }
  22. if ($LoggedUser['LastReadNews'] !== $News[0][0] && count($News) > 0) {
  23. $Cache->begin_transaction("user_info_heavy_$UserID");
  24. $Cache->update_row(false, array('LastReadNews' => $News[0][0]));
  25. $Cache->commit_transaction(0);
  26. $DB->query("
  27. UPDATE users_info
  28. SET LastReadNews = '".$News[0][0]."'
  29. WHERE UserID = $UserID");
  30. $LoggedUser['LastReadNews'] = $News[0][0];
  31. }
  32. View::show_header('News', 'news_ajax');
  33. ?>
  34. <div class="sidebar">
  35. <?php #include 'connect.php';?>
  36. <ul class="stats nobullet">
  37. <?php
  38. $End = min(count($Blog), 5);
  39. for ($i = 0; $i < $End; $i++) {
  40. list($BlogID, $Author, $Title, $Body, $BlogTime) = $Blog[$i];
  41. $BlogTime = strtotime($BlogTime); ?>
  42. <?php
  43. } ?>
  44. </ul>
  45. <div class="box">
  46. <div class="head colhead_dark"><strong><a href="blog.php">Latest blog posts</a></strong></div>
  47. <?php
  48. if (($Blog = $Cache->get_value('blog')) === false) {
  49. $DB->query("
  50. SELECT
  51. b.ID,
  52. um.Username,
  53. b.UserID,
  54. b.Title,
  55. b.Body,
  56. b.Time,
  57. b.ThreadID
  58. FROM blog AS b
  59. LEFT JOIN users_main AS um ON b.UserID = um.ID
  60. ORDER BY Time DESC
  61. LIMIT 20");
  62. $Blog = $DB->to_array();
  63. $Cache->cache_value('blog', $Blog, 1209600);
  64. }
  65. ?>
  66. <ul class="stats nobullet">
  67. <?php
  68. if (count($Blog) < 5) {
  69. $Limit = count($Blog);
  70. } else {
  71. $Limit = 5;
  72. }
  73. for ($i = 0; $i < $Limit; $i++) {
  74. list($BlogID, $Author, $AuthorID, $Title, $Body, $BlogTime, $ThreadID) = $Blog[$i]; ?>
  75. <li>
  76. <?=($i + 1)?>. <a
  77. href="blog.php#blog<?=$BlogID?>"><?=$Title?></a>
  78. </li>
  79. <?php
  80. }
  81. ?>
  82. </ul>
  83. </div>
  84. <?php
  85. if (($Freeleeches = $Cache->get_value('shop_freeleech_list')) === false) {
  86. $DB->query("
  87. SELECT
  88. `TorrentID`,
  89. UNIX_TIMESTAMP(`ExpiryTime`),
  90. COALESCE(
  91. NULLIF(`title`, ''),
  92. NULLIF(`subject`, ''),
  93. `object`
  94. ) AS `Name`,
  95. `picture`
  96. FROM
  97. `shop_freeleeches` AS sf
  98. LEFT JOIN `torrents` AS t
  99. ON
  100. sf.`TorrentID` = t.`ID`
  101. LEFT JOIN `torrents_group` AS tg
  102. ON
  103. tg.`id` = t.`GroupID`
  104. ORDER BY
  105. `ExpiryTime` ASC
  106. LIMIT 10
  107. ");
  108. $Freeleeches = $DB->to_array();
  109. $Cache->cache_value('shop_freeleech_list', $Freeleeches, 1209600);
  110. }
  111. if (count($Freeleeches)) {
  112. ?>
  113. <div class="box">
  114. <div class="head colhead_dark"><strong><a
  115. href="torrents.php?freetorrent=1&order_by=seeders&order_way=asc">Freeleeches</a></strong></div>
  116. <ul class="stats nobullet">
  117. <?php
  118. for ($i = 0; $i < count($Freeleeches); $i++) {
  119. list($ID, $ExpiryTime, $Name, $Image) = $Freeleeches[$i];
  120. if ($ExpiryTime < time()) {
  121. continue;
  122. }
  123. $DisplayTime = '('.str_replace(['year','month','week','day','hour','min','Just now','s',' '], ['y','M','w','d','h','m','0m'], time_diff($ExpiryTime, 1, false)).') ';
  124. $DisplayName = '<a href="torrents.php?torrentid='.$ID.'"';
  125. if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
  126. $DisplayName .= ' data-cover="'.ImageTools::process($Image, 'thumb').'"';
  127. }
  128. $DisplayName .= '>'.$Name.'</a>'; ?>
  129. <li>
  130. <strong class="fl_time"><?=$DisplayTime?></strong>
  131. <?=$DisplayName?>
  132. </li>
  133. <?php
  134. } ?>
  135. </ul>
  136. </div>
  137. <?php
  138. }
  139. ?>
  140. <!-- Stats -->
  141. <div class="box">
  142. <div class="head colhead_dark"><strong>Stats</strong></div>
  143. <ul class="stats nobullet">
  144. <?php if (USER_LIMIT > 0) { ?>
  145. <li>Maximum users: <?=number_format(USER_LIMIT) ?>
  146. </li>
  147. <?php
  148. }
  149. if (($UserCount = $Cache->get_value('stats_user_count')) === false) {
  150. $DB->query("
  151. SELECT COUNT(ID)
  152. FROM users_main
  153. WHERE Enabled = '1'");
  154. list($UserCount) = $DB->next_record();
  155. $Cache->cache_value('stats_user_count', $UserCount, 86400);
  156. }
  157. $UserCount = (int)$UserCount;
  158. ?>
  159. <li>
  160. Enabled users: <?=number_format($UserCount)?>
  161. <a href="stats.php?action=users" class="brackets">Details</a>
  162. </li>
  163. <?php
  164. if (($UserStats = $Cache->get_value('stats_users')) === false) {
  165. $DB->query("
  166. SELECT COUNT(ID)
  167. FROM users_main
  168. WHERE Enabled = '1'
  169. AND LastAccess > '".time_minus(3600 * 24)."'");
  170. list($UserStats['Day']) = $DB->next_record();
  171. $DB->query("
  172. SELECT COUNT(ID)
  173. FROM users_main
  174. WHERE Enabled = '1'
  175. AND LastAccess > '".time_minus(3600 * 24 * 7)."'");
  176. list($UserStats['Week']) = $DB->next_record();
  177. $DB->query("
  178. SELECT COUNT(ID)
  179. FROM users_main
  180. WHERE Enabled = '1'
  181. AND LastAccess > '".time_minus(3600 * 24 * 30)."'");
  182. list($UserStats['Month']) = $DB->next_record();
  183. $Cache->cache_value('stats_users', $UserStats, 0);
  184. }
  185. ?>
  186. <li>Users active today: <?=number_format($UserStats['Day'])?> (<?=number_format($UserStats['Day'] / $UserCount * 100, 2)?>%)
  187. </li>
  188. <li>Users active this week: <?=number_format($UserStats['Week'])?>
  189. (<?=number_format($UserStats['Week'] / $UserCount * 100, 2)?>%)
  190. </li>
  191. <li>Users active this month: <?=number_format($UserStats['Month'])?>
  192. (<?=number_format($UserStats['Month'] / $UserCount * 100, 2)?>%)
  193. </li>
  194. <?php
  195. if (($TorrentCount = $Cache->get_value('stats_torrent_count')) === false) {
  196. $DB->query("
  197. SELECT COUNT(ID)
  198. FROM torrents");
  199. list($TorrentCount) = $DB->next_record();
  200. $Cache->cache_value('stats_torrent_count', $TorrentCount, 86400); // 1 day cache
  201. }
  202. if (($GroupCount = $Cache->get_value('stats_group_count')) === false) {
  203. $DB->query("
  204. SELECT COUNT(ID)
  205. FROM torrents_group");
  206. list($GroupCount) = $DB->next_record();
  207. $Cache->cache_value('stats_group_count', $GroupCount, 86400); // 1 day cache
  208. }
  209. if (($TorrentSizeTotal = $Cache->get_value('stats_torrent_size_total')) === false) {
  210. $DB->query("
  211. SELECT SUM(Size)
  212. FROM torrents");
  213. list($TorrentSizeTotal) = $DB->next_record();
  214. $Cache->cache_value('stats_torrent_size_total', $TorrentSizeTotal, 86400); // 1 day cache
  215. }
  216. ?>
  217. <li>
  218. Total size of torrents:
  219. <?=Format::get_size($TorrentSizeTotal)?>
  220. </li>
  221. <?php
  222. if (($ArtistCount = $Cache->get_value('stats_artist_count')) === false) {
  223. $DB->query("
  224. SELECT COUNT(ArtistID)
  225. FROM artists_group");
  226. list($ArtistCount) = $DB->next_record();
  227. $Cache->cache_value('stats_artist_count', $ArtistCount, 86400); // 1 day cache
  228. }
  229. ?>
  230. <li>
  231. Torrents:
  232. <?=number_format($TorrentCount)?>
  233. <a href="stats.php?action=torrents" class="brackets">Details</a>
  234. </li>
  235. <li>Torrent Groups: <?=number_format($GroupCount)?>
  236. </li>
  237. <li>Artists: <?=number_format($ArtistCount)?>
  238. </li>
  239. <?php
  240. // End Torrent Stats
  241. if (($RequestStats = $Cache->get_value('stats_requests')) === false) {
  242. $DB->query("
  243. SELECT COUNT(ID)
  244. FROM requests");
  245. list($RequestCount) = $DB->next_record();
  246. $DB->query("
  247. SELECT COUNT(ID)
  248. FROM requests
  249. WHERE FillerID > 0");
  250. list($FilledCount) = $DB->next_record();
  251. $Cache->cache_value('stats_requests', array($RequestCount, $FilledCount), 11280);
  252. } else {
  253. list($RequestCount, $FilledCount) = $RequestStats;
  254. }
  255. // Do not divide by zero
  256. if ($RequestCount > 0) {
  257. $RequestsFilledPercent = $FilledCount / $RequestCount * 100;
  258. } else {
  259. $RequestsFilledPercent = 0;
  260. }
  261. ?>
  262. <li>Requests: <?=number_format($RequestCount)?> (<?=number_format($RequestsFilledPercent, 2)?>% filled)</li>
  263. <?php
  264. if ($SnatchStats = $Cache->get_value('stats_snatches')) {
  265. ?>
  266. <li>Snatches: <?=number_format($SnatchStats)?>
  267. </li>
  268. <?php
  269. }
  270. if (($PeerStats = $Cache->get_value('stats_peers')) === false) {
  271. // Cache lock!
  272. $PeerStatsLocked = $Cache->get_value('stats_peers_lock');
  273. if (!$PeerStatsLocked) {
  274. $Cache->cache_value('stats_peers_lock', 1, 30);
  275. $DB->query("
  276. SELECT IF(remaining=0,'Seeding','Leeching') AS Type, COUNT(uid)
  277. FROM xbt_files_users
  278. WHERE active = 1
  279. GROUP BY Type");
  280. $PeerCount = $DB->to_array(0, MYSQLI_NUM, false);
  281. $SeederCount = $PeerCount['Seeding'][1] ?: 0;
  282. $LeecherCount = $PeerCount['Leeching'][1] ?: 0;
  283. $Cache->cache_value('stats_peers', array($LeecherCount, $SeederCount), 604800); // 1 week cache
  284. $Cache->delete_value('stats_peers_lock');
  285. }
  286. } else {
  287. $PeerStatsLocked = false;
  288. list($LeecherCount, $SeederCount) = $PeerStats;
  289. }
  290. if (!$PeerStatsLocked) {
  291. $Ratio = Format::get_ratio_html($SeederCount, $LeecherCount);
  292. $PeerCount = number_format($SeederCount + $LeecherCount);
  293. $SeederCount = number_format($SeederCount);
  294. $LeecherCount = number_format($LeecherCount);
  295. } else {
  296. $PeerCount = $SeederCount = $LeecherCount = $Ratio = 'Server busy';
  297. }
  298. ?>
  299. <li>Peers: <?=$PeerCount?>
  300. </li>
  301. <li>Seeders: <?=$SeederCount?>
  302. </li>
  303. <li>Leechers: <?=$LeecherCount?>
  304. </li>
  305. <li>Seeder/leecher ratio: <?=$Ratio?>
  306. </li>
  307. </ul>
  308. </div>
  309. <!-- Polls -->
  310. <?php
  311. if (($TopicID = $Cache->get_value('polls_featured')) === false) {
  312. $DB->query("
  313. SELECT TopicID
  314. FROM forums_polls
  315. ORDER BY Featured DESC
  316. LIMIT 1");
  317. list($TopicID) = $DB->next_record();
  318. $Cache->cache_value('polls_featured', $TopicID, 0);
  319. }
  320. if ($TopicID) {
  321. if (($Poll = $Cache->get_value("polls_$TopicID")) === false) {
  322. $DB->query("
  323. SELECT Question, Answers, Featured, Closed
  324. FROM forums_polls
  325. WHERE TopicID = '$TopicID'");
  326. list($Question, $Answers, $Featured, $Closed) = $DB->next_record(MYSQLI_NUM, array(1));
  327. $Answers = unserialize($Answers);
  328. $DB->query("
  329. SELECT Vote, COUNT(UserID)
  330. FROM forums_polls_votes
  331. WHERE TopicID = '$TopicID'
  332. AND Vote != '0'
  333. GROUP BY Vote");
  334. $VoteArray = $DB->to_array(false, MYSQLI_NUM);
  335. $Votes = [];
  336. foreach ($VoteArray as $VoteSet) {
  337. list($Key, $Value) = $VoteSet;
  338. $Votes[$Key] = $Value;
  339. }
  340. for ($i = 1, $il = count($Answers); $i <= $il; ++$i) {
  341. if (!isset($Votes[$i])) {
  342. $Votes[$i] = 0;
  343. }
  344. }
  345. $Cache->cache_value("polls_$TopicID", array($Question, $Answers, $Votes, $Featured, $Closed), 0);
  346. } else {
  347. list($Question, $Answers, $Votes, $Featured, $Closed) = $Poll;
  348. }
  349. if (!empty($Votes)) {
  350. $TotalVotes = array_sum($Votes);
  351. $MaxVotes = max($Votes);
  352. } else {
  353. $TotalVotes = 0;
  354. $MaxVotes = 0;
  355. }
  356. $DB->query("
  357. SELECT Vote
  358. FROM forums_polls_votes
  359. WHERE UserID = '".$LoggedUser['ID']."'
  360. AND TopicID = '$TopicID'");
  361. list($UserResponse) = $DB->next_record(); ?>
  362. <div class="box">
  363. <div class="head colhead_dark"><strong>Poll<?php if ($Closed) {
  364. echo ' [Closed]';
  365. } ?>
  366. </strong>
  367. </div>
  368. <div class="pad">
  369. <p><strong><?=display_str($Question)?></strong></p>
  370. <?php if ($UserResponse !== null || $Closed) { ?>
  371. <ul class="poll nobullet">
  372. <?php foreach ($Answers as $i => $Answer) {
  373. if ($TotalVotes > 0) {
  374. $Ratio = $Votes[$i] / $MaxVotes;
  375. $Percent = $Votes[$i] / $TotalVotes;
  376. } else {
  377. $Ratio = 0;
  378. $Percent = 0;
  379. } ?>
  380. <li<?=((!empty($UserResponse) && ($UserResponse == $i))?' class="poll_your_answer"':'')?>><?=display_str($Answers[$i])?> (<?=number_format($Percent * 100, 2)?>%)</li>
  381. <li class="graph">
  382. <span class="center_poll"
  383. style="width: <?=round($Ratio * 140)?>px;"></span>
  384. <br />
  385. </li>
  386. <?php
  387. } ?>
  388. </ul>
  389. <strong>Votes:</strong> <?=number_format($TotalVotes)?><br />
  390. <?php } else { ?>
  391. <div id="poll_container">
  392. <form class="vote_form" name="poll" id="poll" action="">
  393. <input type="hidden" name="action" value="poll" />
  394. <input type="hidden" name="auth"
  395. value="<?=$LoggedUser['AuthKey']?>" />
  396. <input type="hidden" name="topicid"
  397. value="<?=$TopicID?>" />
  398. <?php foreach ($Answers as $i => $Answer) { ?>
  399. <input type="radio" name="vote" id="answer_<?=$i?>"
  400. value="<?=$i?>" />
  401. <label for="answer_<?=$i?>"><?=display_str($Answers[$i])?></label><br />
  402. <?php } ?>
  403. <br /><input type="radio" name="vote" id="answer_0" value="0" /> <label
  404. for="answer_0">Blank&#8202;&mdash;&#8202;Show the results!</label><br /><br />
  405. <input type="button"
  406. onclick="ajax.post('index.php', 'poll', function(response) { $('#poll_container').raw().innerHTML = response } );"
  407. value="Vote" />
  408. </form>
  409. </div>
  410. <?php } ?>
  411. <br /><strong>Topic:</strong> <a
  412. href="forums.php?action=viewthread&amp;threadid=<?=$TopicID?>">Visit</a>
  413. </div>
  414. </div>
  415. <?php
  416. }
  417. // polls();
  418. ?>
  419. </div>
  420. <div class="main_column">
  421. <?php
  422. $Recommend = $Cache->get_value('recommend');
  423. $Recommend_artists = $Cache->get_value('recommend_artists');
  424. if (!is_array($Recommend) || !is_array($Recommend_artists)) {
  425. $DB->query("
  426. SELECT
  427. tr.`GroupID`,
  428. tr.`UserID`,
  429. u.`Username`,
  430. tg.`title`,
  431. tg.`tag_list`
  432. FROM
  433. `torrents_recommended` AS tr
  434. JOIN `torrents_group` AS tg
  435. ON
  436. tg.`id` = tr.`GroupID`
  437. LEFT JOIN `users_main` AS u
  438. ON
  439. u.`ID` = tr.`UserID`
  440. ORDER BY
  441. tr.`Time`
  442. DESC
  443. LIMIT 10
  444. ");
  445. $Recommend = $DB->to_array();
  446. $Cache->cache_value('recommend', $Recommend, 1209600);
  447. $Recommend_artists = Artists::get_artists($DB->collect('GroupID'));
  448. $Cache->cache_value('recommend_artists', $Recommend_artists, 1209600);
  449. }
  450. if (count($Recommend) >= 4) {
  451. $Cache->increment('usage_index'); ?>
  452. <div class="box" id="recommended">
  453. <div class="head colhead_dark">
  454. <strong>Latest Vanity House additions</strong>
  455. <a data-toggle-target="#vanityhouse" , data-toggle-replace="Hide" class="brackets">Show</a>
  456. </div>
  457. <table class="torrent_table hidden" id="vanityhouse">
  458. <?php
  459. foreach ($Recommend as $Recommendations) {
  460. list($GroupID, $UserID, $Username, $GroupName, $TagList) = $Recommendations;
  461. $TagsStr = '';
  462. if ($TagList) {
  463. // No vanity.house tag.
  464. $Tags = explode(' ', str_replace('_', '.', $TagList));
  465. $TagLinks = [];
  466. foreach ($Tags as $Tag) {
  467. if ($Tag == 'vanity.house') {
  468. continue;
  469. }
  470. $TagLinks[] = "<a href=\"torrents.php?action=basic&amp;taglist=$Tag\">$Tag</a> ";
  471. }
  472. $TagStr = "<br />\n<div class=\"tags\">".implode(', ', $TagLinks).'</div>';
  473. } ?>
  474. <tr>
  475. <td>
  476. <?=Artists::display_artists($Recommend_artists[$GroupID]) ?>
  477. <a href="torrents.php?id=<?=$GroupID?>"><?=$GroupName?></a> (by <?=Users::format_username($UserID, false, false, false)?>)
  478. <?=$TagStr?>
  479. </td>
  480. </tr>
  481. <?php
  482. } ?>
  483. </table>
  484. </div>
  485. <!-- END recommendations section -->
  486. <?php
  487. }
  488. $Count = 0;
  489. foreach ($News as $NewsItem) {
  490. list($NewsID, $Title, $Body, $NewsTime) = $NewsItem;
  491. if (strtotime($NewsTime) > time()) {
  492. continue;
  493. } ?>
  494. <div id="news<?=$NewsID?>" class="box news_post">
  495. <div class="head">
  496. <strong>
  497. <?=$Title?>
  498. </strong>
  499. <?=time_diff($NewsTime)?>
  500. <?php if (check_perms('admin_manage_news')) { ?>
  501. &ndash;
  502. <a href="tools.php?action=editnews&amp;id=<?=$NewsID?>"
  503. class="brackets">Edit</a>
  504. <?php } ?>
  505. <span class="float_right">
  506. <a data-toggle-target="#newsbody<?=$NewsID?>"
  507. data-toggle-replace="Show" class="brackets">Hide</a>
  508. </span>
  509. </div>
  510. <div id="newsbody<?=$NewsID?>" class="pad">
  511. <?=Text::full_format($Body)?>
  512. </div>
  513. </div>
  514. <?php
  515. if (++$Count > ($NewsCount - 1)) {
  516. break;
  517. }
  518. }
  519. ?>
  520. <div id="more_news" class="box">
  521. <div class="head">
  522. <em><span><a href="#"
  523. onclick="news_ajax(event, 3, <?=$NewsCount?>, <?=check_perms('admin_manage_news') ? 1 : 0; ?>); return false;">Click
  524. to load more news</a>.</span> To browse old news posts, <a
  525. href="forums.php?action=viewforum&amp;forumid=<?=$ENV->ANNOUNCEMENT_FORUM?>">click
  526. here</a>.</em>
  527. </div>
  528. </div>
  529. </div>
  530. </div>
  531. <?php
  532. View::show_footer(array('disclaimer'=>true));
  533. function contest()
  534. {
  535. global $DB, $Cache, $LoggedUser;
  536. list($Contest, $TotalPoints) = $Cache->get_value('contest');
  537. if (!$Contest) {
  538. $DB->query("
  539. SELECT
  540. UserID,
  541. SUM(Points),
  542. Username
  543. FROM users_points AS up
  544. JOIN users_main AS um ON um.ID = up.UserID
  545. GROUP BY UserID
  546. ORDER BY SUM(Points) DESC
  547. LIMIT 20");
  548. $Contest = $DB->to_array();
  549. $DB->query("
  550. SELECT SUM(Points)
  551. FROM users_points");
  552. list($TotalPoints) = $DB->next_record();
  553. $Cache->cache_value('contest', array($Contest, $TotalPoints), 600);
  554. } ?>
  555. <!-- Contest Section -->
  556. <div class="box box_contest">
  557. <div class="head colhead_dark"><strong>Quality time scoreboard</strong></div>
  558. <div class="pad">
  559. <ol style="padding-left: 5px;">
  560. <?php
  561. foreach ($Contest as $User) {
  562. list($UserID, $Points, $Username) = $User; ?>
  563. <li><?=Users::format_username($UserID, false, false, false)?>
  564. (<?=number_format($Points)?>)</li>
  565. <?php
  566. } ?>
  567. </ol>
  568. Total uploads: <?=$TotalPoints?><br />
  569. <a href="index.php?action=scoreboard">Full scoreboard</a>
  570. </div>
  571. </div>
  572. <!-- END contest Section -->
  573. <?php
  574. } // contest()