fullbodycast.org profile."); define('TEXT_CONFIDENCE', "Your Rocky persona has been determined %.2f%%. You may stop at any time and get your result by clicking Show Result.
"); define('SKIP_PROB', 1); define('DONE_FUNC', 'ServeRocky'); echo HandleSubmit('rocky', $_POST); function ServeRocky($file, $scores) { $page = file_get_contents($file); $dir = "Cast/history/people/" . basename($file, '.html') . "/"; $name = GetRockyName($file); if (!preg_match('/\ '#000000')); } $others = "You also matched..." . ul(true, array('align' => 'left')); $min = $scores[array_mini($scores)]; $max = $scores[$file]; unset($scores[$file]); for ($ii = 0; $ii < 5; $ii++) { $maxi = array_maxi($scores); $others .= li() . l(GetRockyURL($maxi), GetRockyName($maxi)) . sprintf(" (%.0f%%)", 100 * ($scores[$maxi] - $min) / ($max - $min)); unset($scores[$maxi]); } $others .= ul(false); return $image . br() . "You're $name!" . br() . ServeLink(GetRockyURL($file), $name) . br() . br() . $others; } function ServeLink($url, $name) { return "See " . l($url, $name . "'s full profile") . "!"; } function GetRockyName($file) { $page = file_get_contents($file); // Get name $name0 = strpos($page, "Name:"); if ($name0 === false) return basename($file, '.html'); $name0 += 5; $name = trim(StripHTML(substr($page, $name0, strpos($page, "\n", $name0) - $name0))); // Get nickname, if see one $nick0 = strpos($page, "Nickname:"); if ($nick0 !== false) { $nick0 += 9; $nick = trim(StripHTML(substr($page, $nick0, strpos($page, "\n", $nick0) - $nick0))); if (strlen($nick) > 2 && strlen($nick) < 20) $name .= " ($nick)"; } return $name; } function GetRockyURL($file) { $dir = "Cast/history/people/" . basename($file, '.html') . "/"; return "http://www.fullbodycast.org/$dir"; } ?>