示例#1
0
// determine which step of the submit process we are on
$phase = isset($_POST["phase"]) && is_numeric($_POST["phase"]) ? $_POST["phase"] : 0;
// If show URL input box is disabled, go straight to step 2
if ($phase == 0 && Submit_Show_URL_Input == false) {
    $phase = 1;
}
switch ($phase) {
    case 0:
        // Link to this page, before starting submit process.
        do_submit0();
        break;
    case 1:
        do_submit1();
        break;
    case 2:
        do_submit2();
        break;
    case 3:
        do_submit3();
        break;
}
exit;
// enter URL before submit process
function do_submit0()
{
    global $main_smarty, $the_template;
    $main_smarty->assign('submit_rand', rand(10000, 10000000));
    $main_smarty->assign('Submit_Show_URL_Input', Submit_Show_URL_Input);
    $main_smarty->assign('Submit_Require_A_URL', Submit_Require_A_URL);
    define('pagename', 'submit');
    $main_smarty->assign('pagename', pagename);
示例#2
0
    switch ($_POST["phase"]) {
        case 1:
            do_header(_('enviar historia') . " 2/3", _('enviar historia'));
            echo '<div id="singlewrap">' . "\n";
            if (!do_submit1()) {
                // Just to display error messages
                $link = new Link();
                $link->randkey = rand(10000, 10000000);
                $link->key = md5($link->randkey . $current_user->user_id . $current_user->user_email . $site_key . get_server_name());
                Haanga::Load('link/submit_empty_form.html', compact('link', 'errors'));
            }
            break;
        case 2:
            do_header(_('enviar historia') . " 3/3", _('enviar historia'));
            echo '<div id="singlewrap">' . "\n";
            if (!do_submit2()) {
                // Just to display error messages
                $link = new Link();
                $link->randkey = rand(10000, 10000000);
                $link->key = md5($link->randkey . $current_user->user_id . $current_user->user_email . $site_key . get_server_name());
                Haanga::Load('link/submit_empty_form.html', compact('link', 'errors'));
            }
            break;
        case 3:
            do_submit3();
            break;
    }
} else {
    check_already_sent();
    force_authentication();
    do_header(_('enviar historia') . " 1/3", _('enviar historia'));