Exemplo n.º 1
0
     if (!$images && $album->owner) {
         echo '&raquo; ' . ahref('u/album/delete/' . $this->child2, 'Delete empty album') . '<br/>';
     }
     if ($session->id == $this->child) {
         echo '&raquo; ' . ahref('u/album/upload/' . $this->child2, 'Add photos') . '<br/>';
     }
     foreach ($images as $im) {
         $a = new XhtmlComponentA();
         $a->href = getThumbUrl($im->id, 0, 0);
         $a->rel = 'lightbox[album]';
         $a->content = showThumb($im->id, $im->name, 150, 150);
         echo $a->render();
         echo ahref('u/photo/show/' . $im->id, 'Details');
         echo '<br/><br/>';
     }
     $lb = new YuiLightbox();
     echo $lb->render();
     break;
 case 'delete':
     $session->requireLoggedIn();
     if ($this->child && confirmed('Are you sure you want to delete this photo album?')) {
         // verify that the owner of the album is current session id
         $album = PhotoAlbum::get($this->child);
         if (!$album->owner || $album->owner != $session->id) {
             dp('HACK: tried to delete photo album ' . $this->child . ' which is not owned by user ' . $session->id);
             return;
         }
         PhotoAlbum::delete($this->child);
         js_redirect('u/album/overview');
     }
     break;
Exemplo n.º 2
0
 echo '<h1>Photo details for ' . $f->name . '</h1>';
 //d($f);
 $size = getimagesize(File::getUploadPath($this->child));
 //    d($size);
 echo 'Name: ' . $f->name . '<br/>';
 echo 'Uploaded: ' . ago($f->time_uploaded) . ' by ' . $f->uploader . '<br/>';
 echo 'Resolution: ' . $size[0] . 'x' . $size[1] . '<br/>';
 echo 'Size: ' . byte_count($f->size) . '<br/>';
 echo '<br/>';
 // shows the photo
 $a = new XhtmlComponentA();
 $a->href = getThumbUrl($f->id, 0, 0);
 $a->rel = 'lightbox';
 $a->content = showThumb($f->id, $f->name, 150, 150);
 echo $a->render();
 $lb = new YuiLightbox();
 echo $lb->render() . '<br/>';
 if ($session->id && $session->id != $f->uploader) {
     echo '&raquo; ' . ahref('u/report/photo/' . $f->id, 'Report photo') . '<br/>';
 }
 if ($session->id && $session->id == $f->uploader) {
     echo '&raquo; ' . ahref('u/photo/rotate/' . $f->id . '/90', 'Rotate left') . '<br/>';
     echo '&raquo; ' . ahref('u/photo/rotate/' . $f->id . '/270', 'Rotate right') . '<br/>';
     echo '<br/>';
     echo '&raquo; ' . ahref('u/photo/delete/' . $f->id, 'Delete photo') . '<br/>';
 }
 echo '<br/>';
 $view = new ViewModel('views/user/rate.php');
 $view->registerVar('view', 'handle');
 $view->registerVar('owner', FILE);
 $view->registerVar('child', $f->id);