function mementos_run()
{
    global $session;
    page_header("Memento Forge");
    $op = httpget('op');
    $pointsavailable = $session['user']['donation'] - $session['user']['donationspent'];
    require_once "modules/wcgpoints.php";
    $cstones = wcgpoints_getpoints();
    switch (httpget('op')) {
        case "start":
            $moulds = load_inventory("mementomoulds_" . $session['user']['acctid'], true);
            if (count($moulds)) {
                output("Here are the original prototypes of Mementos you have made.`n`n");
                rawoutput("<table width=100% style='border: dotted 1px #000000;'>");
                $classcount = 1;
                $moulds = modulehook("mementos", $moulds);
                foreach ($moulds as $id => $prefs) {
                    $classcount++;
                    $class = $classcount % 2 ? "trdark" : "trlight";
                    rawoutput("<tr class='{$class}'><td>");
                    output("`b%s`b`0`n", stripslashes($prefs['verbosename']));
                    output("%s`0`n`n", stripslashes($prefs['description']));
                    output("`bUse Text`b:%s`0`n`n", stripslashes($prefs['usetext']));
                    if ($prefs['mouldusesleft']) {
                        output("You can make another %s of these, at `6`b250`b CobbleStones`0 and `5`b1`b Supporter Point`0 each.`n", $prefs['mouldusesleft']);
                        rawoutput("<a href='runmodule.php?module=mementos&op=makecopy&itemid=" . $id . "'>Make a copy</a><br />");
                    } else {
                        if (!isset($prefs['mouldusesleft'])) {
                            output("You can make a mould for this Memento, enabling you to make copies using `6CobbleStones`0.  It'll cost you `5500 Supporter Points`0.`n");
                            rawoutput("<a href='runmodule.php?module=mementos&op=makecopy&itemid=" . $id . "'>Make a mould</a><br />");
                        } else {
                            output("This mould is too old and knackered to make any more Mementos, but you can re-forge it for `5500 Supporter Points`0.`n");
                            rawoutput("<a href='runmodule.php?module=mementos&op=makecopy&itemid=" . $id . "'>Make a mould</a><br />");
                        }
                    }
                    addnav("", "runmodule.php?module=mementos&op=makecopy&itemid=" . $id);
                    if (is_array($prefs['memento_forge_actions']) && count($prefs['memento_forge_actions'])) {
                        foreach ($prefs['memento_forge_actions'] as $action) {
                            rawoutput($action);
                        }
                    }
                    rawoutput("</td></tr>");
                }
                rawoutput("</table>");
            } else {
                //if there are no moulds
                output("You're about to ask the grinning Joker proprietor about these Memento things you've been hearing about, when suddenly the knowledge rushes into your head unbidden.`n`nMementos are player-created objects that can be given to other players.  They grant no in-game advantages, but are fun for roleplaying.  Players often roleplay giving items to each other, but with Mementos, those items can appear in Inventories and act like 'real' in-game items.`n`n`n`bWhat you need to know about Mementos`b`nMementos are weightless, and occupy the 'Shoebox' portion of the player's Inventory.  Mementos survive Drive Kills, and don't go away when 'used.'  They can only be destroyed by being discarded by the player.  They can also be put down and picked up on map squares, and gifted to other players for free (anonymously if desired) via Common Ground's Gifting Station.`n`nYou can specify the Name (shown in the Inventory) of the Memento, the Plural form of the name, the Description (shown in the Inventory), and the Use Text (shown when the player 'uses' the Memento).`n`n`n`bCosts`b`nYou can create a single Memento at a flat cost of `550 Supporter Points`0.  You can also create Memento Moulds, at a cost of `5500 Supporter Points`0 for the mould and the first Memento, plus `5one Supporter Point`0 and `6250 CobbleStones`0 for each of up to fifty copies of that Memento.  Single Mementos can be upgraded to Memento Moulds later on if you like.`n`n`n`bExample Memento`b`n`bName:`b Red Music Box`n`bPlural:`b Red Music Boxes`n`bDescription:`b An ornate red wooden music box, decorated with cut garnets and shiny stainless-steel edging.`n`bUse Text`b: You open up the music box.  Inside is a tiny demon, smoking a cigarette.  Noticing that his house is open, he hurriedly stamps out his smoke and launches into a stirring rendition of 'NewHome is Full of Noobs.'  You close the lid quickly.`n`nEach Memento can have 100 characters for the Name, 100 characters for the Plural name, 255 characters for the Description, and 1,000 characters for the Use Text.`n`n");
            }
            addnav("Memento Stuff");
            if ($pointsavailable >= 50) {
                addnav("Create new single Memento", "runmodule.php?module=mementos&op=new&type=single");
            } else {
                addnav("You need 50 Supporter Points for a single Memento", "");
            }
            if ($pointsavailable >= 500) {
                addnav("Create new Memento Mould", "runmodule.php?module=mementos&op=new&type=mould");
            } else {
                addnav("You need 500 Supporter Points for a Memento Mould", "");
            }
            break;
        case "makecopy":
            $giveitem = false;
            $itemid = httpget("itemid");
            $name = get_item_pref("verbosename", $itemid);
            $plural = get_item_pref("plural", $itemid);
            $desc = get_item_pref("description", $itemid);
            $usetext = get_item_pref("usetext", $itemid);
            $moulduses = get_item_pref("mouldusesleft", $itemid);
            if ($moulduses > 0) {
                if ($cstones >= $cscost) {
                    output("You've bought a new %s`0 using `6CobbleStones`0!  Would you like to buy another, or head back to the Memento Forge menu?`n`n", $name);
                    $giveitem = true;
                    increment_module_pref("spent", 250, "wcgpoints");
                    $cstones = wcgpoints_getpoints();
                    $session['user']['donationspent'] += 1;
                    //log purchase
                    $logsql = "INSERT INTO " . db_prefix("purchaselog") . " (acctid,purchased,amount,data,giftwrap,timestamp) VALUES ('" . $session['user']['acctid'] . "','memento_copy_cobblestone','1','none','0','" . date("Y-m-d H:i:s") . "')";
                    db_query($logsql);
                } else {
                    output("`4You don't have enough `6CobbleStones`0 to make another copy of that Memento, I'm afraid.`n`n");
                }
            }
            $pointsavailable = $session['user']['donation'] - $session['user']['donationspent'];
            if ($giveitem) {
                $prefs = get_item_prefs($itemid);
                unset($prefs["mouldusesleft"]);
                $prefs['memento_originalitem'] = $itemid;
                give_item("memento", $prefs);
                $moulduses--;
                set_item_pref("mouldusesleft", $moulduses, $itemid);
            }
            if ($moulduses > 0) {
                output("You're about a make a new copy of the Memento called `b%s`b`0.  This will cost `6250 CobbleStones`0 and `5one Supporter Point`0.  You now have `5%s Supporter Points`0 and `6%s CobbleStones`0, and this mould will make `b%s`0 more Mementos.`n`n", $name, number_format($pointsavailable), number_format($cstones), $moulduses);
                addnav("Buy");
                if ($cstones >= $cscost && $pointsavailable) {
                    addnav("Buy a copy", "runmodule.php?module=mementos&op=makecopy&itemid=" . $itemid);
                } else {
                    addnav("Not enough `6CobbleStones`0 (or you don't have a `5Supporter Point`0 left)", "");
                }
            } else {
                output("Either this mould is knackered, or this is a unique Memento.  You can't make any more copies.  However, you can make a new mould if you like, for `5500 Supporter Points`0.  This will enable you to make further copies of the Memento for `5one Supporter Point`0 plus `6250 CobbleStones`0 each.`n`n", $originalcost);
                addnav("Buy");
                if ($pointsavailable >= 500) {
                    addnav("Make a new mould", "runmodule.php?module=mementos&op=reforge&itemid=" . $itemid);
                } else {
                    addnav("Not enough `5Supporter Points`0 to make a new mould", "");
                }
            }
            addnav("Return");
            addnav("Memento Forge", "runmodule.php?module=mementos&op=start");
            break;
        case "reforge":
            $itemid = httpget("itemid");
            output("You've successfully recreated the mould for your Memento.`n`n");
            set_item_pref("mouldusesleft", 50, $itemid);
            addnav("Return");
            addnav("Memento Forge", "runmodule.php?module=mementos&op=start");
            $session['user']['donationspent'] += 500;
            $logsql = "INSERT INTO " . db_prefix("purchaselog") . " (acctid,purchased,amount,data,giftwrap,timestamp) VALUES ('" . $session['user']['acctid'] . "','memento_mould','500','none','0','" . date("Y-m-d H:i:s") . "')";
            db_query($logsql);
            break;
        case "new":
            $type = httpget('type');
            if ($type == 'single') {
                output("You're making a new unique Memento now.  Create your desired item and hit Submit.  You can use colour codes and italics just like in commentary, and you can use bold too, using the ``b switch (remember to close your bolds and italics with another ``b or ``i!).`n`nRemember to use ``n for a new line rather than pressing Enter.  Use ``n``n for a line break between paragraphs.`n`n");
                rawoutput("<form action='runmodule.php?module=mementos&op=check&type=single' method='POST'>Memento Name (maximum 100 characters): <input name='name' id='name'><br /><br />Plural (maximum 100 characters): <input name='plural' id='plural'><br /><br />Memento Description (maximum 255 characters):<br />");
                addnav("", "runmodule.php?module=mementos&op=check&type=single");
            } else {
                if ($type == 'mould') {
                    output("You're making a new Memento Mould now.  Create your desired item and hit Submit.  You can use colour codes and italics just like in commentary, and you can use bold too, using the ``b switch (remember to close your bolds and italics with another ``b or ``i!).`n`nRemember to use ``n for a new line rather than pressing Enter.  Use ``n``n for a line break between paragraphs.`n`n");
                    rawoutput("<form action='runmodule.php?module=mementos&op=check&type=mould' method='POST'>Memento Name (maximum 100 characters): <input name='name' id='name'><br /><br />Plural (maximum 100 characters): <input name='plural' id='plural'><br /><br />Memento Description (maximum 255 characters):<br />");
                    addnav("", "runmodule.php?module=mementos&op=check&type=mould");
                }
            }
            require_once "lib/forms.php";
            previewfield_countup("description");
            rawoutput("<br /><br />Text shown when using the Memento (maximum 1,000 characters):<br />");
            previewfield_countup("usetext");
            rawoutput("<br /><input type=submit>");
            addnav("Start Again");
            addnav("Memento Forge", "runmodule.php?module=mementos&op=start");
            break;
        case "check":
            output("Here's a preview of your Memento:`n`n");
            $rname = httppost("name");
            $rplural = httppost("plural");
            $rdesc = httppost("description");
            $rusetext = httppost("usetext");
            $type = httpget("type");
            $dname = stripslashes($rname);
            $dplural = stripslashes($rplural);
            $ddesc = stripslashes($rdesc);
            $dusetext = stripslashes($rusetext);
            output("`bName:`b %s`0 (%s`0)`n`bDescription:`b %s`0`n`bUse Text:`b %s`0`n`n", $dname, $dplural, $ddesc, $dusetext);
            if (strlen($dname) <= 100 && strlen($dplural) <= 100 && strlen($ddesc) <= 255 && strlen($dusetext) <= 1000) {
                addnav("Confirm");
                if ($type == "single") {
                    addnav("Buy it! (`550 Supporter Points`0)", "runmodule.php?module=mementos&op=confirm&name=" . urlencode($rname) . "&plural=" . urlencode($rplural) . "&desc=" . urlencode($rdesc) . "&usetext=" . urlencode($rusetext) . "&type=single");
                } else {
                    if ($type == "mould") {
                        addnav("Buy it! (`5500 Supporter Points`0)", "runmodule.php?module=mementos&op=confirm&name=" . urlencode($rname) . "&plural=" . urlencode($rplural) . "&desc=" . urlencode($rdesc) . "&usetext=" . urlencode($rusetext) . "&type=mould");
                    }
                }
            } else {
                output("`4`bError: Something is too long.  Titles can be up to 100 characters, descriptions up to 255 characters, and usage texts up to 1,000 characters.`b`0`n`n");
                rawoutput("<form action='runmodule.php?module=mementos&op=check&type=" . $type . "' method='POST'>Memento Name (maximum 100 characters): <input name='name' id='name' value={$rname}><br /><br />Plural (maximum 100 characters): <input name='plural' id='plural' value={$rplural}><br /><br />Memento Description (maximum 255 characters):<br />");
                require_once "lib/forms.php";
                previewfield_countup("description", 255, $rdesc);
                rawoutput("<br /><br />Text shown when using the Memento (maximum 1,000 characters):<br />");
                previewfield_countup("usetext", 1000, $rusetext);
                rawoutput("<br /><input type=submit>");
                addnav("", "runmodule.php?module=mementos&op=check&type=" . $type);
            }
            addnav("Start Again");
            addnav("Memento Forge", "runmodule.php?module=mementos&op=start");
            break;
        case "confirm":
            $type = httpget("type");
            $name = urldecode(httpget("name"));
            $plural = urldecode(httpget("plural"));
            $desc = urldecode(httpget("desc"));
            $usetext = urldecode(httpget("usetext"));
            $prefs = array("verbosename" => $name, "plural" => $plural, "description" => $desc, "usetext" => $usetext, "memento_author" => $session['user']['acctid']);
            if ($type == "single") {
                $cost = 50;
                output("You've made a new Memento.  You can find it in your Inventory!");
            } else {
                if ($type == "mould") {
                    $cost = 500;
                    output("You've made a mould for your new Memento, and the first Memento from that mould is now in your Inventory!");
                    $prefs['mouldusesleft'] = 50;
                }
            }
            $session['user']['donationspent'] += $cost;
            //log purchase
            $logsql = "INSERT INTO " . db_prefix("purchaselog") . " (acctid,purchased,amount,data,giftwrap,timestamp) VALUES ('" . $session['user']['acctid'] . "','memento_" . $type . "','" . $cost . "','none','0','" . date("Y-m-d H:i:s") . "')";
            db_query($logsql);
            //create the mould, track its id
            $id = give_item("memento", $prefs, "mementomoulds_" . $session['user']['acctid'], true);
            //debug($id);
            $prefs['memento_originalitem'] = $id;
            set_item_pref("memento_originalitem", $id, $id);
            //give the player the initial memento
            give_item("memento", $prefs);
            addnav("Return");
            addnav("Memento Forge", "runmodule.php?module=mementos&op=start");
            break;
    }
    addnav("Return");
    addnav("Back to the Hunter's Lodge", "runmodule.php?module=iitems_hunterslodge&op=start");
    page_footer();
}
function wcgpoints_run()
{
    global $session;
    page_header("Cobblestone Cottage");
    $submit = translate_inline("Carry On");
    switch (httpget('op')) {
        case "enter":
            $uid_ok = get_module_pref("uidok");
            output("`4`bWARNING: Cobblestone Cottage is currently in BETA, and a little shaky.`b  Please don't send Petitions about this feature - use the chat area below, or the Enquirer.`0`n`n");
            if (get_module_pref("wcgid") && $uid_ok) {
                if (!get_module_pref("fail")) {
                    $points = wcgpoints_getpoints();
                    output("`0Jake greets you with a broad smile.  \"`@Welcome back, man.  You've got %s cobblestones waiting to spend.  Have fun!`0\"`n`n", number_format($points));
                    modulehook("wcg-features");
                } else {
                    //WCG ID present but not verified
                    debug("WCG ID not verified");
                    output("Jake greets you with a concerned look.  \"`@Man, I've been wondering where you've been.  I asked the Cosmos how many Cobblestones to give you, and it wouldn't answer.  Something about a messed-up Verification Code, whatever that means.`0\"`n`nIt looks like your Verification Code needs to be re-checked - you can find it via your Profile page on the World Community Grid website, and change our record of it via your Preferences in any Outpost.`n`n");
                    addnav("Let's do that, then", "runmodule.php?module=wcgpoints&op=verify");
                }
            } else {
                debug("No WCG ID entered");
                output("`0You head into a beautiful stone cottage.  A long-haired young man sits behind a desk at the entrance, idly smoking a cigarette.  As you catch his eye, he grins and rests his cigarette in an ashtray.  It smells kinda funny.`n`n\"`@Hey, man.  Welcome to Cobblestone Cottage!`0\"  He shakes your hand.  \"`@The name's Jake.  It doesn't look like you're hooked up yet.  Here, let me fix that for you, and you'll be rolling in cobblestones in no time.`0\"`n`n\"`#Cobblestones?`0\" you ask.`n`n\"`@Cobblestones, man, cobblestones!`0\" exclaims the hippy.  \"`@Whole new local currency - you saw the mess the banks made of the last one!  This stuff is as indie as it `igets`i, man.  You can only spend them in this very cottage.  Let's get you hooked up.`0\"`n`nHe sits down and pulls out a worn leather notebook and a purple-feathered quill pen.  \"`@What's your ID, my friend?`0\"`n`n");
                output("`J`bPinned to the slightly run-down fourth wall of the cottage is this message:`b`n`n`0The ID that the dirty hippy is asking for is your World Community Grid username.`n`n`bWhat's the story, daddy-o?`b`n`nYour computer can cure AIDS and cancer.`n`nNo, seriously.  It can also help provide us with cheap, environmentally-friendly electricity, sort out world hunger, and kick Dengue Fever in the nuts.  It can do a lot, really.  Most people hardly ever use the full capacity of their computer's CPU's.  You'll certainly have unused CPU cycles lying around while you're surfing the Internet or playing this game.  It'd be a terrible shame to waste those cycles.  Why not donate them to a worthy cause?`n`nScientists and humanitarian researchers need all the computing power they can get their hands on in order to analyse protein structures, chemical properties and other computationally-intensive stuff.  You can download a program that'll perform this life-saving research on your very own computer - and it'll run at a very low priority, so that when you do want to use your PC for something computationally intensive like playing a 3D game, your computer will be just as responsive.`n`nThe more CPU cycles you donate to humanitarian research, the more cobblestones Jake will give you.  These cobblestones can be used to play games or obtain other resources inside the Cottage.  See the list at the end of this page to see what you can do with your cobblestones, and check back as we come up with new features.`n`n`bThe nitty-gritty`b`n`nIn a nutshell, World Community Grid is a distributed computing network that performs humanitarian research using your computer's unused CPU cycles.  The project uses the BOINC networked computing client, which runs on Windows, Mac, Linux, FreeBSD and many other platforms, and doesn't affect the normal day-to-day performance of your computer.  When your computer's screensaver is active, the World Community Grid client will request instructions, process them, and send them back.  When your computer is in use, the client goes into Snooze mode and doesn't use any CPU cycles, so you'll likely not notice that the client is running.`n`nHumanitarian work performed by your computer for World Community Grid includes, but is not limited to:`nDeveloping drugs to combat cancer in children and adults;`nDeveloping antiviral medication for new influenza strains;`nCalculating the electronic properties of materials in order to find an organic compound that we can use to make dirt-cheap solar panels;`nDetermining the best options to create a new strain of rice that will provide maximum nutrition and thrive in a harsh environment;`nUncovering new drugs to combat dengue hemorrhagic fever, hepatitis C, West Nile encephalitis, and Yellow fever;`nIdentifying candidate drugs that have the right shape and chemical characteristics to block HIV protease;`nHuman proteome folding.`n`nFor more information or to join, search for World Community Grid in Wikipedia or your favourite search engine.`n`n`bHow World Community Grid interacts with Improbable Island`b`n`nAt each new game day, Jake will reward you with his entirely-made-up currency based on how many World Community Grid points you've accumulated since the previous game day.  More information on how WCG Points are calculated and rewarded can be found via a web search, or on the World Community Grid website.  You may install and run the BOINC client on more than one machine if you wish, under the same WCG username - this will result in more points and thus more cobblestones.`n`nWCG only updates their stats every 24 hours, and the work done by your computer must be verified first - so the XML file that Improbable Island reads to determine your cobblestone awards may be several days behind the actual work done by your computer.  To save undue stress on World Community Grid's servers, cobblestones are only awarded at each new Game Day.  If you joined World Community Grid today, it may be a day or two (or three!) before Jake gives you `iany`i cobblestones at all - however, if you allow your computer to run the BOINC client reasonably often, you should get more cobblestones every day after the first batch arrive.`n`nIf you've been a member of World Community Grid for some time, Jake will give you an initial bag of cobblestones corresponding to the total work done by your computer over the course of your entire WCG membership.  You'll be stinking rich!`n`n`bDISCLAIMER`b`nImprobable Island is not affiliated with or endorsed by IBM or World Community Grid.  In fact, I'd be surprised if they even knew about this.`n`n`bGETTING STARTED`b`nThere are three steps to the process - signing up at World Community Grid, installing the BOINC client, and associating your World Community Grid account with your Improbable Island username.`n`n`bSteps One and Two`b`nIf you're already signed up with World Community Grid, you can skip this bit.`n");
                rawoutput("Head over to <a href=\"http://www.worldcommunitygrid.org/reg/viewRegister.do?teamID=" . get_module_setting("teamid") . "\" target='new'>World Community Grid</a>, and follow the onscreen instructions to sign up, download and install the WCG BOINC client.");
                output("`n`n`bStep Three`b`nEnter your World Community Grid username and Verification Code into the boxes below.`n");
                rawoutput("<form action='runmodule.php?module=wcgpoints&op=verify' method='POST'>World Community Grid username: <input name='wcgid' value=\"\"><br />World Community Grid Verification Code: <input name='vcode' value=\"\"><br />Your verification code can be found on <a href=\"https://secure.worldcommunitygrid.org/ms/viewMyProfile.do\">this page</a>.  Copy-paste it into the box above, making sure you don't leave any tabs or spaces in there.<br /><input type='submit' class='button' value='{$submit}'></form>");
                addnav("", "runmodule.php?module=wcgpoints&op=verify");
                output("`bFeatures available in Cobblestone Cottage:`b`n`n");
                modulehook("wcg-features-desc");
            }
            require_once "lib/commentary.php";
            addcommentary();
            viewcommentary("wcgpoints", "Interject your own opinions about trying to get the damned thing working!", 25);
            addnav("Exit to Common Ground", "gardens.php");
            break;
        case "verify":
            //Player has entered a WCG ID
            //Check that it exists
            $id = httppost('wcgid');
            $vcode = httppost('vcode');
            $id = str_replace(" ", "+", $id);
            $source = "http://www.worldcommunitygrid.org/verifyMember.do?name=" . $id . "&code=" . $vcode;
            if ($xmlObj = simplexml_load_file($source)) {
                if (!$xmlObj->MemberStat && !$xmlObj->MemberStats->MemberStat) {
                    debug($xmlObj);
                    output("Jake scans his notebook and frowns.  \"`@You sure that's right, man?`0\"`n`n");
                    output("Something went wrong.  Please double-check the information you provided - remember that both usernames and verification codes are case-sensitive.`n`nHere's the error that World Community Grid passed back - it may or may not be useful:`n`4`b%s`b`0`nIf there is no error message above, then it's likely that World Community Grid is running its nightly stats update - in which case, try again in an hour or so.`n`n", $xmlObj);
                    rawoutput("<form action='runmodule.php?module=wcgpoints&op=verify' method='POST'>World Community Grid username: <input name='wcgid' value=\"\"><br />World Community Grid Verification Code: <input name='vcode' value=\"\"><br />Your verification code can be found on <a href=\"https://secure.worldcommunitygrid.org/ms/viewMyProfile.do\">this page</a>.  Copy-paste it into the box above, making sure you don't leave any tabs or spaces in there.<br /><input type='submit' class='button' value='{$submit}'></form>");
                    addnav("", "runmodule.php?module=wcgpoints&op=verify");
                } else {
                    //Check that the username isn't already taken
                    $sql = "SELECT acctid FROM " . db_prefix("accounts") . "";
                    $result = db_query($sql);
                    $idlo = strtolower($id);
                    for ($i = 0; $i < db_num_rows($result); $i++) {
                        $row = db_fetch_assoc($result);
                        $check = strtolower(get_module_pref("wcgid", "wcgpoints", $row['acctid']));
                        if ($check == $idlo) {
                            debug("Match found");
                            if (get_module_pref("wcgid-verified", "wcgpoints", $row['acctid'])) {
                                output("`bThat World Community Grid username has already been taken!`b`n`n");
                                $alreadyexists = 1;
                                rawoutput("<form action='runmodule.php?module=wcgpoints&op=verify1' method='POST'>World Community Grid username: <input name='wcgid' value=\"\"><br />World Community Grid Verification Code: <input name='vcode' value=\"\"><br />Your verification code can be found on <a href=\"https://secure.worldcommunitygrid.org/ms/viewMyProfile.do\">this page</a>.  Copy-paste it into the box above, making sure you don't leave any tabs or spaces in there.<br /><input type='submit' class='button' value='{$submit}'></form>");
                                addnav("", "runmodule.php?module=wcgpoints&op=verify");
                                break;
                            }
                        }
                    }
                    if (!$alreadyexists) {
                        set_module_pref("uidok", true);
                        set_module_pref("wcgid", $id);
                        set_module_pref("user_vcode", $vcode);
                        $points = $xmlObj->MemberStat->StatisticsTotals->Points;
                        if (!$points) {
                            $points = $xmlObj->MemberStats->MemberStat->StatisticsTotals->Points;
                        }
                        if (!$points) {
                            $points = $xmlObj->MemberStatsWithTeamHistory->MemberStats->MemberStat->StatisticsTotals->Points;
                        }
                        if (!$points) {
                            output("The hippy smiles.  \"`@Okay, you're all set.  Come back tomorrow and we'll sort you out with some cobblestones.`0\"`n`nYour account was verified successfully, but no points have been processed yet.  Points sometimes process a day or two late - check back and you'll get some cobblestones soon.`n`n");
                        } else {
                            set_module_pref("points", $points);
                            output("The hippy smiles.  \"`@Okay, you're all set.  Let's sort you out with some cobblestones...`0\"  He reaches underneath his desk and brings out a large bag.  \"`@Here you go, man.  %s cobblestones.  Have fun!`0\"`n`nThose should last you a while...`n`n", number_format($points));
                        }
                    }
                }
            } else {
                output("Whoops!  The XML file from World Community Grid couldn't be loaded.  This could be because World Community Grid is updating its point totals, in which case try again in an hour.  If it's still not working in a couple of hours, please Petition the admins to find out what went wrong.  Thanks!`n`n");
            }
            addnav("Exit to Common Ground", "gardens.php");
            break;
    }
    page_footer();
    return true;
}