Reduced the gfh2 background image contrast a bit since it was hard to read text with it.
[specialops2.git] / invites.php
blobcde6d893203972af1d5351329725fce41345cc47
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');
11 $user->userheader();
13 echo '<h2>User Invites</h2>',"\n";
15 if ( !defined('INVITE_ONLY') )
16 echo '<p class="info">Invites are currently disabled.</p>',"\n";
17 else {
18 $urllist = $DB->query('SELECT `code` FROM `invites` WHERE `userid` = @userid');
19 if ( $urllist->num_rows ) {
20 echo '<p>Spam these links everywhere to become popular:</p>',"\n",
21 "<ul>\n";
23 while ( list($code) = $urllist->fetch_row() )
24 printf(' <li><a href="register?user=%d;code=%s">http://%s%s/register?user=%1$d;code=%2$s</a></li>'."\n",
25 $user->userid, $code, $_SERVER['HTTP_HOST'], dirname($_SERVER['REQUEST_URI']));
27 echo "</ul>\n",
28 '<p>These links are only valid for one registration, and you can only have a maximum of 5 at any time.</p>',"\n";
31 for ( $i = 0; $i <= floor(sqrt($user->points)) || $i <= $user->invites; $i++ );
33 echo '<p class="info">Points to next invite: ',(pow($i, 2) - $user->points),"</p>\n";
35 $userlist = $DB->query('SELECT `userid`, `alias` FROM `users` WHERE `referrer` = @userid');
36 if ( $userlist->num_rows ) {
37 echo "<h3>You have invited:</h3>\n<ol>\n";
38 while ( $user2 = $userlist->fetch_row() )
39 echo ' <li>',$user->namelink($user2[0], $user2[1]),"</li>\n";
40 echo "</ol>\n";
45 <h2>Points</h2>
46 <p class="info">You have <?php echo $user->points; ?> points.</p>
47 <h3>Getting</h3>
48 <ul>
49 <li>Topics: +2 points each</li>
50 <li>Posts: +1 point each</li>
51 <li>Modded messages: ±1 per moderation</li>
52 </ul>
53 <h3>Doing</h3>
54 <ul>
55 <li>Message moderation ability: 10 points</li>
56 <li>All HTML in posts: 10000 points</li>
57 </ul>
59 <?php
60 $page->pagefooter();