/* Oh man is this quick and dirty. This makes way too many database calls and could be made more efficient but we're assuming not many people are going to be using this. A quick fix would be to cronjob this shit and pipe it to a static html file every 5 min or so. */ include 'functions.php'; $checkpoints = get_all_checkpoint_ids(); print "Total Runners in Database: " . total_runners() . "<br />"; print "Registered Runners: " . total_runners_registered(1) . "<br />"; print "Unregistered Runners: " . total_runners_registered(0) . "<br />"; print "<br />"; print "Runners that have been tagged: " . total_runners_tagged() . "<br />"; print "Registered Runners remaining: " . total_runners_registered_untagged(1) . "<br />"; print "Unregistered runners remaining: " . total_runners_registered_untagged(0) . "<br />"; print "<br />"; print "<b>Tag Stats</b><br />"; print "Active Taggers: " . active_chasers() . "<br />"; print "Active Taggers in last 30min: " . active_chasers(30) . "<br />"; print "<br />"; print "<b>Checkpoint Stats:</b><br />"; foreach ($checkpoints as $checkpoint_id) { print "<h2>" . get_checkpoint_name($checkpoint_id) . ":</h2>"; print "   Checkins: " . total_checkpoint_checkins($checkpoint_id) . "<br />"; $most_recent = most_recent_checkin($checkpoint_id); if (!empty($most_recent)) { print "   Most recent checkin: " . get_runner_name($most_recent['runner_id']) . " (" . $most_recent['runner_id'] . ") at " . $most_recent['checkin_time'] . "<br />"; print "<img src=\"/photos/" . $most_recent['runner_id'] . ".jpg\" style=\"margin-left: 25px;\"><br />"; } print "<br />"; } print "<ost recent";
'; die; } if (is_runner_registered($runner_id)) { print ' <h3>Runner ID: ' . $runner_id . '</h3> <p>Your phone is not bound to a Runner ID, you must bind your phone first before you can check in a tag against another player.<br /> <form name="bind_runner" action="' . $_SERVER['PHP_SELF'] . '?act=bind" method="post"> <input type="hidden" name="runner_id" value="' . $runner_id . '"> <p><input type="submit" value="Bind phone to ' . $runner_id . '"></p> </form> <form name="update_runner" action="' . $_SERVER['PHP_SELF'] . '?act=up" method="post"> <input type="hidden" name="runner_id" value="' . $runner_id . '"> <p>Name: <input type="text" name="runner_name" value="' . get_runner_name($runner_id) . '"></p> <p>Email: <input type="text" name="email_address" value="' . get_runner_email($runner_id) . '"></p> <p><input type="submit" value="Update Info"></p> </form> '; // .get_checkpoint_name($checkpoint_id). //maybe we can print a form that says "If you tagged this person, enter your serial number here" and then reset their cookie? die; } //show form ?> Looks like you aren't registered yet!<br /> <form name="register_runner" action="<?php echo $_SERVER['PHP_SELF']; ?> ?act=reg" method="post">
print '<h2>Journey Log</h2>'; $tagger_id = clean_chaser_id($_GET['tid']); $runner_id = clean_runner_id($_GET['rid']); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $tagger_id = clean_chaser_id($_POST['tagger_id']); $runner_id = clean_chaser_id($_POST['runner_id']); $loc_lat = $_POST['latitude']; $loc_long = $_POST['longitude']; $loc_addr = $_POST['address']; if (empty($loc_lat)) { $loc_lat = 0; } if (empty($loc_long)) { $loc_long = 0; } print '<p><span style="color:red;">Chaser ' . get_runner_name($tagger_id) . '</span> tagged <span style="color:blue;">Runner ' . get_runner_name($runner_id) . '</span> at ' . $loc_lat . ',' . $loc_long . '.<br />'; if (is_valid_runner($tagger_id) && is_valid_runner($runner_id)) { if (register_tag($tagger_id, $runner_id, $loc_lat, $loc_long, $loc_addr)) { print '<div style="font-size:14em;color:green;text-align: center;">✓</div><h3>Your tag is checked in!</h3>'; } else { if (tag_exists($tagger_id, $runner_id)) { print '<h3>You\'ve already tagged this runner!</h3><div style="font-size:14em;color:red;text-align: center;">X</div>'; } else { print '<h3>Oops, something is broken</h3><div style="font-size:14em;color:red;text-align: center;">X</div>'; } } } else { if (DEBUG) { print '<h3>Invalid tagger or runner</h3><div style="font-size:14em;color:red;text-align: center;">X</div>'; } }
$cookie_rid = $_COOKIE["jlog-rid"]; if (is_chaser($target_id)) { echo "<p>Runner {$target_id} has been marked as tagged.</p>"; } else { tag($target_id, $chaser_id); $num_tagged = ''; if ($chaser_id) { $num_tagged = get_num_tagged_by($chaser_id); } echo "<p>Runner {$target_id} has been tagged.</p>"; if ($cookie_rid == $chaser_id) { $tagged_twitter = get_runner_twitter($target_id); if ($tagged_twitter) { $twitterString = "I just tagged @{$tagged_twitter} -- victim number {$num_tagged}! #sxsw #jtteotn"; } else { $tagged_name = get_runner_name($target_id); if ($tagged_name) { $twitterString = "I just tagged {$tagged_name} -- victim number {$num_tagged}! #sxsw #jtteotn"; } else { $twitterString = "I just tagged victim number {$num_tagged}! #sxsw #jtteotn"; } } echo "<p><a href='http://twitter.com/intent/tweet?text=" . clean_tweet($twitterString) . "'>Tweet it!</a> {$twitterString}</p>"; } elseif ($cookie_rid == $target_id) { if ($chaser_id) { $chaser_twitter = get_runner_twitter($chaser_id); } if ($chaser_twitter) { $twitterString = "I've been tagged by @{$chaser_twitter} -- I am now transformed; a chaser, ready to stalk the runners through the night. #sxsw #jtteotn"; } else { $twitterString = "I've been tagged -- I am now transformed; a chaser, ready to stalk the runners through the night. #sxsw #jtteotn";
<?php require_once 'functions.php'; $rid = $command[1]; $cookie_rid = $_COOKIE["jlog-rid"]; # check to make sure you're logged in as you and not let other players see your info if ($cookie_rid != $rid) { echo "<p>If you are trying to tag this person, you must first <a href='/tagged/" . $cookie_rid . "'>mark yourself as tagged</a>.</p>"; echo "<p>If you are trying to log in as this person, you must first <a href='/logout'>logout</a>.</p>"; } else { $dtzone = new DateTimeZone($tz); $runner_name = get_runner_name($rid); echo "<br />player profile for runner id ", $rid, " (", $runner_name, ")"; $checkin_stats = get_runner_checkin_info($rid); if (sizeof($checkin_stats) > 0) { echo "<p><table><tr><th>Checkpoint name</th><th>Checked in Before You</th><th>Checkin Time</th></tr>\n"; foreach ($checkin_stats as &$row) { $dt = new DateTime($row[2], $dtzone); echo "<tr><td>", $row[0], "</td><td>", $row[1], "</td><td>", $dt->format("h:i:s"), "</td></tr>\n"; } echo "</table></p>\n"; } else { echo "<p>No checkins yet.</p>"; } if (is_chaser($rid)) { $num_tagged = get_num_tagged_by($rid); echo "<br />You have recorded {$num_tagged} tags so far.\n"; echo "<br />To record that you tagged someone, scan their QR code.\n"; echo "<br />Or, if you accidentally marked yourself as tagged, you can <a href='/resurrected'>un-tag yourself</a>."; } else { echo "<br /><a href='/tagged/", $rid, "'>I Got Tagged</a>\n";