Example #1
0
function whatToDo($url)
{
    $pm = new PictshareModel();
    $data = $pm->urlToData($url);
    if (!is_array($data) || !$data['hash']) {
        if (UPLOAD_FORM_LOCATION && $url == UPLOAD_FORM_LOCATION || !UPLOAD_FORM_LOCATION && ($url = '/')) {
            $upload_answer = $pm->ProcessUploads();
            if ($_POST['submit'] == $pm->translate(3) && $upload_answer) {
                $o = $upload_answer;
            } else {
                $o .= $pm->renderUploadForm();
            }
            $vars['content'] = $o;
            $vars['slogan'] = $pm->translate(2);
        }
        if (!$vars && LOW_PROFILE) {
            header('HTTP/1.0 404 Not Found');
            exit;
        } else {
            if (!$vars) {
                $vars['content'] = $pm->translate(12);
                $vars['slogan'] = $pm->translate(2);
            }
        }
        render($vars);
    } else {
        renderImage($data);
    }
}