2 /***********************************************************************/
4 /***********************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Adaptive Technology Resource Centre / Inclusive Design Institute */
9 /* This program is free software. You can redistribute it and/or */
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /***********************************************************************/
14 $_user_location = 'public';
16 define('AT_INCLUDE_PATH', '../../include/');
17 require (AT_INCLUDE_PATH.'vitals.inc.php');
18 include (AT_PA_INCLUDE.'lib.inc.php');
19 include (AT_PA_INCLUDE.'classes/PhotoAlbum.class.php');
20 $_custom_css = $_base_path . AT_PA_BASENAME . 'module.css'; // use a custom stylesheet
23 $pa = new PhotoAlbum();
24 $type = AT_PA_TYPE_MY_ALBUM;
25 $album_count = sizeof($pa->getAlbums($_SESSION['member_id'], $type));
28 $page = intval($_GET['p']);
29 $last_page = ceil($album_count/AT_PA_ALBUMS_PER_PAGE);
31 if (!$page || $page < 0) {
33 } elseif ($page > $last_page){
37 $count = (($page-1) * AT_PA_ALBUMS_PER_PAGE) + 1;
38 $offset = ($page-1) * AT_PA_ALBUMS_PER_PAGE;
40 $albums = $pa->getAlbums($_SESSION['member_id'], $type, $offset);
42 include (AT_INCLUDE_PATH.'header.inc.php');
43 $savant->assign('albums', $albums);
44 $savant->assign('page', $page);
45 $savant->assign('type', $type);
46 $savant->assign('num_rows', $album_count);
47 $savant->display('pa_index.tmpl.php');
48 include (AT_INCLUDE_PATH.'footer.inc.php');