3 * User Invites and Points FAQ
5 * @author Anthony Parsons (xmpp:ant@specialops.ath.cx)
6 * @license file://COPYING
10 $prefetch = array('`points`', '`invites`');
12 $page->title
= 'Stuff Control Panel';
14 if ( ! ($user instanceof User_Authenticated
) ) {
15 $page->errorfooter('login');
22 <p
class="info">You have
<?php
echo $user->points ?
> points
.</p
>
25 <li
>Topics
: +
2 points each
</li
>
26 <li
>Posts
: +
1 point each
</li
>
30 <li
>1 point
: Access to the registered users
-only areas of site
.</li
>
31 <li
>10 points
: You get to mark messages giving the poster ±
1 point
. You can
't mark your own messages.</li>
32 <li>100 points: Message marks increase to 2 points.</li>
33 <li>1000 points: Message marks increase to 3 points.</li>
34 <li>10000 points: Marks are 4 points plus you can use HTML in posts.</li>
40 if ( !defined('INVITE_ONLY
') ) {
41 echo '<p
class="info">Invites are currently disabled
.</p
>',"\n";
43 $urllist = $DB->query('SELECT `data` FROM `things` WHERE `what`
= "invite" AND `userid`
= @userid
');
44 if ( $urllist->num_rows ) {
45 echo "<h3>Invite Links:</h3>\n<ul>\n";
47 while ( list($code) = $urllist->fetch_row() ) {
48 printf(' <li
><a href
="register?user=%d;code=%s">http
://%s%s/register?user=%1$d;code=%2$s</a></li>'."\n",
49 $user->userid
, $code, $_SERVER['HTTP_HOST'], dirname($_SERVER['REQUEST_URI']));
53 '<p>These links are only valid for one registration, and you can only have a maximum of 5 at any time.</p>',"\n";
56 $i = max($user->points
, pow($user->invites
, 2)); // Set "invite level"
57 do { // Count up to next level
59 } while ( floor(sqrt($i)) != sqrt($i) );
61 echo '<p class="info">Points to next invite: ',($i - $user->points
),"</p>\n";
63 $userlist = $DB->query('SELECT `userid`, `alias` FROM `users` WHERE `referrer` = @userid');
64 if ( $userlist->num_rows
) {
65 echo "<h3>You have invited:</h3>\n<ol>\n";
67 while ( $user2 = $userlist->fetch_row() ) {
68 echo ' <li>',$user->namelink($user2[0], $user2[1]),"</li>\n";