Database rewrite, first half
[specialops2.git] / invites.php
blobcb04633486fba65914f502a5ff4b11cb91a304e0
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<p>",
24 _('These links are good for a single account only. You may be held liable for the actions of those you invite.'),"</p>\n";
25 } else {
26 for ( $i = 5; $i <= floor(sqrt($user->u_points)); $i++ ); //empty loop
27 $gap = $i*$i;
28 echo '<p>',sprintf(_('You currently have no invites. Points to next one: %d'), $gap - $user->u_points),"</p>\n";
31 echo '<h2>',_('Users you\'ve invited'),'</h2>
32 <ol>';
33 $userlist = $DB->query('SELECT `userid`, `u_name` FROM `users` WHERE `u_referrer` = '.$user->userid);
34 while ( $user2 = $userlist->fetch_row() )
35 echo "\t<li>",$user->namelink($user2[0], $user2[1]),"</li>\n";
36 echo "</ol>\n";
38 $page->pagefooter();