[Linpha-cvs] SF.net SVN: linpha: [4426] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-03-21 23:14:25
|
Revision: 4426 Author: fangehrn Date: 2006-03-21 15:14:00 -0800 (Tue, 21 Mar 2006) ViewCVS: http://svn.sourceforge.net/linpha/?rev=4426&view=rev Log Message: ----------- * finished browse by date feature Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/import.php trunk/linpha2/get_thumb.php trunk/linpha2/index.php trunk/linpha2/lib/classes/linpha.functions.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.template_new.class.php trunk/linpha2/lib/modules/module.albums.php trunk/linpha2/lib/modules/module.basket.php trunk/linpha2/lib/modules/module.browse.php trunk/linpha2/templates/main_html/basket.html.php trunk/linpha2/templates/main_html/global.html.php trunk/linpha2/templates/main_html/home.html.php trunk/linpha2/templates/main_html/view_basket.html.php trunk/linpha2/templates/main_html/view_comment.html.php trunk/linpha2/templates/main_html/view_img.html.php trunk/linpha2/templates/main_html/view_meta.html.php trunk/linpha2/templates/main_html/view_thumb.head.php trunk/linpha2/templates/main_html/view_thumb.html.php trunk/linpha2/templates/main_html/view_thumbdetail.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/ChangeLog 2006-03-21 23:14:00 UTC (rev 4426) @@ -1,4 +1,7 @@ -2006-03-15 flo +2006-03-22 flo + * finished browse by date feature + +2006-03-20 flo * testing language stuff, really nice ;-) * small design review, making class img_view even more modular Modified: trunk/linpha2/admin/import.php =================================================================== --- trunk/linpha2/admin/import.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/admin/import.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -25,10 +25,10 @@ linImage::createThumbnail($data['id'],$data['img_type'],$force=false); } - if( isset($output['sys_log']) ) + if( isset($GLOBALS['linpha']->template->output['sys_log']) ) { echo 'Linpha Syslog:<br />'; - echo $output['sys_log']; + echo $GLOBALS['linpha']->template->output['sys_log']; } Modified: trunk/linpha2/get_thumb.php =================================================================== --- trunk/linpha2/get_thumb.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/get_thumb.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -35,9 +35,9 @@ $force = false; } - $output = linImage::createThumbnail($data['id'],$data['img_type'],$force); + $output_file = linImage::createThumbnail($data['id'],$data['img_type'],$force); Header("Content-type: image/jpeg"); - readfile( $output ); + readfile( $output_file ); } catch(Exception $error) { Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/index.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -7,12 +7,16 @@ * some init stuff * @todo where to place? */ + include_once(LINPHA_DIR.'/lib/classes/linpha.class.php'); + $linpha = new linpha(); + $linpha->sql->startSession(); + if(!isset($_GET['cat'])) { $_GET['cat'] = 'alb'; } - $output['menu_main'] = Array( + $linpha->template->output['menu_main'] = Array( Array('name' => 'home', 'value' => LINPHA_DIR . '/'), Array('name' => 'admin', 'value' => LINPHA_DIR . '/admin/'), Array('name' => 'search', 'value' => '#'), /*LINPHA_DIR . '/?cat=search'*/ Modified: trunk/linpha2/lib/classes/linpha.functions.php =================================================================== --- trunk/linpha2/lib/classes/linpha.functions.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/lib/classes/linpha.functions.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -64,7 +64,7 @@ { printMenuEntry('menu_main'); - if(isset($GLOBALS['output']['menu_optional'] ) ) + if(isset($GLOBALS['linpha']->template->output['menu_optional'] ) ) { /** * stuff for browsers with deactivated javascript @@ -97,7 +97,7 @@ ?> <div id="menu_switch"> - <a href="<?php echo $GLOBALS['linpha']->imgview->url_full.'&menu='.$link; + <a href="<?php echo $GLOBALS['linpha']->template->URL_full.'&menu='.$link; ?>"><?php echo $str_href; ?></a> </div> <?php /* @@ -111,7 +111,7 @@ menu_is_open = false; document.getElementById('menu_optional').style.visibility = 'hidden'; - document.getElementById('menu_switch').innerHTML = '<a href="<?php echo $GLOBALS['linpha']->imgview->url_full; + document.getElementById('menu_switch').innerHTML = '<a href="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" onclick="open_close_menu(); return false;">></a>'; } else @@ -119,7 +119,7 @@ menu_is_open = true; document.getElementById('menu_optional').style.visibility = ''; - document.getElementById('menu_switch').innerHTML = '<a href="<?php echo $GLOBALS['linpha']->imgview->url_full; + document.getElementById('menu_switch').innerHTML = '<a href="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" onclick="open_close_menu(); return false;"><</a>'; } } @@ -132,7 +132,7 @@ <?php } - if( isset( $GLOBALS['output']['menu_sub'] ) ) + if( isset( $GLOBALS['linpha']->template->output['menu_sub'] ) ) { printSubMenu(); } @@ -142,7 +142,7 @@ { echo '</div>'; echo '<div">Basket: '; - foreach($GLOBALS['output']['menu_sub'] AS $key=>$value) + foreach($GLOBALS['linpha']->template->output['menu_sub'] AS $key=>$value) { echo '<a href="'.$value.'">'.$key.'</a> '; } @@ -150,7 +150,7 @@ function printMenuEntry($index) { - foreach($GLOBALS['output'][$index] AS $key=>$value) + foreach($GLOBALS['linpha']->template->output[$index] AS $key=>$value) { echo "\n\n".'<ul>'."\n"; if(!is_array($value['value'])) @@ -207,14 +207,11 @@ } } - /** - * append filename if one exists - */ - if($GLOBALS['linpha']->imgview->img_type!=0) - { - $str .= ' <a href="'.$GLOBALS['linpha']->imgview->url_full.'">' - .$GLOBALS['linpha']->imgview->filename.'</a>'; - } + /** + * remove last 3 signs (the comma and the spaces) + */ + $str = substr($str,0,strlen($str)-3); + return $str; } @@ -222,12 +219,12 @@ function linSysLog($str) { - if( ! isset( $GLOBALS['output']['sys_log'] ) ) + if( ! isset( $GLOBALS['linpha']->template->output['sys_log'] ) ) { - $GLOBALS['output']['sys_log'] = ''; + $GLOBALS['linpha']->template->output['sys_log'] = ''; } - $GLOBALS['output']['sys_log'] .= $str; + $GLOBALS['linpha']->template->output['sys_log'] .= $str; } /** Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -20,8 +20,6 @@ class linImgview { public $view; -public $url_base, $url_full; -public $output; public $tot_photos; public $photos; public $photos_filtered; @@ -63,19 +61,21 @@ /** * check for valid id */ + if( isset($current_data) ) { $this->img_type = $current_data['img_type']; $this->filename = $current_data['name']; $this->md5sum = $current_data['md5sum']; $this->id_current = $current_data['id']; - $this->id_parent = $current_data['parent_id']; /** * switch between thumb_view and img_view */ if( $this->img_type == 0) { + $this->id_parent = $current_data['id']; // use current_id as parent_id, because we want to see the content of the actual folder! + if(isset($_SESSION['view'])) { switch($_SESSION['view']) @@ -100,6 +100,8 @@ } else { + $this->id_parent = $current_data['parent_id']; // use parent_id on image view + if(isset($_SESSION['view'])) { switch($_SESSION['view']) @@ -222,7 +224,7 @@ */ foreach($GLOBALS['array_sort_orders'] AS $value) { - $array_sort_orders_links[] = Array('name' => i18n($value), 'value' => $this->url_full.'&order_by='.$value); + $array_sort_orders_links[] = Array('name' => i18n($value), 'value' => $GLOBALS['linpha']->template->URL_full.'&order_by='.$value); } $open_basket_link = LINPHA_DIR.'?cat=basket&ref_id='.$this->id_current; @@ -243,15 +245,15 @@ } foreach($GLOBALS['array_views'] AS $value) { - $array_views_links[] = Array('name' => i18n($value), 'value' => $this->url_full.'&view='.$value); + $array_views_links[] = Array('name' => i18n($value), 'value' => $GLOBALS['linpha']->template->URL_full.'&view='.$value); } - $GLOBALS['output']['menu_optional'] = Array( + $GLOBALS['linpha']->template->output['menu_optional'] = Array( Array( 'name' => 'basket', 'value' => Array( Array('name' => i18n('add all to basket'), 'value' => $open_basket_link.'&cmd=add_all'), - Array('name' => i18n('switch to basket view'), 'value' => $this->url_full.'&view=basket'), + Array('name' => i18n('switch to basket view'), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=basket'), Array('name' => i18n('open basket'), 'value' => $open_basket_link), Array('name' => i18n('in basket').': '.count($_SESSION['basket_ids']), 'value' => '#') ) @@ -274,15 +276,15 @@ Array( 'name' => 'metainfo', 'value' => Array( - Array('name' => i18n('edit album comment'), 'value' => $this->url_full.'&view=comment'), - Array('name' => i18n('edit album information'), 'value' => $this->url_full.'&view=meta') + Array('name' => i18n('edit album comment'), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=comment'), + Array('name' => i18n('edit album information'), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=meta') ) ) ); break; case 'img_view': - $GLOBALS['output']['menu_optional'] = Array( + $GLOBALS['linpha']->template->output['menu_optional'] = Array( Array( 'name' => 'basket', 'value' => Array( @@ -309,14 +311,14 @@ Array( 'name' => 'metainfo', 'value' => Array( - Array('name' => i18n('edit image information'), 'value' => $this->url_full.'&view=meta') + Array('name' => i18n('edit image information'), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=meta') ) ) ); break; case 'basket_view': - $GLOBALS['output']['menu_sub'] = Array( - 'back to normal view' => $this->url_full.'&view=thumb' + $GLOBALS['linpha']->template->output['menu_sub'] = Array( + 'back to normal view' => $GLOBALS['linpha']->template->URL_full.'&view=thumb' ); break; } @@ -338,11 +340,11 @@ if(isset($_GET['use_js'])) { $this->use_javascript = 1; - $this->url_base .= '&use_js=1'; - $this->url_full .= '&use_js=1'; - $this->output['page_nr_left'] = ''; - $this->output['page_nr_right'] = ''; - $this->output['page_nr'] = ''; + $GLOBALS['linpha']->template->URL_base .= '&use_js=1'; + $GLOBALS['linpha']->template->URL_full .= '&use_js=1'; + $GLOBALS['linpha']->template->output['page_nr_left'] = ''; + $GLOBALS['linpha']->template->output['page_nr_right'] = ''; + $GLOBALS['linpha']->template->output['page_nr'] = ''; /** @@ -350,23 +352,23 @@ * this is a normal javascript array * just another kind of definition... */ - $this->output['files_db'] = 'var img_ids = ['."\n"; + $GLOBALS['linpha']->template->output['files_db'] = 'var img_ids = ['."\n"; if($this->tot_photos > 0) // check if not all entries were folders { foreach($this->photos_filtered AS $key=>$value) { if( ( $GLOBALS['show_subfolders_separate'] && $value['img_type'] != 0 ) OR !$GLOBALS['show_subfolders_separate'] ) { - $this->output['files_db'] .= '{ id: "'.$value['id'].'", fn: "'.$value['name'].'" }, '; + $GLOBALS['linpha']->template->output['files_db'] .= '{ id: "'.$value['id'].'", fn: "'.$value['name'].'" }, '; } } /** * remove last 2 signs (the comma and the space) */ - $this->output['files_db'] = substr($this->output['files_db'],0,strlen($this->output['files_db'])-2); + $GLOBALS['linpha']->template->output['files_db'] = substr($GLOBALS['linpha']->template->output['files_db'],0,strlen($GLOBALS['linpha']->template->output['files_db'])-2); } - $this->output['files_db'] .= "\n".'];'; + $GLOBALS['linpha']->template->output['files_db'] .= "\n".'];'; } else { @@ -452,33 +454,33 @@ } } - $this->output['page_nr'] = $left_dots; + $GLOBALS['linpha']->template->output['page_nr'] = $left_dots; for($i=$start_nr; $i <= $this->nr_pages; $i++) { if($i == $this->current_page) { - $this->output['page_nr'] .= $i.' '; + $GLOBALS['linpha']->template->output['page_nr'] .= $i.' '; } else { - $this->output['page_nr'] .= '<a href="'.$this->url_full.'&pn='.$i.'">'.$i.'</a> '; + $GLOBALS['linpha']->template->output['page_nr'] .= '<a href="'.$GLOBALS['linpha']->template->URL_full.'&pn='.$i.'">'.$i.'</a> '; } } - $this->output['page_nr'] .= $right_dots; + $GLOBALS['linpha']->template->output['page_nr'] .= $right_dots; /** * write starting ' << ' and ' < ' */ if($this->current_page != 1) { - $this->output['page_nr_left'] = '<a href="'.$this->url_full.'&pn=1"><<</a> ' . - '<a href="'.$this->url_full.'&pn='.($this->current_page-1).'"><</a> '; + $GLOBALS['linpha']->template->output['page_nr_left'] = '<a href="'.$GLOBALS['linpha']->template->URL_full.'&pn=1"><<</a> ' . + '<a href="'.$GLOBALS['linpha']->template->URL_full.'&pn='.($this->current_page-1).'"><</a> '; } else { - $this->output['page_nr_left'] = '<< <'; + $GLOBALS['linpha']->template->output['page_nr_left'] = '<< <'; } /** @@ -486,12 +488,12 @@ */ if($this->current_page != $this->nr_pages && $this->nr_pages != 0) // need check nr_pages != 0 because we don't need links if nr_pages == 0! { - $this->output['page_nr_right'] = '<a href="'.$this->url_full.'&pn='.($this->current_page+1).'">></a> ' . - '<a href="'.$this->url_full.'&pn='.($this->nr_pages).'">>></a> '; + $GLOBALS['linpha']->template->output['page_nr_right'] = '<a href="'.$GLOBALS['linpha']->template->URL_full.'&pn='.($this->current_page+1).'">></a> ' . + '<a href="'.$GLOBALS['linpha']->template->URL_full.'&pn='.($this->nr_pages).'">>></a> '; } else { - $this->output['page_nr_right'] = '> >>'; + $GLOBALS['linpha']->template->output['page_nr_right'] = '> >>'; } } @@ -517,7 +519,7 @@ if(! empty($output_folders)) { - $this->output['navigation'] .= '<br /><br />'.$output_folders; + $GLOBALS['linpha']->template->output['navigation'] .= '<br /><br />'.$output_folders; } $this->tot_photos = count($this->photos_filtered) - $nr_folders; } @@ -554,13 +556,13 @@ /** * get years between */ - $this->output['browse_by_date'] = ''; + $GLOBALS['linpha']->template->output['browse_by_date'] = ''; for($i = $min_year; $i <= $max_year; $i++) { $data = $GLOBALS['linpha']->db->GetRow("SELECT count(datetimeoriginal) FROM ".PREFIX."meta_exif WHERE datetimeoriginal LIKE '".$i."%'"); if($data[0]>0) { - $this->output['browse_by_date'] .= '<a href="'.LINPHA_DIR.'/?cat=browse&year='.$i.'">'.$i.'</a> ('.$data[0].'), '; + $GLOBALS['linpha']->template->output['browse_by_date'] .= '<a href="'.LINPHA_DIR.'/?cat=browse&year='.$i.'">'.$i.'</a> ('.$data[0].'), '; } } } @@ -578,12 +580,12 @@ break; } - $this->output['random_images'] = Array(); + $GLOBALS['linpha']->template->output['random_images'] = Array(); $query = $GLOBALS['linpha']->db->SelectLimit("SELECT id FROM ".PREFIX."photos WHERE img_type <> 0 ORDER by ".$str_random,$GLOBALS['nr_random_images']); while($data = $query->FetchRow()) { $path = implode('/',linSql::getFullFilenameFromId($data['id'])); - $this->output['random_images'][] = Array('id'=>$data['id'],'path'=>$path); + $GLOBALS['linpha']->template->output['random_images'][] = Array('id'=>$data['id'],'path'=>$path); } } @@ -730,7 +732,7 @@ if($value != '') { - $this->output['image_infos'][$data['name']] = Array('name' => $name, 'value' => $value); + $GLOBALS['linpha']->template->output['image_infos'][$data['name']] = Array('name' => $name, 'value' => $value); } } @@ -745,7 +747,7 @@ $name = $this->photos_filtered[$key]['name']; $str = '<div class="div_'.$class.'thumb">' - . '<a href="'.$this->url_base.'&id='.$id.'">' + . '<a href="'.$GLOBALS['linpha']->template->URL_base.'&id='.$id.'">' . '<img class="img_'.$class.'thumb" src="'.LINPHA_DIR.'/get_thumb.php?id='.$id.'" /></a>' . '<br />'.$name.'</div>'."\n"; @@ -778,26 +780,34 @@ } /** + * ooh, something went wrong + */ + if(!isset($this->current_key)) + { + $this->current_key = 0; + } + + /** * set prev thumbs */ - $this->output['prev_thumb'] = ''; + $GLOBALS['linpha']->template->output['prev_thumb'] = ''; for($i=$GLOBALS['nr_prev_next_thumbs']; $i > 0; $i--) { if($this->current_key >= $i) { - $this->output['prev_thumb'] .= $this->viewImg_viewThumbHtml( $this->current_key - $i , 'prevnext' ); + $GLOBALS['linpha']->template->output['prev_thumb'] .= $this->viewImg_viewThumbHtml( $this->current_key - $i , 'prevnext' ); } } /** * set next thumbs */ - $this->output['next_thumb'] = ''; + $GLOBALS['linpha']->template->output['next_thumb'] = ''; for($i=0; $i < $GLOBALS['nr_prev_next_thumbs']; $i++) { if($this->current_key < ( count($this->photos_filtered) - ($i+1) ) ) { - $this->output['next_thumb'] .= $this->viewImg_viewThumbHtml($this->current_key + ($i+1) ,'prevnext'); + $GLOBALS['linpha']->template->output['next_thumb'] .= $this->viewImg_viewThumbHtml($this->current_key + ($i+1) ,'prevnext'); } } @@ -805,11 +815,11 @@ /** * set current thumb and image */ - $this->output['image'] = '<img class="mainimage" src="'.LINPHA_DIR.'/get_thumb.php?id=' + $GLOBALS['linpha']->template->output['image'] = '<img class="mainimage" src="'.LINPHA_DIR.'/get_thumb.php?id=' . $this->photos_filtered[$this->current_key]['id'] . '" />' . '<br />'.$this->photos_filtered[$this->current_key]['name']; - $this->output['current_thumb'] = $this->viewImg_viewThumbHtml( $this->current_key , 'current' ); + $GLOBALS['linpha']->template->output['current_thumb'] = $this->viewImg_viewThumbHtml( $this->current_key , 'current' ); } } // end class linImgview Modified: trunk/linpha2/lib/classes/linpha.template_new.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template_new.class.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/lib/classes/linpha.template_new.class.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -3,6 +3,8 @@ class linTemplate { public $template_name; + public $output; + public $URL_base, $URL_full; private $body_name; private $head_name; Modified: trunk/linpha2/lib/modules/module.albums.php =================================================================== --- trunk/linpha2/lib/modules/module.albums.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/lib/modules/module.albums.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -10,22 +10,18 @@ /** * init */ - include_once(LINPHA_DIR.'/lib/classes/linpha.class.php'); - $linpha = new linpha(); - $linpha->sql->startSession(); - include_once(LINPHA_DIR . '/lib/classes/linpha.imgview.class.php'); $linpha->imgview = new linImgview(); /** * set some infos */ - $linpha->imgview->url_base = LINPHA_DIR.'/?cat=alb'; + $linpha->template->URL_base = LINPHA_DIR.'/?cat=alb'; if(isset($_GET['id'])) { - $linpha->imgview->url_full = LINPHA_DIR.'/?cat=alb&id='.$_GET['id']; + $linpha->template->URL_full = LINPHA_DIR.'/?cat=alb&id='.$_GET['id']; } else { - $linpha->imgview->url_full = LINPHA_DIR.'/?cat=alb'; + $linpha->template->URL_full = LINPHA_DIR.'/?cat=alb'; } $linpha->imgview->setCurrentView('albums'); @@ -41,7 +37,7 @@ /** * set navigation line */ - $linpha->imgview->output['navigation'] = set_navigation_line( $linpha->imgview->id_current ); + $GLOBALS['linpha']->template->output['navigation'] = set_navigation_line( $linpha->imgview->id_current ); /** @@ -58,6 +54,5 @@ $linpha->imgview->photos = array_merge($array_folders,$array_files); - $linpha->imgview->buildImgView(); ?> \ No newline at end of file Modified: trunk/linpha2/lib/modules/module.basket.php =================================================================== --- trunk/linpha2/lib/modules/module.basket.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/lib/modules/module.basket.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -2,13 +2,6 @@ if(!defined('LINPHA_DIR')) { exit(1); } /** - * init - */ - include_once(LINPHA_DIR.'/lib/classes/linpha.class.php'); - $linpha = new linpha(); - $linpha->sql->startSession(); - -/** * parse POST data and GET commands */ /** @@ -96,6 +89,6 @@ $linpha->template->setModuleName('basket'); -$linpha->template->UrlFull = LINPHA_DIR.'/?cat=basket&ref_id='.$_GET['ref_id']; +$linpha->template->URL_full = LINPHA_DIR.'/?cat=basket&ref_id='.$_GET['ref_id']; include_once(LINPHA_DIR.'/templates/'.$linpha->template->template_name.'_html/global.html.php'); ?> \ No newline at end of file Modified: trunk/linpha2/lib/modules/module.browse.php =================================================================== --- trunk/linpha2/lib/modules/module.browse.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/lib/modules/module.browse.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -10,97 +10,207 @@ /** * init */ - include_once(LINPHA_DIR.'/lib/classes/linpha.class.php'); - $linpha = new linpha(); - $linpha->sql->startSession(); - include_once(LINPHA_DIR . '/lib/classes/linpha.imgview.class.php'); $linpha->imgview = new linImgview(); /** * set some infos */ + $linpha->imgview->setCurrentView('browse'); + $url_base = LINPHA_DIR.'/?cat=browse'; $url_append = ''; - if(isset($_GET['year'])) { - $url_append = '&year='.$_GET['year']; + $url_append = '&year='.$_GET['year']; if(isset($_GET['month'])) { - $url_append .= '&month='.$_GET['month']; + $url_append .= '&month='.$_GET['month']; if(isset($_GET['day'])) { - $url_append = '&day='.$_GET['day']; + $url_append .= '&day='.$_GET['day']; } } } + $linpha->template->URL_base = $url_base.$url_append; - $linpha->imgview->link_url = $url_base.$url_append; - - - $linpha->imgview->setCurrentView('browse'); + if(isset($_GET['id'])) + { + $url_append .= '&id='.$_GET['id']; + } + $linpha->template->URL_full = $url_base.$url_append; /** - * set navigation line + * set date and navigation line */ - $linpha->imgview->output['navigation'] = '<a href="'.$url_base.'">all</a> > '; - - if(isset($_GET['year'])) - { - $linpha->imgview->output['navigation'] .= '<a href="'.$url_base.'&year='.$_GET['year'].'">'.$_GET['year'].'</a> > '; - } + $search_string = ''; + $str_navigation = '<a href="'.$url_base.'">all</a> > '; + $str_datelinks = i18n("Years").': '; - if(isset($_GET['month'])) - { - $linpha->imgview->output['navigation'] .= '<a href="'.$url_base.'&year='.$_GET['year'].'&month='.$_GET['month'].'">'.$_GET['month'].'</a> > '; - } - - if(isset($_GET['day'])) - { - $linpha->imgview->output['navigation'] .= '<a href="'.$url_base.'&year='.$_GET['year'].'&month='.$_GET['month'].'&day='.$_GET['day'].'">'.$_GET['day'].'</a> > '; - } - - if($linpha->imgview->id_current != 0) - { - $linpha->imgview->output['navigation'] .= '<a href="'.$linpha->imgview->link_url.'&id='.$GLOBALS['linpha']->imgview->id_current.'">' - .$GLOBALS['linpha']->imgview->filename.'</a>'; - } - /** - * set date links + * year */ $data = $GLOBALS['linpha']->db->GetRow("SELECT min(datetimeoriginal), max(datetimeoriginal) " . "FROM ".PREFIX."meta_exif"); - - /** - * get min and max year - */ + $min_year = substr($data[0],0,4); $max_year = substr($data[1],0,4); + $sum = 0; + /** * get years between */ - $linpha->imgview->output['navigation'] .= '<br /><br />'; for($i = $min_year; $i <= $max_year; $i++) { $data = $GLOBALS['linpha']->db->GetRow("SELECT count(datetimeoriginal) FROM ".PREFIX."meta_exif WHERE datetimeoriginal LIKE '".$i."%'"); if($data[0]>0) { - $linpha->imgview->output['navigation'] .= '<a href="'.$url_base.'&year='.$i.'">'.$i.'</a> ('.$data[0].'), '; + if(isset($_GET['year']) && $i == $_GET['year']) + { + $str_datelinks .= $i.' ('.$data[0].'), '; + } + else + { + $str_datelinks .= '<a href="'.$url_base.'&year='.$i.'">'.$i.'</a> ('.$data[0].'), '; + } + + $sum += $data[0]; } } + + /** + * calc not indexed images + */ + $data = $GLOBALS['linpha']->db->GetRow("SELECT sum( stats_numbers ) FROM ".PREFIX."photos WHERE parent_id = '0' GROUP BY parent_id"); + $str_datelinks .= '<a href="'.$url_base.'&year=0">'.i18n("not indexed").'</a> ('.($data[0]-$sum).')'; + if(isset($_GET['year']) && $_GET['year'] != 0) + { + $str_navigation .= '<a href="'.$url_base.'&year='.$_GET['year'].'">'.$_GET['year'].'</a> > '; + $search_string = $_GET['year']; + + /** + * show month links + */ + $str_datelinks .= '<br />'.i18n("Months").': '; + for($i=1; $i <= 12; $i++) + { + if(strlen($i)==1) + { + $i = "0".$i; + } + + $data = $GLOBALS['linpha']->db->GetRow("SELECT count(datetimeoriginal) FROM ".PREFIX."meta_exif " . + "WHERE datetimeoriginal LIKE '".linSql::linAddslashes($search_string).":".$i."%'"); + if($data[0]>0) + { + if(isset($_GET['month']) && $i == $_GET['month']) + { + $str_datelinks .= $i.' ('.$data[0].'), '; + } + else + { + $str_datelinks .= '<a href="'.$url_base.'&year='.$_GET['year'].'&month='.$i.'">'.$i.'</a> ('.$data[0].'), '; + } + } + } + } + /** + * month + */ + if(isset($_GET['month'])) + { + $str_navigation .= '<a href="'.$url_base.'&year='.$_GET['year'].'&month='.$_GET['month'].'">'.$_GET['month'].'</a> > '; + $search_string = $_GET['year'].':'.$_GET['month']; + + /** + * show day links + */ + $str_datelinks .= '<br />'.i18n("Days").': '; + for($i=1; $i <= 31; $i++) + { + if(strlen($i)==1) + { + $i = "0".$i; + } + + $data = $GLOBALS['linpha']->db->GetRow("SELECT count(datetimeoriginal) FROM ".PREFIX."meta_exif " . + "WHERE datetimeoriginal LIKE '".linSql::linAddslashes($search_string).":".$i."%'"); + if($data[0]>0) + { + if(isset($_GET['day']) && $i == $_GET['day']) + { + $str_datelinks .= $i.' ('.$data[0].'), '; + } + else + { + $str_datelinks .= '<a href="'.$url_base.'&year='.$_GET['year'].'&month='.$_GET['month'].'&day='.$i.'">'.$i.'</a> ('.$data[0].'), '; + } + } + } + } + +/** + * day + */ + if(isset($_GET['day'])) + { + $str_navigation .= '<a href="'.$url_base.'&year='.$_GET['year'].'&month='.$_GET['month'].'&day='.$_GET['day'].'">'.$_GET['day'].'</a> > '; + $search_string = $_GET['year'].':'.$_GET['month'].':'.$_GET['day']; + } + +/** + * not indexed + * must be before filename + */ + if(isset($_GET['year']) && $_GET['year']==0) + { + $str_navigation .= '<a href="'.$url_base.'&year=0">'.i18n("not indexed").'</a> > '; + } + +/** + * filename + */ + if($linpha->imgview->id_current != 0) + { + $str_navigation .= '<a href="'.$linpha->template->URL_base.'&id='.$GLOBALS['linpha']->imgview->id_current.'">' + .$GLOBALS['linpha']->imgview->filename.'</a>'; + } + +/** + * write navigation and date links + */ + $GLOBALS['linpha']->template->output['navigation'] = $str_navigation.'<br /><br />'.$str_datelinks; + + +/** * get photos */ - $linpha->imgview->photos = $GLOBALS['linpha']->db->GetAssoc("SELECT id, name, img_type, stats_numbers, time_add FROM ".PREFIX."photos " . - "WHERE img_type <> '0' ORDER by ".$order_by); + /** + * not indexed + */ + if(isset($_GET['year']) && $_GET['year']==0) + { + $linpha->imgview->photos = $GLOBALS['linpha']->db->GetAssoc("SELECT id, name, img_type, stats_numbers, time_add " . + "FROM ".PREFIX."photos AS p LEFT OUTER JOIN ".PREFIX."meta_exif AS e ON p.md5sum = e.md5sum " . + "WHERE e.datetimeoriginal is NULL AND img_type <> '0' " . + "ORDER by ".$order_by); + } + else + { + $linpha->imgview->photos = $GLOBALS['linpha']->db->GetAssoc("SELECT id, name, img_type, stats_numbers, time_add " . + "FROM ".PREFIX."photos AS p, ".PREFIX."meta_exif AS e " . + "WHERE p.md5sum = e.md5sum " . + "AND img_type <> '0' " . + "AND e.datetimeoriginal LIKE '".$search_string."%' " . + "ORDER by ".$order_by); + } $linpha->imgview->buildImgView(); Modified: trunk/linpha2/templates/main_html/basket.html.php =================================================================== --- trunk/linpha2/templates/main_html/basket.html.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/templates/main_html/basket.html.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -1,11 +1,11 @@ -<form name="basket" action="<?php echo $GLOBALS['linpha']->template->UrlFull; ?>&cmd=remove_selected" method="POST"> +<form name="basket" action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>&cmd=remove_selected" method="POST"> <div class='navigation'> -<a href="<?php echo LINPHA_DIR.'/?cat=alb&id='.$_GET['ref_id']; ?>"><?php i18n("Go Back"); ?></a> -<a href="<?php echo $GLOBALS['linpha']->template->UrlFull; ?>&cmd=remove_all"><?php i18n("Remove All"); ?></a> -<input type="submit" name="submit" value="remove selected" /> +<a href="<?php echo LINPHA_DIR.'/?cat=alb&id='.$_GET['ref_id']; ?>"><?php echo i18n("Go Back"); ?></a> +<a href="<?php echo $GLOBALS['linpha']->template->URL_full; ?>&cmd=remove_all"><?php echo i18n("Remove all"); ?></a> +<input type="submit" name="submit" value="<?php echo i18n("Remove selected"); ?>" /> <br /><br /> -<?php i18n("Images In Basket");?>:<?php echo count($_SESSION['basket_ids']); ?> +<?php echo i18n("Images in basket");?>: <?php echo count($_SESSION['basket_ids']); ?> </div> <div id='maindiv' class='main'> @@ -90,7 +90,7 @@ <?php } else { - i18n("Empty Basket"); + echo i18n("Empty Basket"); } ?> </div> Modified: trunk/linpha2/templates/main_html/global.html.php =================================================================== --- trunk/linpha2/templates/main_html/global.html.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/templates/main_html/global.html.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -1,7 +1,7 @@ <html> <head> <link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'_css/global.css'; ?>' type='text/css'> -<?php if( isset($GLOBALS['output']['sys_log'])) { ?> +<?php if( isset($GLOBALS['linpha']->template->output['sys_log'])) { ?> <style> .sys_log { position: absolute; @@ -34,12 +34,12 @@ </head> <body> -<?php if( isset($GLOBALS['output']['sys_log']) ) { ?> +<?php if( isset($GLOBALS['linpha']->template->output['sys_log']) ) { ?> <div id="sys_log" class="sys_log"> <div class="sys_log_close"><a href="javascript:toggleWindow()">X</a></div> <div id="sys_log_text" class="sys_log_text"> Linpha Syslog:<br /> - <?php echo $GLOBALS['output']['sys_log']; ?> + <?php echo $GLOBALS['linpha']->template->output['sys_log']; ?> </div> </div> <script language="JavaScript" type="text/javascript"> Modified: trunk/linpha2/templates/main_html/home.html.php =================================================================== --- trunk/linpha2/templates/main_html/home.html.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/templates/main_html/home.html.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -10,11 +10,11 @@ <hr /> -<?php if( count($GLOBALS['linpha']->imgview->output['random_images']) > 0 ) { ?> +<?php if( count($GLOBALS['linpha']->template->output['random_images']) > 0 ) { ?> <h1><?php echo i18n("Random images"); ?></h1> <div class='div_random'> <?php - foreach($GLOBALS['linpha']->imgview->output['random_images'] AS $key=>$value) + foreach($GLOBALS['linpha']->template->output['random_images'] AS $key=>$value) { ?> <div class='div_random_img'> @@ -29,7 +29,7 @@ <hr /> <?php } ?> -<?php echo i18n("Browse by Date").': '.$GLOBALS['linpha']->imgview->output['browse_by_date']; ?><br /> +<?php echo i18n("Browse by Date").': '.$GLOBALS['linpha']->template->output['browse_by_date']; ?><br /> <hr /> <h1><?php echo i18n("Albums"); ?></h1> Modified: trunk/linpha2/templates/main_html/view_basket.html.php =================================================================== --- trunk/linpha2/templates/main_html/view_basket.html.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/templates/main_html/view_basket.html.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -7,13 +7,13 @@ <div class="page_nr_main"> <!-- cannot use floated div in another div !! in this div it is possible because it has position: absolute --> - <div class='page_nr' id='page_nr_right'><?php echo $GLOBALS['linpha']->imgview->output['page_nr_right']; ?></div> - <div class='page_nr' id='page_nr' style="width: 350px; text-align: center;"><?php echo $GLOBALS['linpha']->imgview->output['page_nr']; ?></div> - <div class='page_nr' id='page_nr_left'><?php echo $GLOBALS['linpha']->imgview->output['page_nr_left']; ?></div> + <div class='page_nr' id='page_nr_right'><?php echo $GLOBALS['linpha']->template->output['page_nr_right']; ?></div> + <div class='page_nr' id='page_nr' style="width: 350px; text-align: center;"><?php echo $GLOBALS['linpha']->template->output['page_nr']; ?></div> + <div class='page_nr' id='page_nr_left'><?php echo $GLOBALS['linpha']->template->output['page_nr_left']; ?></div> </div> <div class="navigation"> - <?php echo $GLOBALS['linpha']->imgview->output['navigation']; ?> + <?php echo $GLOBALS['linpha']->template->output['navigation']; ?> <br /><br /> Images in basket: <?php echo count($_SESSION['basket_ids']); ?> (<a href="<?php echo LINPHA_DIR.'?cat=basket&ref_id='.$GLOBALS['linpha']->imgview->id_current; ?>">open basket</a>) Modified: trunk/linpha2/templates/main_html/view_comment.html.php =================================================================== --- trunk/linpha2/templates/main_html/view_comment.html.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/templates/main_html/view_comment.html.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -28,11 +28,11 @@ ?> <div id='maindiv' class='main'> -<form action="<?php echo $GLOBALS['linpha']->imgview->link_url.'&id='.$GLOBALS['linpha']->imgview->id_current; ?>" method="POST"> +<form action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" method="POST"> <?php $data = $GLOBALS['linpha']->db->GetRow("SELECT id, time, author, comment FROM ".PREFIX."meta_comments"); ?> -<a href="<?php echo $GLOBALS['linpha']->imgview->link_url.'&id='.$GLOBALS['linpha']->imgview->id_current.'&view=thumb'; ?>">back</a> +<a href="<?php echo $GLOBALS['linpha']->template->URL_full.'&view=thumb'; ?>">back</a> <br /><br /> Author: Modified: trunk/linpha2/templates/main_html/view_img.html.php =================================================================== --- trunk/linpha2/templates/main_html/view_img.html.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/templates/main_html/view_img.html.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -1,6 +1,6 @@ <div class="left"> <?php - foreach($GLOBALS['linpha']->imgview->output['image_infos'] AS $value) + foreach($GLOBALS['linpha']->template->output['image_infos'] AS $value) { echo $value['name'].': '.$value['value'].'<br />'; } @@ -9,22 +9,22 @@ <div class="navigation"> - <?php echo $GLOBALS['linpha']->imgview->output['navigation']; ?> + <?php echo $GLOBALS['linpha']->template->output['navigation']; ?> <br /><br /> </div> <div class="div_all_main"> <div class="div_all_prevthumb"> - <?php echo $GLOBALS['linpha']->imgview->output['prev_thumb']; ?> + <?php echo $GLOBALS['linpha']->template->output['prev_thumb']; ?> </div> - <?php echo $GLOBALS['linpha']->imgview->output['current_thumb']; ?> + <?php echo $GLOBALS['linpha']->template->output['current_thumb']; ?> <div class="div_all_nextthumb"> - <?php echo $GLOBALS['linpha']->imgview->output['next_thumb']; ?> + <?php echo $GLOBALS['linpha']->template->output['next_thumb']; ?> </div> </div> <div id='maindiv' class='main'> -<?php echo $GLOBALS['linpha']->imgview->output['image']; ?> +<?php echo $GLOBALS['linpha']->template->output['image']; ?> <br /><br /> <?php @@ -46,7 +46,7 @@ ?> <div class="add_comment"> -<form action="<?php echo $GLOBALS['linpha']->imgview->link_url.'&id='.$GLOBALS['linpha']->imgview->id_current; ?>" method="POST"> +<form action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" method="POST"> <?php echo i18n("Add Comment"); ?>:<br /> <div id="comment_div_text"> <input type="text" id="comment_input_text" name="comment_text" value="" size="40" maxlength="40" /> Modified: trunk/linpha2/templates/main_html/view_meta.html.php =================================================================== --- trunk/linpha2/templates/main_html/view_meta.html.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/templates/main_html/view_meta.html.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -50,35 +50,35 @@ </style> <div class="navigation"> - <?php echo $GLOBALS['linpha']->imgview->output['navigation']; ?> + <?php echo $GLOBALS['linpha']->template->output['navigation']; ?> <br /><br /> </div> <div class="div_all_main"> <div class="div_all_prevthumb"> - <?php echo $GLOBALS['linpha']->imgview->output['prev_thumb']; ?> + <?php echo $GLOBALS['linpha']->template->output['prev_thumb']; ?> </div> - <?php echo $GLOBALS['linpha']->imgview->output['current_thumb']; ?> + <?php echo $GLOBALS['linpha']->template->output['current_thumb']; ?> <div class="div_all_nextthumb"> - <?php echo $GLOBALS['linpha']->imgview->output['next_thumb']; ?> + <?php echo $GLOBALS['linpha']->template->output['next_thumb']; ?> </div> </div> <div id='maindiv' class='main'> -<a href="<?php echo $GLOBALS['linpha']->imgview->link_url.'&id='.$GLOBALS['linpha']->imgview->id_current.'&view=img'; ?>">Back to normal view</a> +<a href="<?php echo $GLOBALS['linpha']->template->URL_full.'&view=img'; ?>">Back to normal view</a> <h1><?php i18n("Edit Image Imformation"); ?></h1> <?php $query = $GLOBALS['linpha']->db->Execute("SELECT id, name, field_type FROM ".PREFIX."meta_fields " . "WHERE flags = '5' OR flags = '7' ORDER by id"); $num = $query->RecordCount(); ?> -<form action="<?php echo $GLOBALS['linpha']->imgview->link_url.'&id='.$GLOBALS['linpha']->imgview->id_current; ?>" method="POST"> +<form action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" method="POST"> <table border='1'> <tr> <td width="150"><b><?php i18n("Name"); ?></b></td> <td width="200"><b><?php i18n("Value"); ?></b></td> - <td rowspan="<?php echo $num+1; ?>"><?php echo $GLOBALS['linpha']->imgview->output['image']; ?></td> + <td rowspan="<?php echo $num+1; ?>"><?php echo $GLOBALS['linpha']->template->output['image']; ?></td> </tr> <?php while($data = $query->FetchRow()) Modified: trunk/linpha2/templates/main_html/view_thumb.head.php =================================================================== --- trunk/linpha2/templates/main_html/view_thumb.head.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/templates/main_html/view_thumb.head.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -3,10 +3,10 @@ var tot_photos = <?php echo $GLOBALS['linpha']->imgview->tot_photos; ?>; var startup_page = 1; var link_get_thumb = '<?php echo LINPHA_DIR.'/get_thumb.php?id='; ?>'; -var link_url = '<?php echo $GLOBALS['linpha']->imgview->url_base; ?>'; +var link_url = '<?php echo convert_amp($GLOBALS['linpha']->template->URL_base); ?>'; var tn_size = <?php echo $GLOBALS['def_tn_size']; ?>; var photos_per_page = 'auto'; -<?php echo $GLOBALS['linpha']->imgview->output['files_db']."\n"; ?> +<?php echo $GLOBALS['linpha']->template->output['files_db']."\n"; ?> </script> <script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/classes/thumbnails.js"> </script> <?php } ?> \ No newline at end of file Modified: trunk/linpha2/templates/main_html/view_thumb.html.php =================================================================== --- trunk/linpha2/templates/main_html/view_thumb.html.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/templates/main_html/view_thumb.html.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -28,7 +28,7 @@ </div> <div id='navigation' class="navigation"> - <?php echo $GLOBALS['linpha']->imgview->output['navigation']; ?> + <?php echo $GLOBALS['linpha']->template->output['navigation']; ?> </div> <div id='maindiv' class='main'> @@ -48,20 +48,20 @@ ?> <script language="JavaScript" type="text/javascript"> <!-- - location.href = "<?php echo convert_amp($GLOBALS['linpha']->imgview->url_full.'&use_js=1'); ?>"; + location.href = "<?php echo convert_amp($GLOBALS['linpha']->template->URL_full.'&use_js=1'); ?>"; //--> </script> <div class="page_nr_main"> <!-- cannot use floated div in another div !! in this div it is possible because it has position: absolute --> - <div class='page_nr' id='page_nr_right'><?php echo $GLOBALS['linpha']->imgview->output['page_nr_right']; ?></div> - <div class='page_nr' id='page_nr' style="width: 350px; text-align: center;"><?php echo $GLOBALS['linpha']->imgview->output['page_nr']; ?></div> - <div class='page_nr' id='page_nr_left'><?php echo $GLOBALS['linpha']->imgview->output['page_nr_left']; ?></div> + <div class='page_nr' id='page_nr_right'><?php echo $GLOBALS['linpha']->template->output['page_nr_right']; ?></div> + <div class='page_nr' id='page_nr' style="width: 350px; text-align: center;"><?php echo $GLOBALS['linpha']->template->output['page_nr']; ?></div> + <div class='page_nr' id='page_nr_left'><?php echo $GLOBALS['linpha']->template->output['page_nr_left']; ?></div> </div> <div class="navigation"> - <?php echo $GLOBALS['linpha']->imgview->output['navigation']; ?> + <?php echo $GLOBALS['linpha']->template->output['navigation']; ?> </div> <div id='maindiv' class='main'> Modified: trunk/linpha2/templates/main_html/view_thumbdetail.html.php =================================================================== --- trunk/linpha2/templates/main_html/view_thumbdetail.html.php 2006-03-20 18:45:06 UTC (rev 4425) +++ trunk/linpha2/templates/main_html/view_thumbdetail.html.php 2006-03-21 23:14:00 UTC (rev 4426) @@ -4,7 +4,7 @@ </div> <div id='navigation' class="navigation"> - <?php echo $GLOBALS['linpha']->imgview->output['navigation']; ?> + <?php echo $GLOBALS['linpha']->template->output['navigation']; ?> <br /><br /> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |