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 $_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 $keywords = explode(' ', trim($_POST['pa_search']));
25 $search_results = $pa->search($keywords);
26 $album_count = sizeof($pa->getSharedAlbums(true));
29 $page = intval($_GET['p']);
30 $last_page = ceil($album_count/AT_PA_ALBUMS_PER_PAGE);
32 if (!$page || $page < 0) {
34 } elseif ($page > $last_page){
38 $count = (($page-1) * AT_PA_ALBUMS_PER_PAGE) + 1;
39 $offset = ($page-1) * AT_PA_ALBUMS_PER_PAGE;
41 $albums = $pa->getSharedAlbums(true, $offset);
43 include (AT_INCLUDE_PATH.'header.inc.php');
44 $savant->assign('search_input', AT_print($_POST['pa_search'], 'input.text'));
45 $savant->assign('albums', $search_results[0]);
46 $savant->assign('photos', $search_results[1]);
47 //$savant->assign('page', $page);
48 //$savant->assign('num_rows', $album_count);
49 $savant->display('photos/pa_search.tmpl.php');
50 include (AT_INCLUDE_PATH.'footer.inc.php');