function sp_post_editor_section_math($out, $spThisData, $a)
{
    # Start Spam Measures
    if (sp_get_auth('bypass_math_question', $spThisData->forum_id) ? $usemath = false : ($usemath = true)) {
    }
    if ($usemath) {
        extract($a, EXTR_SKIP);
        # sanitize
        $controlInput = esc_attr($controlInput);
        $labelMath = sp_filter_title_display($labelMath);
        $labelMathSum = sp_filter_title_display($labelMathSum);
        $labelPostButtonReady = sp_filter_title_display($labelPostButtonReady);
        $labelPostButtonMath = sp_filter_title_display($labelPostButtonMath);
        $out .= '<div class="spEditorSubmit">' . "\n";
        $out .= '<div class="spInlineSection">' . "\n";
        $out .= 'Guest URL (required)<br />' . "\n";
        $out .= "<input type='text' class='{$controlInput}' size='30' name='url' value='' />\n";
        $out .= "</div>\n";
        $spammath = sp_math_spam_build();
        $uKey = sp_get_option('spukey');
        $uKey1 = $uKey . '1';
        $uKey2 = $uKey . '2';
        $out .= "<div class='spEditorTitle'>{$labelMath}</div>\n";
        $out .= "<div class='spEditorSpam'>{$labelMathSum}:</div>\n";
        $out .= "<div class='spEditorSpam'>{$spammath['0']} + {$spammath['1']}</div>\n";
        $out .= "<div class='spEditorSpam'>\n";
        $out .= "<input type='text' tabindex='105' class='{$controlInput}' size='20' name='{$uKey1}' id='{$uKey1}' value='' onkeyup='spjSetPostButton(this, " . $spammath[0] . ", " . $spammath[1] . ", \"" . esc_js($labelPostButtonReady) . "\", \"" . esc_js($labelPostButtonMath) . "\")' />\n";
        $out .= "<input type='hidden' name='{$uKey2}' value='{$spammath['2']}' />\n";
        $out .= "</div></div>\n";
    }
    # End Spam Measures
    return $out;
}
function spa_register_math()
{
    $sflogin = sp_get_option('sflogin');
    if ($sflogin['sfregmath']) {
        $spammath = sp_math_spam_build();
        $uKey = sp_get_option('spukey');
        $uKey1 = $uKey . '1';
        $uKey2 = $uKey . '2';
        $out = '<input type="hidden" size="30" name="url" value="" /></p>' . "\n";
        $out .= '<label>' . sp_text('Math Required!') . '<br />' . "\n";
        $out .= sprintf(sp_text('What is the sum of: %s %s + %s %s'), '<strong>', $spammath[0], $spammath[1], '</strong>') . '</label>' . "\n";
        $out .= '<input class="input" type="text" id="' . $uKey1 . '" name="' . $uKey1 . '" value="" />' . "\n";
        $out .= '<input type="hidden" name="' . $uKey2 . '" value="' . $spammath[2] . '" />' . "\n";
        $out .= '<br />';
        echo $out;
    }
}