示例#1
0
// process new posting
//
$errors = array();
if (isset($_POST['paste'])) {
    //process posting and redirect
    $id = $pastebin->doPost($_POST);
    if ($id) {
        $pastebin->redirectToPost($id);
        exit;
    }
}
///////////////////////////////////////////////////////////////////////////////
// process download
//
if (isset($_GET['dl'])) {
    $pid = $pastebin->cleanPostId($_GET['dl']);
    if (!$pastebin->doDownload($pid)) {
        //not fount
        echo "Pastebin entry {$pid} is not available";
    }
    exit;
}
///////////////////////////////////////////////////////////////////////////////
// if we get this far, we're going to be displaying some HTML, so let's kick
// off here...
$page = array();
//figure out some nice defaults
$page['current_format'] = $CONF['default_highlighter'];
$page['expiry'] = $CONF['default_expiry'];
$page['remember'] = '';
//see if we can come up with a better default using the subdomain