<?php
	if( !$this->user->is_logged ) {
		$this->redirect('home');
	}
	
	
	/*************************************************************************/
	// needed before proceeding
	require_once('_all-required-language.php');
	
	$this->load_langfile('global/global.php');	
	$this->load_langfile('inside/dashboard.php');

	/*************************************************************************/
	
	require_once('_all-required-dashboard.php');

	/*************************************************************************/
	
	$D->codalbum = '';
	if ($this->param('a')) $D->codalbum = $this->param('a');

	if (empty($D->codalbum)) {
		$this->redirect($C->SITE_URL.'dashboard/myalbums');
	} else {
		$r = $this->db2->query("SELECT * FROM albums WHERE code='".$D->codalbum."' AND iduser=".$this->user->id." LIMIT 1");
		
		if (!$obj = $this->db2->fetch_object($r)) $this->redirect($C->SITE_URL.'dashboard/myalbums');
		else $D->album = $obj;
		
		$D->codealbum = stripslashes($D->album->code);
		$D->namealbum = stripslashes($D->album->namealbum);
		$D->description = stripslashes($D->album->description);
		$D->privacy = $D->album->who_see;
	
	}

	/*************************************************************************/

	$D->optionactive = 14;
	$this->load_template('dashboard-myalbums-edit.php');
?>