added error reporting line
[specialops2.git] / invites.php
blob406222e0685df075f65066165fbd384f073b7322
1 <?php
2 // $Id$
4 require 'con.php';
5 $page->title = 'User Invite List';
7 if ( ! ($user instanceof authuser) )
8 $page->errorfooter('login');
10 $user->userheader();
12 echo '<h2>Invitation URLs</h2>',"\n";
14 $urllist = $DB->query('SELECT `code` FROM `invites` WHERE `userid` = '.$user->userid);
15 if ( $urllist->num_rows ) {
16 echo '<p>Spam these links everywhere to become popular:</p>',"\n",
17 "<ul>\n";
19 while ( list($code) = $urllist->fetch_row() )
20 echo "\t",'<li><a href="register?user=',$user->userid,';code=',$code,'">http://',$_SERVER['HTTP_HOST'],
21 '/so2/register?user=',$user->userid,';code=',$code,"</a></li>\n";
23 echo "</ul>\n",
24 '<p>These links are good for a single registration each only.</p>',"\n";
25 } else {
26 for ( $i = 5; $i <= floor(sqrt($user->points)); $i++ );
28 $gap = $i*$i;
29 echo '<p>You currently have no invites. Points to next one: ',($gap - $user->points),"</p>\n";
32 echo '<h2>Users you\'ve invited</h2>
33 <ol>';
35 $userlist = $DB->query('SELECT `userid`, `alias` FROM `users` WHERE `referrer` = '.$user->userid);
36 while ( $user2 = $userlist->fetch_row() )
37 echo "\t<li>",$user->namelink($user2[0], $user2[1]),"</li>\n";
39 echo "</ol>\n";
41 $page->pagefooter();