2 /***********************************************************************/
4 /***********************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* 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 define('AT_INCLUDE_PATH', '../../../include/');
15 require (AT_INCLUDE_PATH.'vitals.inc.php');
16 include (AT_PA_INCLUDE.'lib.inc.php');
17 include (AT_PA_INCLUDE.'classes/PhotoAlbum.class.php');
18 //$_custom_css = $_base_path . AT_PA_BASENAME . 'module.css'; // use a custom stylesheet
21 $pa = new PhotoAlbum();
22 $type = AT_PA_TYPE_COURSE_ALBUM;
23 $album_count = sizeof($pa->getAlbums($_SESSION['member_id'], $type));
26 $page = intval($_GET['p']);
27 $last_page = ceil($album_count/AT_PA_ALBUMS_PER_PAGE);
29 if (!$page || $page < 0) {
31 } elseif ($page > $last_page){
35 $count = (($page-1) * AT_PA_ALBUMS_PER_PAGE) + 1;
36 $offset = ($page-1) * AT_PA_ALBUMS_PER_PAGE;
38 $albums = $pa->getAlbums($_SESSION['member_id'], $type, $offset);
40 include (AT_INCLUDE_PATH.'header.inc.php');
41 $savant->assign('albums', $albums);
42 $savant->assign('page', $page);
43 $savant->assign('type', $type);
44 $savant->assign('num_rows', $album_count);
45 $savant->display('photos/pa_index.tmpl.php');
46 include (AT_INCLUDE_PATH.'footer.inc.php');