3 $pa = new PhotoAlbum();
4 $album_size = sizeof($this->albums);
5 $photo_size = sizeof($this->photos);
8 <div id="uploader-contents">
9 <div class="album_panel">
11 <div class="search_bar">
12 <form action="<?php echo AT_PA_BASENAME.'search.php'; ?>" id="pa_search_form" name="pa_search_form" method="post">
13 <input type="text" class="s" name="pa_search" value="<?php echo $this->search_input; ?>" title="<?php echo _AT('search');?>" />
14 <input type="image" class="s_img" src="<?php echo AT_PA_BASENAME; ?>images/search_icon.png" alt="<?php echo _AT('search');?>" />
17 <?php if($this->num_rows > AT_PA_ALBUMS_PER_PAGE): ?>
19 <div class="paginator">
20 <?php print_paginator($this->page, $this->num_rows, 'type='.$this->type, AT_PA_ALBUMS_PER_PAGE, AT_PA_PAGE_WINDOW); ?>
26 <?php if(!empty($this->albums)): ?>
28 <h4><?php echo _AT('pa_albums') . ' ' . _AT('results'). ': ' . $album_size. ' ' . _AT('results'); ?></h4>
29 <?php if($album_size > AT_PA_SEARCH_MIN_ALBUM): ?>
30 <div class="search_slider_left"><a href="<?php echo $_SERVER['PHP_SELF']; ?>#n" onclick="slide('right');"><img src="<?php echo AT_PA_BASENAME; ?>images/prev.png" alt="<?php echo _AT('previous'); ?>" /></a></div>
32 <div class="search_slider search_slider_a" id="search_slider_a">
35 foreach($this->albums as $index=>$album):
36 $photo_info = $pa->getPhotoInfo($album['photo_id']);
39 <div class="search_photo_frame">
40 <?php if (!empty($photo_info)): ?>
41 <a href="<?php echo AT_PA_BASENAME.'albums.php?id='.$album['id'];?>"><img src="<?php echo AT_PA_BASENAME.'get_photo.php?aid='.$album['id'].SEP.'pid='.$album['photo_id'].SEP.'ph='.getPhotoFilePath($photo_info['id'], '', $photo_info['created_date']);?>" title="<?php echo AT_print($photo_info['description'], 'input.text'); ?>" alt="<?php echo AT_print($album['name'], 'input.text'); ?>" /></a>
43 <a href="<?php echo AT_PA_BASENAME.'albums.php?id='.$album['id'];?>"><img class="no-image" title="<?php echo _AT('pa_no_image'); ?>" alt="<?php echo _AT('pa_no_image'); ?>" /></a>
44 <?php endif; //album ?>
45 <span><?php echo AT_print($album['name'], 'photo_albums.name'); ?></span>
51 <?php if($album_size > AT_PA_SEARCH_MIN_ALBUM): ?>
52 <div class="search_slider_right"><a href="<?php echo $_SERVER['PHP_SELF']; ?>#n" onclick="slide('left');"><img src="<?php echo AT_PA_BASENAME; ?>images/next.png" alt="<?php echo _AT('next'); ?>" /></a></div>
58 <div class="album" style="min-width: 720px;">
59 <h4><?php echo _AT('pa_photos') . ' ' . _AT('results'). ': ' . $photo_size. ' ' . _AT('results'); ?></h4>
60 <?php if(!empty($this->photos)): ?>
61 <!-- dynamic paginator -->
62 <?php if($photo_size > AT_PA_PHOTO_SEARCH_PER_PAGE): ?>
63 <div class="paginator"><div class="paging">
66 $pages = ceil($photo_size/AT_PA_PHOTO_SEARCH_PER_PAGE);
67 for($i=1; $i <=$pages; $i++){
69 echo '<a id="p_'.$i.'" href="'. $_SERVER['PHP_SELF'] . '#n" ' . "onclick='go_to_page($i, $pages)' title='"._AT('page') . ' ' ."$i'>$i</li>";
76 <!-- end dynamic paginator -->
78 <div class="search_slider search_slider_p" id="search_slider_p">
80 <!-- loop through this -->
82 $loop_counter = 0; //counts the loop
83 foreach($this->photos as $key=>$photo):
86 if ($loop_counter==0){
91 <div class="photo_frame">
92 <a href="<?php echo AT_PA_BASENAME.'photo.php?pid='.$photo['id'].SEP.'aid='.$photo['album_id'];?>"><img src="<?php echo AT_PA_BASENAME.'get_photo.php?aid='.$photo['album_id'].SEP.'pid='.$photo['id'].SEP.'ph='.getPhotoFilePath($photo['id'], '', $photo['created_date']);?>" title="<?php echo AT_print($photo['description'], 'input.text'); ?>" alt="<?php echo AT_print($photo['alt_text'], 'input.text');?>" /></a>
95 if ($loop_counter>=AT_PA_PHOTO_SEARCH_PER_PAGE) {
104 <div class="edit_photo_box">
105 <p><?php echo _AT('pa_no_photos'); ?></p>
113 <script type="text/javascript">
115 var album_cnt = 0; //number of times, global
116 var album_size = <?php echo $album_size; ?>; //size of albums
117 var photo_size = <?php echo $photo_size; ?>; //size of photos
118 var ALBUM_PIC_WIDTH = <?php echo AT_PA_ALBUM_PIC_WIDTH; ?>; //check the CSS and constants.inc.php
119 var PHOTO_PIC_WIDTH = <?php echo AT_PA_PHOTO_PIC_WIDTH; ?>;
122 * Slide the album list
123 * @param string left/right
125 function slide(direction){
127 album_ul = jQuery('#search_slider_a').find('ul');
128 if (direction=='left'){
133 var album_offset = -1 * ALBUM_PIC_WIDTH * album_cnt;
136 if (album_size * ALBUM_PIC_WIDTH + album_offset > 0 && album_cnt >= 0){
137 album_ul.animate({left: album_offset});
140 if (direction=='left'){
149 * click on the page and will slide accordingly
150 * @param int page number
152 function go_to_page(page, max_page){
154 photo_ul = jQuery('#search_slider_p').find('ul');
155 photo_offset = -1 * PHOTO_PIC_WIDTH * (page - 1) * 5;
158 if (page >= 1 && page <= max_page){
159 jQuery("a[id^='p_']").removeClass('current'); //remove all selector prefixed with "p_"
160 jQuery('#p_'+page).addClass('current'); //set current
161 photo_ul.animate({left: photo_offset});