$noochCount = Database::selectValue("SELECT nooch FROM content_tracking_users WHERE uni_id=? AND content_id=? LIMIT 1", array(Me::$id, $contentID)); if ($noochCount !== false and $noochCount < 3) { if ($success = Credits::chargeInstant(Me::$id, 0.15, "Assigned a Nooch")) { $contentTrack->nooch(); $noochCount++; } } } echo json_encode(array("content_id" => $contentID, "nooch_count" => (int) $noochCount, "nooch_success" => $success)); exit; case "tip": if (!isset($_POST['amount'])) { echo 'false'; exit; } // Prepare Values $_POST['amount'] = (double) $_POST['amount']; $pass = $_POST['amount'] >= 0.1 ? true : false; // Process the UniJoule exchange if ($pass) { $pass = Credits::exchangeInstant(Me::$id, (int) $authorID, $_POST['amount'], "Tipped by " . Me::$vals['display_name']); } // Track the tip if ($pass and $success = $contentTrack->tip($_POST['amount'])) { echo json_encode(array("content_id" => (int) $contentID, "tip_boost" => floor($_POST['amount'] * 10))); } else { echo 'false'; } exit; } }