<?php

###############################################################################
#                      ALLbum-1.0.0: index.php                                #
#                  (visitor interface component)                              #
#                                                                             #
# ALLbum-1.0.0 is a module for the Content Management System                  #
# "Site@School"  (http://siteatschool.sourceforge.net).                       #
#                                                                             #
# ALLbum is hosted at http://sasmodulesi.sourceforge.net                      #
# ALLbum is written by Martin Herrman <m.herrman@student.tue.nl>              #
# ALLbum is copyrighted by OBS Rosa Boekdrukker, Amsterdam, The Netherlands   #
# (http://www.rosaboekdrukker.nl)                                             #
# ALLbum is licenced by GNU General Public Licence                            #
#                                                                             #
###############################################################################
# sas_index2.php: last changed 12/07/2006 2.4.03     
#                    by Fred Stuurman (fc.stuurman@hccnet.nl)
#$Id: sas_index2.php,v 1.1 2006/10/03 09:03:40 fstuurman Exp $ 
###############################################################################
#                                                                             #
#                            LICENCE INFORMATION                              #
#                                                                             #
# Copyright (c) 2003-2004, OBS Rosa Boekdrukker, Amsterdam, The Netherlands.  #
#                                                                             #
# This program is free software, you can redistribute it and/or               #
# modify it under the terms of the GNU General Public License                 #
# as published by the Free Software Foundation; either version 2              #
# of the License, or (at your option) any later version.                      #
#                                                                             #
# This program is distributed in the hope that it will be useful,             #
# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                        #
# See the GNU General Public License for more details.                        #
#                                                                             #
# You should have received a copy of the GNU General Public License           #
# along with this program; if not, write to the Free Software                 #
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. #
###############################################################################
if (!defined('IN_SAS'))
{
	die("Hacking attempt");
}
if (IsSet ($_GET['option']))
{
	$option = $_GET['option'];
}

// include shared functions:
include ("$cmsdir/modules/sn_allbum/shared.inc.php");

load_language($cmsdir . '/', 'sn_allbum'); //load language file

if ($option == "slideshow")
{
	$ID = $_GET['ID'];
	include ("$cmsdir/modules/sn_allbum/slideshow.php");
	print "<tr><td><input type=\"button\" value=\"&nbsp;" . $sas_lang['goback'] . "\" name=\"backbutton\" onClick=\"javascript:history.go(-1)\" class=\"backbutton\"></td></tr>";
}
else
{
	//see if there is an allbum with this pagename
	$ID = db_GetAllbumToPage($pagetitle);
	if ($ID != 0)
	{

		// determine what object to show:
		if (IsSet ($_GET['gallerypage']))
		{
			ShowContent($_GET['ID'], $_GET['gallerypage'], 0);
		}
		else
		{
			ShowContent($ID, 1, 0);
		}
	}
	else
	{
		print $sas_lang['sn_allbum_no_linkpage'];
	}
}
?>
