Exemple #1
0
<?php

mod('form');
$form = form_create('Continue', 'default', 'process_form', 'post');
function process_form()
{
    global $form, $root, $userid;
    $f = $_FILES['file'];
    $name = $f['name'];
    $f['name'] = md5(rand(0, 1000000000));
    $path = $root . '/uploads/midi/' . $f['name'];
    if (!move_uploaded_file($f['tmp_name'], $path)) {
        form_add_error($form, 'Error uploading file.');
    } else {
        header('Location: /import2/' . $f['name'] . '?title=' . urlencode($name));
        exit;
    }
}
form_add_param($form, 'File', 'file', 'file;mid;20000000', '', 100, 14);
form_process();
output_header("Upload MIDI File");
output_block_start("Upload MIDI File");
echo '<p>Keep in mind that not all MIDI files will work well! Many MIDI files use features that are not supported by the sequencer; simple ones work best.</p>';
echo '<p>Examples: <a href="http://onlinesequencer.net/4679">Baba Yetu</a>, <a href="http://onlinesequencer.net/4680">Fangad aven korvring</a>, <a href="http://onlinesequencer.net/4681">Cliffs of Dover</a></p>';
form_display($form);
output_block_end();
output_footer();
Exemple #2
0
global $vars;
$vars = array('Form', 'type', 'name', 'savenew', 'oldname');
$essential_forms = array('comments', 'comments_display', 'comment_form', 'default', 'plainlinks', 'files');
$form_types = array('article' => gTxt('article'), 'misc' => gTxt('misc'), 'comment' => gTxt('comment'), 'category' => gTxt('category'), 'file' => gTxt('file'), 'link' => gTxt('link'), 'section' => gTxt('section'));
if ($event == 'form') {
    require_privs('form');
    bouncer($step, array('form_edit' => false, 'form_create' => false, 'form_delete' => true, 'form_multi_edit' => true, 'form_save' => true, 'save_pane_state' => true));
    switch (strtolower($step)) {
        case "":
            form_edit();
            break;
        case "form_edit":
            form_edit();
            break;
        case "form_create":
            form_create();
            break;
        case "form_delete":
            form_delete();
            break;
        case "form_multi_edit":
            form_multi_edit();
            break;
        case "form_save":
            form_save();
            break;
        case "save_pane_state":
            form_save_pane_state();
            break;
    }
}
<?php

mod("pager");
mod("form");
$gp = pager_init(66);
$searchform = form_create('Search', 'inline', null, 'get');
form_add_param($searchform, 'Value', 'search', 'string', '', 100, 12);
$search = p_string('search');
$basedon = p_int('basedon', 0);
$sort = p_string('sort', 1);
$date = p_string('date', empty($search) ? 1 : 4);
if (isset($_GET['deleted'])) {
    $where = ' WHERE deleted=1 ';
} else {
    if ($basedon) {
        $where = ' WHERE basedon="' . $basedon . '" ';
    } else {
        if (!empty($_GET["search"])) {
            $where = ' WHERE deleted=0 AND MATCH(title) AGAINST("%' . e_mysql($search) . '%") ';
        } else {
            $where = ' WHERE deleted=0 ';
        }
    }
}
switch ($sort) {
    case 2:
        $order = "accesscount DESC";
        break;
    case 4:
        $order = "RAND()";
        break;