randomColor(); $q = null; $c = null; if (isset($_GET['q'])) { $q = $_GET['q']; } if (isset($_GET['c'])) { if ($_GET['c'] === 'color') { $c = 'color'; } else { $c = 'nocolor'; } } if (isset($q)) { // API: c=color, header('Content-type: application/json'); $output = '{"result":"'; if ($db->ready()) { $phrase = $db->getPhrase(-1); $output .= 'success","content":"'; if (is_int($q)) { $phrase = $db->getPhrase($q); } else { $phrase = $db->getPhrase(-1); } $output .= $phrase->getPhrase(); $output .= '","id":"'; $output .= $phrase->getID(); if ($phrase->getError() !== false) { $output .= '","nf-error":"'; $output .= $phrase->getError(); } if ($c == 'color') { $output .= '","color":"' . $clr->rgbCSS(); } } else { $output .= 'failure'; } $output .= '"}'; die($output); } else { ?> <?php print(strtolower(ESS_NAME)); ?> : <?php print(ESS_TAGLINE); ?>
getPhrase(-1)->getPhrase()); ?>