4 $prefetch = array('`points`', '`invites`');
6 $page->title
= 'User Invite List';
8 if ( ! ($user instanceof authuser
) )
9 $page->errorfooter('login');
13 echo '<h2>Invitation URLs</h2>',"\n";
15 $urllist = $DB->query('SELECT `code` FROM `invites` WHERE `userid` = @userid');
16 if ( $urllist->num_rows
) {
17 echo '<p>Spam these links everywhere to become popular:</p>',"\n",
20 while ( list($code) = $urllist->fetch_row() )
21 printf(' <li><a href="register?user=%d;code=%s">http://%s%s/register?user=%1$d;code=%2$s</a></li>'."\n",
22 $user->userid
, $code, $_SERVER['HTTP_HOST'], dirname($_SERVER['REQUEST_URI']));
25 '<p>These links are good for a single registration each only.</p>',"\n";
28 for ( $i = 0; $i <= floor(sqrt($user->points
)) ||
$i <= $user->invites
; $i++
);
31 '<p>You have '.$user->points
.' points. Points to next invite: ',(pow($i, 2) - $user->points
),'</p>
33 <h2>Users you\'ve invited</h2>
36 $userlist = $DB->query('SELECT `userid`, `alias` FROM `users` WHERE `referrer` = @userid');
37 while ( $user2 = $userlist->fetch_row() )
38 echo ' <li>',$user->namelink($user2[0], $user2[1]),"</li>\n";