[Linpha-cvs] SF.net SVN: linpha: [4413] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-03-15 21:46:19
|
Revision: 4413 Author: fangehrn Date: 2006-03-15 13:45:53 -0800 (Wed, 15 Mar 2006) ViewCVS: http://svn.sourceforge.net/linpha/?rev=4413&view=rev Log Message: ----------- * adding "browse by date" feature Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/index.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.other.php trunk/linpha2/lib/modules/module.albums.php trunk/linpha2/templates/main_html/view_thumb.html.php trunk/linpha2/templates/main_html/view_thumbdetail.html.php Added Paths: ----------- trunk/linpha2/lib/modules/module.browse.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-03-14 21:00:36 UTC (rev 4412) +++ trunk/linpha2/ChangeLog 2006-03-15 21:45:53 UTC (rev 4413) @@ -1,3 +1,6 @@ +2006-03-15 flo + * adding "browse by date" feature + 2006-03-14 flo * show image information * adding "browse by date" feature Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2006-03-14 21:00:36 UTC (rev 4412) +++ trunk/linpha2/index.php 2006-03-15 21:45:53 UTC (rev 4413) @@ -34,6 +34,9 @@ case 'basket': include_once(LINPHA_DIR.'/lib/modules/module.basket.php'); break; +case 'browse': + include_once(LINPHA_DIR.'/lib/modules/module.browse.php'); + break; } ?> \ No newline at end of file Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-03-14 21:00:36 UTC (rev 4412) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-03-15 21:45:53 UTC (rev 4413) @@ -45,7 +45,7 @@ /** * set current view (thumb, thumbdetail, img, basket, ...) */ -function setCurrentView() +function setCurrentView($modulename) { $this->id_parent = 0; @@ -133,9 +133,19 @@ } else { - $this->id_current = 0; - $this->id_parent = 0; - $this->view = 'thumbdetail_view'; + switch($modulename) + { + case 'albums': + $this->id_current = 0; + $this->id_parent = 0; + $this->view = 'thumbdetail_view'; + break; + case 'browse': + $this->id_current = 0; + $this->view = 'thumb_view'; + //$_GET['id'] = -1; + break; + } } } @@ -354,6 +364,7 @@ } else { + $_GET['pn'] = 1; $this->current_page = 1; } @@ -465,7 +476,7 @@ */ function setSubFolders() { - $this->output['folders'] = ''; + $output_folders = ''; $nr_folders = 0; if($GLOBALS['show_subfolders_separate']) { @@ -473,11 +484,16 @@ { if($value['img_type'] == 0) { - $this->output['folders'] .= '<a href="'.LINPHA_DIR.'/?cat=alb&id='.$value['id'].'">'.$value['name'].'</a><br />'; + $output_folders .= '<a href="'.LINPHA_DIR.'/?cat=alb&id='.$value['id'].'">'.$value['name'].'</a><br />'; $nr_folders++; } } } + + if(! empty($output_folders)) + { + $this->output['navigation'] .= '<br /><br />'.$output_folders; + } $this->tot_photos = count($this->photos_filtered) - $nr_folders; } @@ -520,7 +536,7 @@ $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'] .= $i.' ('.$data[0].'), '; + $this->output['browse_by_date'] .= '<a href="'.LINPHA_DIR.'/?cat=browse&year='.$i.'">'.$i.'</a> ('.$data[0].'), '; } } } @@ -771,14 +787,6 @@ . '<br />'.$this->photos_filtered[$this->current_key]['name']; $this->output['current_thumb'] = $this->viewImg_viewThumbHtml( $this->current_key , 'current' ); - - - - /** - * set navigation line - */ - $this->output['navigation'] .= ' <a href="'.$this->link_url.'&id='.$this->photos_filtered[$this->current_key]['id'].'">' - .$this->photos_filtered[$this->current_key]['name'].'</a>'; } } // end class linImgview Modified: trunk/linpha2/lib/classes/linpha.other.php =================================================================== --- trunk/linpha2/lib/classes/linpha.other.php 2006-03-14 21:00:36 UTC (rev 4412) +++ trunk/linpha2/lib/classes/linpha.other.php 2006-03-15 21:45:53 UTC (rev 4413) @@ -156,6 +156,15 @@ } } + /** + * append filename if one exists + */ + if($GLOBALS['linpha']->imgview->img_type!=0) + { + $str .= ' <a href="'.$GLOBALS['linpha']->imgview->link_url.'&id='.$GLOBALS['linpha']->imgview->id_current.'">' + .$GLOBALS['linpha']->imgview->filename.'</a>'; + } + return $str; } Modified: trunk/linpha2/lib/modules/module.albums.php =================================================================== --- trunk/linpha2/lib/modules/module.albums.php 2006-03-14 21:00:36 UTC (rev 4412) +++ trunk/linpha2/lib/modules/module.albums.php 2006-03-15 21:45:53 UTC (rev 4413) @@ -2,7 +2,7 @@ if(!defined('LINPHA_DIR')) { exit(1); } /** - * temporary set permission string and configs + * @todo temporary set permission string and configs */ $_SESSION["user_groups"] = ';1;'; $order_by = 'name ASC'; @@ -21,7 +21,7 @@ * set some infos */ $linpha->imgview->link_url = LINPHA_DIR.'/?cat=alb'; - $linpha->imgview->setCurrentView(); + $linpha->imgview->setCurrentView('albums'); /** * do import Added: trunk/linpha2/lib/modules/module.browse.php =================================================================== --- trunk/linpha2/lib/modules/module.browse.php (rev 0) +++ trunk/linpha2/lib/modules/module.browse.php 2006-03-15 21:45:53 UTC (rev 4413) @@ -0,0 +1,107 @@ +<?php +if(!defined('LINPHA_DIR')) { exit(1); } + +/** + * @todo temporary set permission string and configs + */ +$_SESSION["user_groups"] = ';1;'; +$order_by = 'name ASC'; + +/** + * 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 + */ + $url_base = LINPHA_DIR.'/?cat=browse'; + $url_append = ''; + + if(isset($_GET['year'])) + { + $url_append = '&year='.$_GET['year']; + + if(isset($_GET['month'])) + { + $url_append .= '&month='.$_GET['month']; + + if(isset($_GET['day'])) + { + $url_append = '&day='.$_GET['day']; + } + } + } + + + $linpha->imgview->link_url = $url_base.$url_append; + + + $linpha->imgview->setCurrentView('browse'); + +/** + * set 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> > '; + } + + 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 + */ + $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); + + /** + * 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].'), '; + } + } + + +/** + * 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); + + +$linpha->imgview->buildImgView(); +?> \ 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-14 21:00:36 UTC (rev 4412) +++ trunk/linpha2/templates/main_html/view_thumb.html.php 2006-03-15 21:45:53 UTC (rev 4413) @@ -29,9 +29,6 @@ <div id='navigation' class="navigation"> <?php echo $GLOBALS['linpha']->imgview->output['navigation']; ?> - <br /><br /> - <?php echo $GLOBALS['linpha']->imgview->output['folders']; ?> - <br /><br /> </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-14 21:00:36 UTC (rev 4412) +++ trunk/linpha2/templates/main_html/view_thumbdetail.html.php 2006-03-15 21:45:53 UTC (rev 4413) @@ -3,6 +3,13 @@ left<br />left<br />left<br />left<br />left<br />left<br /> </div> +<?php if($GLOBALS['linpha']->imgview->id_current!=0) { ?> +<div id='navigation' class="navigation"> + <?php echo $GLOBALS['linpha']->imgview->output['navigation']; ?> + <br /><br /> +</div> +<?php } ?> + <div id='maindiv' class='main'> <?php if($GLOBALS['linpha']->imgview->id_current==0) { /* show welcome only in top view */ ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |