$objAlbumGuest->set('allow_post_picture', NO); $objAlbumGuest->set('allow_post_comment', NO); $objAlbumGuest->set('allow_delete_picture', NO); $objAlbumGuest->set('allow_create_subalbum', NO); break; } $objAlbumGuest->save(); $objAlbumMember->save(); $objAlbumGroup->save(); $objAlbum->set('albumpolicy_guest_id', $objAlbumGuest->get('id')); $objAlbum->set('albumpolicy_member_id', $objAlbumMember->get('id')); $objAlbum->set('albumpolicy_group_id', $objAlbumGroup->get('id')); $objAlbum->remove('simple_permissions'); } $objAlbum->save(); header('Location: index.php?action=albums&' . $objAlbum->getIDPair()); } else { $strSubAction = 'edit'; } } if ($strSubAction == 'delete') { $objAlbum->getFromRequest(); $objAlbum->load(); if (!$objAlbum->canEdit($objUser)) { throw new exception('exception_accessdenied'); } $objAlbum->delete(); $objAlbum->save(); header('Location: index.php?action=albums'); } if ($strSubAction == 'move') {
<?php require_once 'cls/clsAlbum.php'; print "<span class='recentheader'>Recently Updated Albums</span>"; $arrAlbums = clsAlbum::getRecentAlbums($objUser, 5); foreach ($arrAlbums as $objAlbum) { $objAlbum = new clsAlbum($objAlbum->get('id')); print "<p><a href='index.php?action=albums&" . $objAlbum->getIDPair() . "' class='recentlink'>" . $objAlbum->get('name') . "</a> <span class='recentdate'>(" . $objAlbum->getUsername() . ")</span> " . $objAlbum->getNewIcon($objUser) . "<br>"; print "<span class='recentdate'>(" . $objAlbum->getLastUpdated() . ")</span></p>"; }
<?php require_once 'cls/clsAlbum.php'; require_once 'cls/clsPicture.php'; print "<span class='recentheader'>New Pictures</span>"; $arrPictures = clsPicture::getRecentPictures($objUser, 5); foreach ($arrPictures as $objPicture) { $objPicture = new clsPicture($objPicture->get('id')); $objAlbum = new clsAlbum($objPicture->get('album_id')); print "<p>"; print $objPicture->getHtmlThumbnail(100, 100) . "<br>"; print "<a href='index.php?action=picture&" . $objPicture->getIDPair() . "' class='recentlink'>" . $objPicture->get('title') . "</a> <span class='recentdate'>in</span> <a href='index.php?action=albums&" . $objAlbum->getIDPair() . "' class='recentlink'>" . $objAlbum->get('name') . "</a><br>"; print "<span class='recentdate'>" . $objPicture->getUsername() . "<br>"; print time_to_text(strtotime($objPicture->get('date'))) . "</span>"; print "</p>"; }
if ($objPicture->get('confirmed')) { /* If the picture is already confirmed, just skip this. */ $strSubAction = 'preview'; } else { if ($objPicture->get('user_id') != $user_id) { throw new Exception('exception_accessdenied'); } /* Make sure that users can only edit their own pictures. */ $objAlbum = new clsAlbum($objPicture->get('album_id')); if ($objAlbum->isNew()) { $objTemplate->setText('ERROR', "Please select an album for the picture."); } elseif ($objAlbum->canPostPicture($objUser)) { $objPicture->set('confirmed', 1); $objPicture->set('date', date('Y-m-d H:i:s')); $objPicture->save(); $objTemplate->setText('MESSAGE', "Picture has been saved [<a href='index.php?action=albums&" . $objAlbum->getIDPair() . "'>Go to album</a>]."); } else { $objTemplate->setText('ERROR', "You are not allowed to post pictures in that category."); } $strSubAction = 'preview'; } } if ($strSubAction == 'delete') { $user_id = $objUser ? $objUser->get('id') : 0; $objPicture = new clsPicture(); $objPicture->getFromRequest(); $objPicture->load(); if ($objPicture->get('user_id') != $user_id) { throw new Exception('exception_accessdenied'); } /* Make sure that users can only edit their own pictures. */