Example #1
0
         $_SESSION['galleriesData'][0]['name'] = $contributor['display_name'];
         //
         $smarty->assign('contrReturnRows', $contrReturnRows);
         $smarty->assign('contributor', $contributor);
     } else {
         $owner = 0;
     }
 }
 if (!$owner) {
     $galleriesMainPageLink['page'] = "gallery.php?mode=gallery";
     $_SESSION['galleriesData'][0]['linkto'] = linkto($galleriesMainPageLink);
     // Check for SEO
     $_SESSION['galleriesData'][0]['name'] = $lang['galleries'];
     //
 }
 $crumbs = galleryCrumbs($_SESSION['id']);
 // Create the crumbs array
 $crumbsFull = galleryCrumbsFull($_SESSION['id']);
 // Create the crumbs array
 $_SESSION['crumbsSession'] = $crumbsFull;
 // Assign these to a session to be used elsewhere
 //print_r($crumbsFull); // Testing
 //echo $_SESSION['id']."<br />";
 //print_r($crumbs);
 $subGalleryCount = 0;
 $currentGalleryCount = 1;
 foreach ($_SESSION['galleriesData'] as $key => $value) {
     if ($value['parent_gal'] == $_SESSION['id'] and $value['gallery_id'] != 0) {
         if ($value['album'] == 0) {
             if ($currentGalleryCount > $galleryStartRecord and $currentGalleryCount <= $galleryPerPage * $_SESSION['galleryCurrentPage']) {
                 $subGalleriesData[$key] = $value['gallery_id'];
define('META_TITLE', $lang['galleryLogin'] . ' &ndash; ' . $config['settings']['site_title']);
// Assign proper meta titles
require_once BASE_PATH . '/assets/includes/header.inc.php';
require_once BASE_PATH . '/assets/includes/errors.php';
$useID = $id;
// Original ID before any conversion
$id = $_REQUEST['id'];
try {
    if ($config['EncryptIDs']) {
        // Decrypt IDs
        $id = k_decrypt($id);
    }
    idCheck($id);
    // Make sure ID is numeric
    $currentGallery = $_SESSION['galleriesData'][$id];
    $crumbs = galleryCrumbs($id);
    // Get the crumb trail
    //print_r($crumbs);
    if ($_POST) {
        if (k_encrypt($galleryPassword) == $currentGallery['password']) {
            $_SESSION['member']['memberPermGalleries'][] = $id;
            // Add this ID to the permission string
            header("location: gallery.php?mode=gallery&id={$useID}&page=1");
            // Redirect back to the galleries page
            exit;
        } else {
            $logNotice = 'galleryWrongPass';
            // The session assign/login failed
        }
    }
    $smarty->assign('crumbs', $crumbs);