Replaced the shitty old boardlist view control with something more readable
[specialops2.git] / invites.php
blob736b142ae908ddb886f1851fc21f9eee42bd6809
1 <?php
2 // $Id$
4 $prefetch = array('`points`', '`invites`');
5 require 'con.php';
6 $page->title = 'Stuff Control Panel';
8 if ( ! ($user instanceof authuser) ) {
9 $page->errorfooter('login');
12 $user->userheader();
14 echo '<h2>User Invites</h2>',"\n";
16 if ( !defined('INVITE_ONLY') ) {
17 echo '<p class="info">Invites are currently disabled.</p>',"\n";
18 } else {
19 $urllist = $DB->query('SELECT `data` FROM `items` WHERE `item` = "invite" AND `userid` = @userid');
20 if ( $urllist->num_rows ) {
21 echo '<p>Spam these links everywhere to become popular:</p>',"\n",
22 "<ul>\n";
24 while ( list($code) = $urllist->fetch_row() ) {
25 printf(' <li><a href="register?user=%d;code=%s">http://%s%s/register?user=%1$d;code=%2$s</a></li>'."\n",
26 $user->userid, $code, $_SERVER['HTTP_HOST'], dirname($_SERVER['REQUEST_URI']));
29 echo "</ul>\n",
30 '<p>These links are only valid for one registration, and you can only have a maximum of 5 at any time.</p>',"\n";
33 for ( $i = 0; $i <= floor(sqrt($user->points)) || $i <= $user->invites; $i++ ); // This is intentionally empty
35 echo '<p class="info">Points to next invite: ',(pow($i, 2) - $user->points),"</p>\n";
37 $userlist = $DB->query('SELECT `userid`, `alias` FROM `users` WHERE `referrer` = @userid');
38 if ( $userlist->num_rows ) {
39 echo "<h3>You have invited:</h3>\n<ol>\n";
40 while ( $user2 = $userlist->fetch_row() ) {
41 echo ' <li>',$user->namelink($user2[0], $user2[1]),"</li>\n";
43 echo "</ol>\n";
48 <h2>Points</h2>
49 <p class="info">You have <?php echo $user->points ?> points.</p>
50 <h3>Getting</h3>
51 <ul>
52 <li>Topics: +2 points each</li>
53 <li>Posts: +1 point each</li>
54 </ul>
55 <h3>Doing</h3>
56 <ul>
57 <li>10 points: You can mark messages up/down for 1 point each.</li>
58 <li>100 points: Your message marks are now worth 2 points.</li>
59 <li>1000 points: Marks are worth 3 points.</li>
60 <li>10000 points: 4 points plus you can use <strong>full HTML</strong> in posts.</li>
61 </ul>
63 <?php
64 $page->pagefooter();