Esempio n. 1
0
$smarty->assign('thumb', $thumb);
if (isset($_REQUEST['id'])) {
    $image->loadFromId($_REQUEST['id']);
    $isowner = $image->user_id == $USER->user_id ? 1 : 0;
    $isadmin = !$isowner && $USER->hasPerm('ticketmod') ? 1 : 0;
    if ($image->isValid()) {
        if ($image->moderation_status == 'rejected') {
            if ($isowner || $isadmin) {
                //ok, we'll let it lie...
            } else {
                header("Location: /photo/{$_REQUEST['id']}");
                exit;
            }
        }
        if (isset($_GET['unlock'])) {
            $image->unlockThisImage($USER->user_id);
            die(1);
        }
        //get the grid references
        $image->getSubjectGridref();
        $image->getPhotographerGridref();
        //save these so can be used as title etc on the main image (when following link from search results, and redoing changes etc)
        $vars = get_object_vars($image);
        foreach ($vars as $name => $val) {
            if ($name != "db") {
                $image->{"current_{$name}"} = $image->{$name};
            }
        }
        //do our thing!
        $smarty->assign('page_title', $image->grid_reference);
        $smarty->assign_by_ref('image', $image);