array("advanced" => true, "type" => "checkbox", "value" => false, "caption" => "Do not hit browsers with no Javascript support (only positive karma for JS-enabled browsers).")); function form_insert($post_ID) { $seed = $this->get_option_value('secret_seed'); if (empty ($seed)) { $seed = sk2_rand_str(10); $this->set_option_value('secret_seed', $seed); $this->log_msg(__("Resetting secret seed to: ", 'sk2') . $seed, 5); } $max = rand(5, 9); $tot = $str = 1; for ($i = 0; $i < $max; $i++) { $op = rand(0, 8); $num = rand(1, 42); switch ($op) { case 0: case 8: $str = "(" . $str . " + " . $num . ")"; $tot += $num; break; case 1: $str = "(" . $str . " - " . $num . ")"; $tot -= $num; break; case 2: $str = "(" . $str . " * " . $num . ")"; $tot *= $num; break; case 3: $str = "Math.round ( Math.abs(" . $str . " / " . $num . "))"; $tot = round(abs($tot / $num)); break; case 4: $str = "Math.min(" . $str . ", " . $num . ")"; $tot = min($tot, $num); break; case 5: $str = "Math.max(" . $str . ", " . $num . ")"; $tot = max($tot, $num); break; case 6: $str = "Math.round ( Math.abs(" . $str . " % " . $num . "))"; $tot = round(abs($tot % $num)); break; case 7: $str = "(" . $str . " + Math.round( Math.abs(100*Math.sin(" . $num . ")) ) )"; $tot = $tot + round(abs(100*sin($num))); break; } } $js_command = "Math.round ( Math.abs(" . $str . "))" ; $tot = round(abs($tot)); $check1 = sk2_rand_str(10); $check2 = md5($tot . $check1 . $seed); ?>