Oppaitime'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 17KB

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